From 7a3c3928b0a14d2f170a900077bd59e289a8a497 Mon Sep 17 00:00:00 2001 From: ysl3000 Date: Fri, 24 Jan 2020 22:20:40 +0100 Subject: [PATCH] Dropped pre-flattening --- PathfinderAPI/pom.xml | 2 +- PathfinderPlugin/pom.xml | 9 +- .../pathfinding/PathfinderGoalPlugin.kt | 1 - PathfinderTestPlugin/pom.xml | 2 +- PathfinderTestPluginJava/pom.xml | 2 +- Pathfinder_1_12/pom.xml | 58 ------- .../v1_12_R1/entity/CraftInsentient.kt | 162 ------------------ .../v1_12_R1/pathfinding/CraftNavigation.kt | 17 -- .../pathfinding/CraftPathfinderGoalWrapper.kt | 26 --- .../pathfinding/CraftPathfinderManager.kt | 21 --- .../pathfinding/CraftPathfinderPlayer.kt | 28 --- Pathfinder_1_13_2/pom.xml | 2 +- Pathfinder_1_14/pom.xml | 2 +- Pathfinder_1_15/pom.xml | 2 +- pom.xml | 3 +- update-version.sh | 3 +- 16 files changed, 10 insertions(+), 330 deletions(-) delete mode 100644 Pathfinder_1_12/pom.xml delete mode 100644 Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/entity/CraftInsentient.kt delete mode 100644 Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftNavigation.kt delete mode 100644 Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderGoalWrapper.kt delete mode 100644 Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderManager.kt delete mode 100644 Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderPlayer.kt diff --git a/PathfinderAPI/pom.xml b/PathfinderAPI/pom.xml index 2fcadcd..50a2747 100644 --- a/PathfinderAPI/pom.xml +++ b/PathfinderAPI/pom.xml @@ -88,7 +88,7 @@ PathfindergoalAPI com.github.ysl3000.pathfindergoalapi - 1.152.0-SNAPSHOT + 1.152.1-SNAPSHOT diff --git a/PathfinderPlugin/pom.xml b/PathfinderPlugin/pom.xml index d72479a..da8bf8b 100644 --- a/PathfinderPlugin/pom.xml +++ b/PathfinderPlugin/pom.xml @@ -82,13 +82,6 @@ ${project.parent.version} - - Pathfinder_1_12 - com.github.ysl3000.pathfindergoalapi - compile - ${project.parent.version} - - Pathfinder_1_13_2 com.github.ysl3000.pathfindergoalapi @@ -128,6 +121,6 @@ PathfindergoalAPI com.github.ysl3000.pathfindergoalapi - 1.152.0-SNAPSHOT + 1.152.1-SNAPSHOT diff --git a/PathfinderPlugin/src/main/java/com/github/ysl3000/bukkit/pathfinding/PathfinderGoalPlugin.kt b/PathfinderPlugin/src/main/java/com/github/ysl3000/bukkit/pathfinding/PathfinderGoalPlugin.kt index 906dd02..3e2fc33 100644 --- a/PathfinderPlugin/src/main/java/com/github/ysl3000/bukkit/pathfinding/PathfinderGoalPlugin.kt +++ b/PathfinderPlugin/src/main/java/com/github/ysl3000/bukkit/pathfinding/PathfinderGoalPlugin.kt @@ -21,7 +21,6 @@ class PathfinderGoalPlugin : JavaPlugin() { when (version) { - "v1_12_R1" -> this.craftPathfinderManager = com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.pathfinding.CraftPathfinderManager() "v1_13_R2" -> this.craftPathfinderManager = com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_13_R2.pathfinding.CraftPathfinderManager() "v1_14_R1" -> this.craftPathfinderManager = com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_14_R1.pathfinding.CraftPathfinderManager() "v1_15_R1" -> this.craftPathfinderManager = com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_15_R1.pathfinding.CraftPathfinderManager() diff --git a/PathfinderTestPlugin/pom.xml b/PathfinderTestPlugin/pom.xml index 8a6bcae..89028e8 100644 --- a/PathfinderTestPlugin/pom.xml +++ b/PathfinderTestPlugin/pom.xml @@ -52,6 +52,6 @@ PathfindergoalAPI com.github.ysl3000.pathfindergoalapi - 1.152.0-SNAPSHOT + 1.152.1-SNAPSHOT diff --git a/PathfinderTestPluginJava/pom.xml b/PathfinderTestPluginJava/pom.xml index cf8beb2..9954cdb 100644 --- a/PathfinderTestPluginJava/pom.xml +++ b/PathfinderTestPluginJava/pom.xml @@ -21,7 +21,7 @@ PathfindergoalAPI com.github.ysl3000.pathfindergoalapi - 1.152.0-SNAPSHOT + 1.152.1-SNAPSHOT diff --git a/Pathfinder_1_12/pom.xml b/Pathfinder_1_12/pom.xml deleted file mode 100644 index f348042..0000000 --- a/Pathfinder_1_12/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - Pathfinder_1_12 - - - - - kotlin-maven-plugin - - 1.8 - - - - - compile - - compile - compile - - - - test-compile - - test-compile - test-compile - - - org.jetbrains.kotlin - ${kotlin.version} - - - - - - - - spigot - org.spigotmc - provided - 1.12.2-R0.1-SNAPSHOT - - - - PathfinderAPI - com.github.ysl3000.pathfindergoalapi - provided - ${project.parent.version} - - - 4.0.0 - - - PathfindergoalAPI - com.github.ysl3000.pathfindergoalapi - 1.152.0-SNAPSHOT - - - \ No newline at end of file diff --git a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/entity/CraftInsentient.kt b/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/entity/CraftInsentient.kt deleted file mode 100644 index 58c9ef5..0000000 --- a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/entity/CraftInsentient.kt +++ /dev/null @@ -1,162 +0,0 @@ -package com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.entity - -import com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.pathfinding.CraftNavigation -import com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.pathfinding.CraftPathfinderGoalWrapper -import com.github.ysl3000.bukkit.pathfinding.entity.Insentient -import net.minecraft.server.v1_12_R1.EntityInsentient -import net.minecraft.server.v1_12_R1.PathfinderGoal -import net.minecraft.server.v1_12_R1.PathfinderGoalSelector -import org.bukkit.Location -import org.bukkit.craftbukkit.v1_12_R1.entity.* -import org.bukkit.entity.* -import org.bukkit.util.Vector -import java.lang.reflect.InvocationTargetException -import java.lang.reflect.Method - -/** - * Created by ysl3000 - */ -class CraftInsentient private constructor(private val handle: EntityInsentient) : Insentient { - - override fun getNavigation(): com.github.ysl3000.bukkit.pathfinding.pathfinding.Navigation = CraftNavigation(handle.navigation) - - override fun getLookingAt(): Location = Location(handle.bukkitEntity.world, handle.controllerLook.e(), handle.controllerLook.f(), - handle.controllerLook.g()) - - override fun getHeadHeight(): Float = handle.headHeight - - override fun getBukkitEntity(): Entity = handle.bukkitEntity - - constructor(flying: Flying) : this((flying as CraftFlying).handle) - - constructor(enderDragon: EnderDragon) : this((enderDragon as CraftEnderDragon).handle) - - constructor(creature: Creature) : this((creature as CraftCreature).handle) - - constructor(ambient: Ambient) : this((ambient as CraftAmbient).handle) - - constructor(slime: Slime) : this((slime as CraftSlime).handle) - - private val nmsGoals: MutableMap = HashMap() - private val nmsTargetGoals: MutableMap = HashMap() - - override fun addPathfinderGoal(priority: Int, - pathfinderGoal: com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderGoal) { - val goalWrapper = CraftPathfinderGoalWrapper(pathfinderGoal) - this.nmsGoals[pathfinderGoal] = goalWrapper - handle.goalSelector.a(priority, goalWrapper) - } - - override fun removePathfinderGoal( - pathfinderGoal: com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderGoal) { - if (nmsGoals.containsKey(pathfinderGoal)) { - val nmsGoal = nmsGoals.remove(pathfinderGoal) - handle.goalSelector.a(nmsGoal) - } - } - - override fun hasPathfinderGoal( - pathfinderGoal: com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderGoal): Boolean { - return nmsGoals.containsKey(pathfinderGoal) - } - - override fun clearPathfinderGoals() { - handle.goalSelector = PathfinderGoalSelector(handle.getWorld().methodProfiler) - nmsGoals.clear() - } - - - override fun addTargetPathfinderGoal(priority: Int, - pathfinderGoal: com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderGoal) { - val goalWrapper = CraftPathfinderGoalWrapper(pathfinderGoal) - this.nmsTargetGoals[pathfinderGoal] = goalWrapper - handle.targetSelector.a(priority, goalWrapper) - } - - override fun removeTargetPathfinderGoal( - pathfinderGoal: com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderGoal) { - if (nmsTargetGoals.containsKey(pathfinderGoal)) { - val nmsGoal = nmsTargetGoals.remove(pathfinderGoal) - handle.goalSelector.a(nmsGoal) - } - } - - override fun hasTargetPathfinderGoal( - pathfinderGoal: com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderGoal): Boolean { - return nmsTargetGoals.containsKey(pathfinderGoal) - } - - override fun clearTargetPathfinderGoals() { - handle.targetSelector = PathfinderGoalSelector(handle.getWorld().methodProfiler) - nmsTargetGoals.clear() - } - - override fun jump() { - handle.controllerJump.a() - } - - - override fun lookAt(location: Location) { - handle.controllerLook - .a(location.x, location.y, location.z, location.yaw, - location.pitch) - } - - override fun lookAt(entity: Entity) { - lookAt(entity.location) - } - - override fun setMovementDirection(direction: Vector, speed: Double) { - handle.controllerMove.a(direction.x, direction.blockY.toDouble(), direction.z, speed) - } - - override fun setStrafeDirection(forward: Float, sideward: Float) { - handle.controllerMove.a(forward, sideward) - } - - override fun resetGoalsToDefault() { - if (reset == null) { - return - } - try { - reset!!.invoke(handle) - } catch (e: IllegalAccessException) { - e.printStackTrace() - } catch (e: InvocationTargetException) { - e.printStackTrace() - } - - } - - override fun hasPositionChanged(): Boolean { - return handle.positionChanged - } - - override fun onEntityKill(livingEntity: LivingEntity) { - handle.b((livingEntity as CraftLivingEntity).handle) - } - - override fun setRotation(yaw: Float, pitch: Float) { - this.handle.yaw = yaw - this.handle.pitch = pitch - } - - override fun updateRenderAngles() { - handle.controllerMove.a() - } - - - companion object { - private var reset: Method? = null - - init { - - try { - reset = EntityInsentient::class.java.getDeclaredMethod("r") - reset!!.isAccessible = true - } catch (e: NoSuchMethodException) { - e.printStackTrace() - } - } - } -} \ No newline at end of file diff --git a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftNavigation.kt b/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftNavigation.kt deleted file mode 100644 index 0c252dd..0000000 --- a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftNavigation.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.pathfinding - -import com.github.ysl3000.bukkit.pathfinding.AbstractNavigation -import net.minecraft.server.v1_12_R1.NavigationAbstract -import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity - -class CraftNavigation(private val navigationAbstract: NavigationAbstract) : - AbstractNavigation( - doneNavigating = { navigationAbstract.o() }, - pathSearchRange = { navigationAbstract.i() }, - moveToPositionU = { x, y, z -> navigationAbstract.a(x, y, z) }, - moveToPositionB = { x, y, z, speed -> navigationAbstract.a(x, y, z, speed) }, - moveToEntityU = { entity -> navigationAbstract.a((entity as CraftEntity).handle) }, - moveToentityB = { entity, speed -> navigationAbstract.a((entity as CraftEntity).handle, speed) }, - speedU = { speed -> navigationAbstract.a(speed) }, - clearPathEntityU = { navigationAbstract.p() } - ) \ No newline at end of file diff --git a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderGoalWrapper.kt b/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderGoalWrapper.kt deleted file mode 100644 index f70b659..0000000 --- a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderGoalWrapper.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.pathfinding - - -import net.minecraft.server.v1_12_R1.PathfinderGoal - - -/** - * Created by Yannick on 30.11.2016. - */ -class CraftPathfinderGoalWrapper(private val pathfinderGoal: com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderGoal) : PathfinderGoal() { - - override fun a() = pathfinderGoal.shouldExecute() - - override fun b() = pathfinderGoal.shouldTerminate() - - override fun c() = pathfinderGoal.init() - - override fun d() = pathfinderGoal.reset() - - override fun e() = pathfinderGoal.execute() -} - - - - - diff --git a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderManager.kt b/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderManager.kt deleted file mode 100644 index c7b8d53..0000000 --- a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderManager.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.pathfinding - -import com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.entity.CraftInsentient -import com.github.ysl3000.bukkit.pathfinding.entity.Insentient -import com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderManager -import com.github.ysl3000.bukkit.pathfinding.pathfinding.PathfinderPlayer -import org.bukkit.entity.* - -class CraftPathfinderManager : PathfinderManager { - override fun getPathfinderGoalEntity(creature: Creature): Insentient = CraftInsentient(creature) - - override fun getPathfinderGoalEntity(flying: Flying): Insentient = CraftInsentient(flying) - - override fun getPathfinderGoalEntity(ambient: Ambient): Insentient = CraftInsentient(ambient) - - override fun getPathfinderGoalEntity(slime: Slime): Insentient = CraftInsentient(slime) - - override fun getPathfinderGoalEntity(enderDragon: EnderDragon): Insentient = CraftInsentient(enderDragon) - - override fun getPathfinderPlayer(player: Player): PathfinderPlayer = CraftPathfinderPlayer(player) -} diff --git a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderPlayer.kt b/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderPlayer.kt deleted file mode 100644 index 80eab5c..0000000 --- a/Pathfinder_1_12/src/main/java/com/github/ysl3000/bukkit/pathfinding/craftbukkit/v1_12_R1/pathfinding/CraftPathfinderPlayer.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.github.ysl3000.bukkit.pathfinding.craftbukkit.v1_12_R1.pathfinding - -import com.github.ysl3000.bukkit.pathfinding.AbstractPathfinderPlayer -import net.minecraft.server.v1_12_R1.EntityPlayer -import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer -import org.bukkit.entity.Player - -/** - * Created by ysl3000 - */ -class CraftPathfinderPlayer private constructor(private val entityPlayer: EntityPlayer) : AbstractPathfinderPlayer( - player = { entityPlayer.bukkitEntity }, - relativeMotionX = { entityPlayer.motX }, - relativeMotionY = { entityPlayer.motY }, - relativeMotionZ = { entityPlayer.motZ }, - relativeMotionYaw = { entityPlayer.pitch }, - relativeMotionPitch = { entityPlayer.yaw }, - relativeMotionForward = { entityPlayer.bg }, - relativeMotionSideward = { entityPlayer.be }, - jump = { entityPlayer.motY > STILL } -) { - - companion object { - private const val STILL = -0.0784000015258789 - } - - constructor(player: Player) : this((player as CraftPlayer).handle) -} diff --git a/Pathfinder_1_13_2/pom.xml b/Pathfinder_1_13_2/pom.xml index e953ef3..4f30f02 100644 --- a/Pathfinder_1_13_2/pom.xml +++ b/Pathfinder_1_13_2/pom.xml @@ -50,6 +50,6 @@ PathfindergoalAPI com.github.ysl3000.pathfindergoalapi - 1.152.0-SNAPSHOT + 1.152.1-SNAPSHOT diff --git a/Pathfinder_1_14/pom.xml b/Pathfinder_1_14/pom.xml index 6b84804..2a2217e 100644 --- a/Pathfinder_1_14/pom.xml +++ b/Pathfinder_1_14/pom.xml @@ -51,7 +51,7 @@ PathfindergoalAPI com.github.ysl3000.pathfindergoalapi - 1.152.0-SNAPSHOT + 1.152.1-SNAPSHOT diff --git a/Pathfinder_1_15/pom.xml b/Pathfinder_1_15/pom.xml index 6dda5dc..62dd782 100644 --- a/Pathfinder_1_15/pom.xml +++ b/Pathfinder_1_15/pom.xml @@ -3,7 +3,7 @@ PathfindergoalAPI com.github.ysl3000.pathfindergoalapi - 1.152.0-SNAPSHOT + 1.152.1-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 67f474f..0383d54 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ 0.10.0 - 1.152.0-SNAPSHOT + 1.152.1-SNAPSHOT @@ -41,7 +41,6 @@ Impl PathfinderPlugin - Pathfinder_1_12 Pathfinder_1_13_2 Pathfinder_1_14 Pathfinder_1_15 diff --git a/update-version.sh b/update-version.sh index 35325b8..ebf255f 100755 --- a/update-version.sh +++ b/update-version.sh @@ -6,4 +6,5 @@ then exit 1 fi -mvn release:update-versions -DdevelopmentVersion="$1" -P Impl -DautoVersionSubmodules=true \ No newline at end of file +mvn versions:set -DnewVersion="$1" +mvn versions:commit \ No newline at end of file