diff --git a/patches/generated-api/0004-Rabid-Wolf-API.patch b/patches/generated-api/0004-Rabid-Wolf-API.patch deleted file mode 100644 index 5096e181a..000000000 --- a/patches/generated-api/0004-Rabid-Wolf-API.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Encode42 -Date: Tue, 8 Dec 2020 17:15:15 -0500 -Subject: [PATCH] Rabid Wolf API - - -diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java -index 9ef2111b60ace1a088c8c3d4707b26c06f14037c..6eea8fbe575c4570c2b760c9828f8ec5b81c7202 100644 ---- a/com/destroystokyo/paper/entity/ai/VanillaGoal.java -+++ b/com/destroystokyo/paper/entity/ai/VanillaGoal.java -@@ -449,6 +449,7 @@ public interface VanillaGoal extends Goal { - GoalKey ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal")); - GoalKey DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager")); - GoalKey ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager")); -+ GoalKey AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf")); - // Purpur end - - private static GoalKey create(final String key, final Class type) { diff --git a/purpur-api-generator/paper-patches/files/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch b/purpur-api-generator/paper-patches/files/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch index ccf69389a..7cc7c3964 100644 --- a/purpur-api-generator/paper-patches/files/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch +++ b/purpur-api-generator/paper-patches/files/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch @@ -1,6 +1,6 @@ --- a/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java +++ b/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java -@@ -441,6 +_,20 @@ +@@ -441,6 +_,23 @@ GoalKey ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class); @@ -17,6 +17,9 @@ + GoalKey DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager")); + GoalKey ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager")); + // Purpur end - Add option to disable zombie aggressiveness towards villagers when lagging ++ // Purpur start - Configurable chance for wolves to spawn rabid ++ GoalKey AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf")); ++ // Purpur end - Configurable chance for wolves to spawn rabid + private static GoalKey create(final String key, final Class type) { return GoalKey.of(type, NamespacedKey.minecraft(key)); diff --git a/patches/api/0019-Rabid-Wolf-API.patch b/purpur-api/paper-patches/files/src/main/java/org/bukkit/entity/Wolf.java.patch similarity index 53% rename from patches/api/0019-Rabid-Wolf-API.patch rename to purpur-api/paper-patches/files/src/main/java/org/bukkit/entity/Wolf.java.patch index cbf725884..b41648d8d 100644 --- a/patches/api/0019-Rabid-Wolf-API.patch +++ b/purpur-api/paper-patches/files/src/main/java/org/bukkit/entity/Wolf.java.patch @@ -1,14 +1,6 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Encode42 -Date: Tue, 8 Dec 2020 17:15:15 -0500 -Subject: [PATCH] Rabid Wolf API - - -diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java -index c73489f4b745bc84501ce94f0227b034d9768eae..a97129e71f16ec691759add664bdfd35ab90aaed 100644 --- a/src/main/java/org/bukkit/entity/Wolf.java +++ b/src/main/java/org/bukkit/entity/Wolf.java -@@ -108,4 +108,20 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar +@@ -108,4 +_,20 @@ return Registry.WOLF_VARIANT.getOrThrow(NamespacedKey.minecraft(key)); } } diff --git a/purpur-server/minecraft-patches/features/0001-Ridables.patch b/purpur-server/minecraft-patches/features/0001-Ridables.patch index 7ce392549..129a3ed70 100644 --- a/purpur-server/minecraft-patches/features/0001-Ridables.patch +++ b/purpur-server/minecraft-patches/features/0001-Ridables.patch @@ -1929,12 +1929,12 @@ index 354ec2b987882d8f40ef4ac5257183d2fda73bb8..98cb91574c8d2bdb6d180256f657ecc6 this.turtle.setDeltaMovement(this.turtle.getDeltaMovement().add(0.0, this.turtle.getSpeed() * d1 * 0.1, 0.0)); } diff --git a/net/minecraft/world/entity/animal/Wolf.java b/net/minecraft/world/entity/animal/Wolf.java -index 362b2d049080ffa1b0763146c31fc2ce6d337e51..32efe3af5f4f046f2935686eeba8cf0a40f23bfc 100644 +index 6eea7ecd42c39645b5a37b58ee1ccb830160c6d5..dacaed7a05d8e7105dd945b7708de6f90e7fc83e 100644 --- a/net/minecraft/world/entity/animal/Wolf.java +++ b/net/minecraft/world/entity/animal/Wolf.java -@@ -115,9 +115,32 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder(this, Llama.class, 24.0F, 1.5, 1.5)); -@@ -129,6 +152,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder -Date: Tue, 8 Dec 2020 17:15:15 -0500 -Subject: [PATCH] Configurable chance for wolves to spawn rabid - -Configurable chance to spawn a wolf that is rabid. -Rabid wolves attack all players, mobs, and animals. - -diff --git a/net/minecraft/world/entity/animal/Wolf.java b/net/minecraft/world/entity/animal/Wolf.java -index 539eba7148be12eb05c907ed86b0cea975424874..966fe4544212cc831ae617bc2eb05189102ff470 100644 --- a/net/minecraft/world/entity/animal/Wolf.java +++ b/net/minecraft/world/entity/animal/Wolf.java -@@ -103,6 +103,37 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder type = entity.getType(); + return type == EntityType.SHEEP || type == EntityType.RABBIT || type == EntityType.FOX; }; + // Purpur start - Configurable chance for wolves to spawn rabid + private boolean isRabid = false; @@ -48,10 +38,10 @@ index 539eba7148be12eb05c907ed86b0cea975424874..966fe4544212cc831ae617bc2eb05189 private static final float START_HEALTH = 8.0F; private static final float TAME_HEALTH = 40.0F; private static final float ARMOR_REPAIR_UNIT = 0.125F; -@@ -159,6 +190,31 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder(this, Llama.class, 24.0F, 1.5D, 1.5D)); + this.goalSelector.addGoal(3, new Wolf.WolfAvoidEntityGoal<>(this, Llama.class, 24.0F, 1.5, 1.5)); + this.goalSelector.addGoal(3, new AvoidRabidWolfGoal(this, 24.0F, 1.5D, 1.5D)); // Purpur - Configurable chance for wolves to spawn rabid this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F)); - this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0D, true)); - this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0D, 10.0F, 2.0F)); -@@ -179,7 +236,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder(this, Player.class, 10, true, false, this::isAngryAt)); -- this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR)); -+ // this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR)); // Purpur - moved to updatePathfinders() +- this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, PREY_SELECTOR)); ++ // this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, PREY_SELECTOR)); // Purpur - Configurable chance for wolves to spawn rabid - moved to updatePathfinders() this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR)); this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeleton.class, false)); this.targetSelector.addGoal(8, new ResetUniversalAngerTargetGoal<>(this, true)); -@@ -228,6 +285,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder { - nbt.putString("variant", resourcekey.location().toString()); - }); -@@ -245,6 +303,10 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder compound.putString("variant", resourceKey.location().toString())); + this.addPersistentAngerSaveData(compound); + } +@@ -196,6 +_,10 @@ + if (compound.contains("CollarColor", 99)) { + this.setCollarColor(DyeColor.byId(compound.getInt("CollarColor"))); } + // Purpur start - Configurable chance for wolves to spawn rabid -+ this.isRabid = nbt.getBoolean("Purpur.IsRabid"); ++ this.isRabid = compound.getBoolean("Purpur.IsRabid"); + this.updatePathfinders(false); + // Purpur end - Configurable chance for wolves to spawn rabid - this.readPersistentAngerSaveData(this.level(), nbt); + this.readPersistentAngerSaveData(this.level(), compound); } -@@ -263,6 +325,10 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.wolfNaturalRabid; ++ this.isRabid = level.getLevel().purpurConfig.wolfNaturalRabid > 0.0D && random.nextDouble() <= level.getLevel().purpurConfig.wolfNaturalRabid; + this.updatePathfinders(false); + // Purpur end - Configurable chance for wolves to spawn rabid - return super.finalizeSpawn(world, difficulty, spawnReason, (SpawnGroupData) entityData); + return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData); } -@@ -306,6 +372,11 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder