From 9a125eecb82af9c5bc92f19cd783b7683b73db8a Mon Sep 17 00:00:00 2001 From: thamid-gamer <60953955+thamid-gamer@users.noreply.github.com> Date: Fri, 6 Aug 2021 13:05:53 -0400 Subject: [PATCH] Fix Incorrectly Typed Goals (#6200) --- patches/api/0203-Add-Mob-Goal-API.patch | 10 +++++----- patches/server/0431-Implement-Mob-Goal-API.patch | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/patches/api/0203-Add-Mob-Goal-API.patch b/patches/api/0203-Add-Mob-Goal-API.patch index a0596f8add..7e587739b5 100644 --- a/patches/api/0203-Add-Mob-Goal-API.patch +++ b/patches/api/0203-Add-Mob-Goal-API.patch @@ -227,7 +227,7 @@ index 0000000000000000000000000000000000000000..e21f7574763dd4f13794f91bbef192ef +} diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java new file mode 100644 -index 0000000000000000000000000000000000000000..659193fc0596084031c09aa47fbb428a93d052e8 +index 0000000000000000000000000000000000000000..fb0c77c66ca117eaff9487a41f1e280afe6253c6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java @@ -0,0 +1,288 @@ @@ -375,7 +375,7 @@ index 0000000000000000000000000000000000000000..659193fc0596084031c09aa47fbb428a + GoalKey TRADER_LLAMA_DEFEND_WANDERING_TRADER = GoalKey.of(Llama.class, NamespacedKey.minecraft("trader_llama_defend_wandering_trader")); + GoalKey WITHER_DO_NOTHING = GoalKey.of(Wither.class, NamespacedKey.minecraft("wither_do_nothing")); + GoalKey RAIDER_OPEN_DOOR = GoalKey.of(Illager.class, NamespacedKey.minecraft("raider_open_door")); -+ GoalKey SKELETON_MELEE = GoalKey.of(Skeleton.class, NamespacedKey.minecraft("skeleton_melee")); ++ GoalKey SKELETON_MELEE = GoalKey.of(AbstractSkeleton.class, NamespacedKey.minecraft("abstract_skeleton_melee")); + GoalKey BLAZE_ATTACK = GoalKey.of(Blaze.class, NamespacedKey.minecraft("blaze_attack")); + GoalKey DROWNED_ATTACK = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack")); + GoalKey DROWNED_GO_TO_BEACH = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_go_to_beach")); @@ -396,7 +396,7 @@ index 0000000000000000000000000000000000000000..659193fc0596084031c09aa47fbb428a + GoalKey GUARDIAN_ATTACK = GoalKey.of(Guardian.class, NamespacedKey.minecraft("guardian_attack")); + GoalKey ILLUSIONER_BLINDNESS_SPELL = GoalKey.of(Illusioner.class, NamespacedKey.minecraft("illusioner_blindness_spell")); + GoalKey ILLUSIONER_MIRROR_SPELL = GoalKey.of(Illusioner.class, NamespacedKey.minecraft("illusioner_mirror_spell")); -+ GoalKey LONG_DISTANCE_PATROL = GoalKey.of(Monster.class, NamespacedKey.minecraft("long_distance_patrol")); ++ GoalKey LONG_DISTANCE_PATROL = GoalKey.of(Raider.class, NamespacedKey.minecraft("long_distance_patrol")); + GoalKey PHANTOM_ATTACK_PLAYER = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_attack_player")); + GoalKey PHANTOM_ATTACK_STRATEGY = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_attack_strategy")); + GoalKey PHANTOM_CIRCLE_AROUND_ANCHOR = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_circle_around_anchor")); @@ -520,7 +520,7 @@ index 0000000000000000000000000000000000000000..659193fc0596084031c09aa47fbb428a + @Deprecated GoalKey UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset")); +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 96039e4f17dd2860bf78ccfca4656da1129ef5af..eef5770b5167844bf07c65a4e870db576161cf13 100644 +index 152ba4281d730643957ead601a91beefce7893da..f9f9a3f0689e6494bd56f288319930018052c38b 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -1946,6 +1946,16 @@ public final class Bukkit { @@ -541,7 +541,7 @@ index 96039e4f17dd2860bf78ccfca4656da1129ef5af..eef5770b5167844bf07c65a4e870db57 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 6ee70b7be4cf04d74f8941c321e08105d86d4edf..7284a2898ff5f6160787278396e16223eff41831 100644 +index b45551e606369f69a3777d15c35ffa5af3dfdf67..e0b79d23f4c16505cf54afb822b2f6c370560931 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -1709,5 +1709,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi diff --git a/patches/server/0431-Implement-Mob-Goal-API.patch b/patches/server/0431-Implement-Mob-Goal-API.patch index 20d218a790..1c47fe0923 100644 --- a/patches/server/0431-Implement-Mob-Goal-API.patch +++ b/patches/server/0431-Implement-Mob-Goal-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/build.gradle.kts b/build.gradle.kts -index 702ccd405ebe5d3b1f2525a475c81caadc04a0f0..59f034c2bc0db9e918e6ecc422021ea82bae9f29 100644 +index 8d08c4f2bedddc737dbefb89fa2f99fba2b66e4a..b898690863be9753910bb4af3be13c2e73db7b00 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,6 +48,7 @@ dependencies { @@ -18,7 +18,7 @@ index 702ccd405ebe5d3b1f2525a475c81caadc04a0f0..59f034c2bc0db9e918e6ecc422021ea8 } diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java new file mode 100644 -index 0000000000000000000000000000000000000000..dfc026d183adab1dde5942f36e7a281b3a2fc699 +index 0000000000000000000000000000000000000000..79006251a707dd94099db26fbb503f8699b7a8b5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java @@ -0,0 +1,467 @@ @@ -50,7 +50,6 @@ index 0000000000000000000000000000000000000000..dfc026d183adab1dde5942f36e7a281b +import net.minecraft.world.entity.animal.horse.AbstractChestedHorse; +import net.minecraft.world.entity.boss.wither.WitherBoss; +import net.minecraft.world.entity.monster.AbstractIllager; -+import net.minecraft.world.entity.monster.AbstractSkeleton; +import net.minecraft.world.entity.monster.EnderMan; +import net.minecraft.world.entity.monster.PatrollingMonster; +import net.minecraft.world.entity.monster.RangedAttackMob; @@ -59,6 +58,7 @@ index 0000000000000000000000000000000000000000..dfc026d183adab1dde5942f36e7a281b +import net.minecraft.world.entity.monster.piglin.AbstractPiglin; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.AbstractHorse; ++import org.bukkit.entity.AbstractSkeleton; +import org.bukkit.entity.AbstractVillager; +import org.bukkit.entity.Ageable; +import org.bukkit.entity.Ambient; @@ -238,7 +238,7 @@ index 0000000000000000000000000000000000000000..dfc026d183adab1dde5942f36e7a281b + deobfuscationMap.put("shulker_d", "shulker_nearest"); + deobfuscationMap.put("shulker_e", "shulker_peek"); + deobfuscationMap.put("squid_a", "squid_flee"); -+ deobfuscationMap.put("abstract_skeleton_1", "skeleton_melee"); ++ deobfuscationMap.put("abstract_skeleton_1", "abstract_skeleton_melee"); + deobfuscationMap.put("strider_a", "strider_go_to_lava"); + deobfuscationMap.put("turtle_a", "turtle_breed"); + deobfuscationMap.put("turtle_b", "turtle_go_home"); @@ -309,7 +309,7 @@ index 0000000000000000000000000000000000000000..dfc026d183adab1dde5942f36e7a281b + bukkitMap.put(net.minecraft.world.entity.animal.horse.TraderLlama.class, TraderLlama.class); + bukkitMap.put(net.minecraft.world.entity.monster.MagmaCube.class, MagmaCube.class); + bukkitMap.put(net.minecraft.world.entity.monster.Monster.class, Monster.class); -+ bukkitMap.put(PatrollingMonster.class, Monster.class); // close enough ++ bukkitMap.put(PatrollingMonster.class, Raider.class); // close enough + bukkitMap.put(net.minecraft.world.entity.animal.MushroomCow.class, MushroomCow.class); + bukkitMap.put(net.minecraft.world.entity.animal.Ocelot.class, Ocelot.class); + bukkitMap.put(net.minecraft.world.entity.animal.Panda.class, Panda.class); @@ -329,7 +329,7 @@ index 0000000000000000000000000000000000000000..dfc026d183adab1dde5942f36e7a281b + bukkitMap.put(net.minecraft.world.entity.monster.Shulker.class, Shulker.class); + bukkitMap.put(net.minecraft.world.entity.monster.Silverfish.class, Silverfish.class); + bukkitMap.put(net.minecraft.world.entity.monster.Skeleton.class, Skeleton.class); -+ bukkitMap.put(AbstractSkeleton.class, Skeleton.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.AbstractSkeleton.class, AbstractSkeleton.class); + bukkitMap.put(net.minecraft.world.entity.monster.Stray.class, Stray.class); + bukkitMap.put(net.minecraft.world.entity.monster.WitherSkeleton.class, WitherSkeleton.class); + bukkitMap.put(net.minecraft.world.entity.monster.Slime.class, Slime.class); @@ -895,7 +895,7 @@ index 8c2ec30a35e86f2b30863045b586a67e485c624b..9cb5ccf4815b56169b63b34da88e7394 LOOK, JUMP, diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 1a1d4f6deadd2faf811ad16d5548c94786ecc84d..464cf287cf2bad787207f29946c97c9709a699e9 100644 +index 238901696feb8de28c8d543535b578decd146334..644373b23cf228505dd23ba07bd9cacbdc365c6c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2473,5 +2473,11 @@ public final class CraftServer implements Server {