From 9c126fd2a976c1557d418f4ccce532f8ad62042b Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Sat, 23 Sep 2023 13:38:46 +0200 Subject: [PATCH] fix test --- patches/api/0195-Add-Mob-Goal-API.patch | 20 ++++++++++++++----- patches/api/0299-Missing-Entity-API.patch | 2 +- .../api/0344-More-PotionEffectType-API.patch | 11 +++++++++- ...-Add-methods-to-get-translation-keys.patch | 4 ++-- ...d-missing-default-perms-for-commands.patch | 5 +++-- 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/patches/api/0195-Add-Mob-Goal-API.patch b/patches/api/0195-Add-Mob-Goal-API.patch index afa67df309..4e3009f8e5 100644 --- a/patches/api/0195-Add-Mob-Goal-API.patch +++ b/patches/api/0195-Add-Mob-Goal-API.patch @@ -227,10 +227,10 @@ 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..c9837c7c47314b5bdf6c7973e6bc962d390dc13d +index 0000000000000000000000000000000000000000..39fca3674f32c7bbb2797bf6c3e222707cd7495a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java -@@ -0,0 +1,293 @@ +@@ -0,0 +1,303 @@ +package com.destroystokyo.paper.entity.ai; + +import com.destroystokyo.paper.entity.RangedEntity; @@ -357,7 +357,6 @@ index 0000000000000000000000000000000000000000..c9837c7c47314b5bdf6c7973e6bc962d + GoalKey POLAR_BEAR_MELEE_ATTACK = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polar_bear_melee_attack")); + GoalKey POLAR_BEAR_PANIC = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polar_bear_panic")); + GoalKey PUFFERFISH_PUFF = GoalKey.of(PufferFish.class, NamespacedKey.minecraft("pufferfish_puff")); -+ GoalKey EVIL_RABBIT_ATTACK = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("evil_rabbit_attack")); + GoalKey RABBIT_AVOID_ENTITY = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("rabbit_avoid_entity")); + GoalKey RABBIT_PANIC = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("rabbit_panic")); + GoalKey RAID_GARDEN = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("raid_garden")); @@ -403,7 +402,6 @@ index 0000000000000000000000000000000000000000..c9837c7c47314b5bdf6c7973e6bc962d + 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")); + GoalKey PHANTOM_SWEEP_ATTACK = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_sweep_attack")); -+ GoalKey RAVAGER_MELEE_ATTACK = GoalKey.of(Ravager.class, NamespacedKey.minecraft("ravager_melee_attack")); + GoalKey SHULKER_ATTACK = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_attack")); + GoalKey SHULKER_DEFENSE_ATTACK = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_defense_attack")); + GoalKey SHULKER_NEAREST_ATTACK = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_nearest_attack")); @@ -423,7 +421,6 @@ index 0000000000000000000000000000000000000000..c9837c7c47314b5bdf6c7973e6bc962d + GoalKey VEX_RANDOM_MOVE = GoalKey.of(Vex.class, NamespacedKey.minecraft("vex_random_move")); + GoalKey VINDICATOR_BREAK_DOOR = GoalKey.of(Mob.class, NamespacedKey.minecraft("vindicator_break_door")); + GoalKey VINDICATOR_JOHNNY_ATTACK = GoalKey.of(Vindicator.class, NamespacedKey.minecraft("vindicator_johnny_attack")); -+ GoalKey VINDICATOR_MELEE_ATTACK = GoalKey.of(Vindicator.class, NamespacedKey.minecraft("vindicator_melee_attack")); + GoalKey ZOMBIE_ATTACK_TURTLE_EGG = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_turtle_egg")); + GoalKey WANDER_TO_POSITION = GoalKey.of(WanderingTrader.class, NamespacedKey.minecraft("wander_to_position")); + GoalKey HOLD_GROUND_ATTACK = GoalKey.of(Raider.class, NamespacedKey.minecraft("hold_ground_attack")); @@ -435,6 +432,19 @@ index 0000000000000000000000000000000000000000..c9837c7c47314b5bdf6c7973e6bc962d + GoalKey WOLF_PANIC = GoalKey.of(Wolf.class, NamespacedKey.minecraft("wolf_panic")); + + /** ++ * @deprecated removed in 1.20.2 ++ */ ++ @Deprecated GoalKey VINDICATOR_MELEE_ATTACK = GoalKey.of(Vindicator.class, NamespacedKey.minecraft("vindicator_melee_attack")); ++ /** ++ * @deprecated removed in 1.20.2 ++ */ ++ @Deprecated GoalKey RAVAGER_MELEE_ATTACK = GoalKey.of(Ravager.class, NamespacedKey.minecraft("ravager_melee_attack")); ++ /** ++ * @deprecated removed in 1.20.2 ++ */ ++ @Deprecated GoalKey EVIL_RABBIT_ATTACK = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("evil_rabbit_attack")); ++ ++ /** + * @deprecated removed in 1.16 + */ + @Deprecated(forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.21") GoalKey ANGER = GoalKey.of(PigZombie.class, NamespacedKey.minecraft("anger")); diff --git a/patches/api/0299-Missing-Entity-API.patch b/patches/api/0299-Missing-Entity-API.patch index 94533104e9..7393c75b6a 100644 --- a/patches/api/0299-Missing-Entity-API.patch +++ b/patches/api/0299-Missing-Entity-API.patch @@ -11,7 +11,7 @@ Co-authored-by: booky10 Co-authored-by: Amin diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java -index c9837c7c47314b5bdf6c7973e6bc962d390dc13d..b7a2cecb334ce39fa09d8ab949a29eedbdc44c36 100644 +index 39fca3674f32c7bbb2797bf6c3e222707cd7495a..0c4dbb9ef63fa8575b5546239443cb2bd91ba847 100644 --- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java +++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java @@ -24,7 +24,7 @@ public interface VanillaGoal extends Goal { diff --git a/patches/api/0344-More-PotionEffectType-API.patch b/patches/api/0344-More-PotionEffectType-API.patch index fed80e1cab..0791f582c4 100644 --- a/patches/api/0344-More-PotionEffectType-API.patch +++ b/patches/api/0344-More-PotionEffectType-API.patch @@ -111,9 +111,18 @@ index 5f3aa6fd18d57055a6d8494938dff149d51b2803..84fd181ad897f620e450750246d9ea41 + // Paper end } diff --git a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java -index 6994981bdeccc4b059ae0075d0c8a26b6471d7b3..eb27b9d2d888dcd1b9e21d748d6cc990e879a4bd 100644 +index 6994981bdeccc4b059ae0075d0c8a26b6471d7b3..928f36a4def378dccb6a52196ad60e7b5ff17694 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java +++ b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java +@@ -27,7 +27,7 @@ public class PotionEffectTypeWrapper extends PotionEffectType { + */ + @NotNull + public PotionEffectType getType() { +- return PotionEffectType.getByKey(getKey()); ++ return PotionEffectType.getByKey(super.getKey()); // Paper + } + + @Override @@ -40,4 +40,30 @@ public class PotionEffectTypeWrapper extends PotionEffectType { public Color getColor() { return getType().getColor(); diff --git a/patches/server/0457-Add-methods-to-get-translation-keys.patch b/patches/server/0457-Add-methods-to-get-translation-keys.patch index ce1256ed3e..e77e4cf157 100644 --- a/patches/server/0457-Add-methods-to-get-translation-keys.patch +++ b/patches/server/0457-Add-methods-to-get-translation-keys.patch @@ -41,7 +41,7 @@ index e8334e2264510f5101e80b4f130e7ae1442560d7..57decf4156f176ebcc988478c17856cb public net.minecraft.world.item.enchantment.Enchantment getHandle() { diff --git a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java b/src/test/java/io/papermc/paper/world/TranslationKeyTest.java -index fab3063fffa959ac7f0eb5937f2fae94d11b6591..ffc9776a8927d6255820d1384c9e66f99a7b692c 100644 +index fab3063fffa959ac7f0eb5937f2fae94d11b6591..59ebc5aaa60aaca843e6775a17cdf04f5b3aefaa 100644 --- a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java +++ b/src/test/java/io/papermc/paper/world/TranslationKeyTest.java @@ -1,12 +1,27 @@ @@ -95,7 +95,7 @@ index fab3063fffa959ac7f0eb5937f2fae94d11b6591..ffc9776a8927d6255820d1384c9e66f9 + @Test + public void testAttributeKeys() { + for (Attribute attribute : Attribute.values()) { -+ Assert.assertEquals("translation key mismatch for " + attribute, org.bukkit.craftbukkit.attribute.CraftAttributeMap.toMinecraft(attribute).getDescriptionId(), attribute.translationKey()); ++ Assert.assertEquals("translation key mismatch for " + attribute, org.bukkit.craftbukkit.attribute.CraftAttribute.bukkitToMinecraft(attribute).getDescriptionId(), attribute.translationKey()); + } + } + diff --git a/patches/server/0496-Added-missing-default-perms-for-commands.patch b/patches/server/0496-Added-missing-default-perms-for-commands.patch index 67605306e5..baa35b70b9 100644 --- a/patches/server/0496-Added-missing-default-perms-for-commands.patch +++ b/patches/server/0496-Added-missing-default-perms-for-commands.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Added missing default perms for commands diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java -index ca30f9c590f792caa8f1b76d7219e9121d932673..2959f713ce75a1df9c6c7cf5e021690cfcb6e1e7 100644 +index ca30f9c590f792caa8f1b76d7219e9121d932673..74ffea16027ba8eaa26716c3b6b78a8e83c9ed79 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java +++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java -@@ -24,13 +24,72 @@ public final class CommandPermissions { +@@ -24,13 +24,73 @@ public final class CommandPermissions { DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "stop", "Allows the user to stop the server", PermissionDefault.OP, commands); DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "list", "Allows the user to list all online players", PermissionDefault.OP, commands); DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "gamemode", "Allows the user to change the gamemode of another player", PermissionDefault.OP, commands); @@ -79,6 +79,7 @@ index ca30f9c590f792caa8f1b76d7219e9121d932673..2959f713ce75a1df9c6c7cf5e021690c + DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "worldborder", "Allows the user to manage the world border", PermissionDefault.OP, commands); + DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "place", "Allows the user to place features and structures", PermissionDefault.OP, commands); + DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "return", "Allows the user to use the /return command", PermissionDefault.OP, commands); ++ DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "random", "Allows the user to generate a random number", PermissionDefault.OP, commands); + // Paper end DefaultPermissions.registerPermission("minecraft.admin.command_feedback", "Receive command broadcasts when sendCommandFeedback is true", PermissionDefault.OP, commands);