diff options
author | Jake Potrebic <[email protected]> | 2024-04-26 16:43:59 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-04-26 17:00:40 -0700 |
commit | c38f96b0e57ad28f444dad8d1c4d2f1fb6ea19cb (patch) | |
tree | 419c16734eadf2568b42f966a6fc3a7e16728397 /patches/server/0531-fix-PigZombieAngerEvent-cancellation.patch | |
parent | 6a4974b1b96312b31383fca985c5d409b3939b42 (diff) | |
download | Paper-c38f96b0e57ad28f444dad8d1c4d2f1fb6ea19cb.tar.gz Paper-c38f96b0e57ad28f444dad8d1c4d2f1fb6ea19cb.zip |
deprecate our ItemRarity API
Diffstat (limited to 'patches/server/0531-fix-PigZombieAngerEvent-cancellation.patch')
-rw-r--r-- | patches/server/0531-fix-PigZombieAngerEvent-cancellation.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/server/0531-fix-PigZombieAngerEvent-cancellation.patch b/patches/server/0531-fix-PigZombieAngerEvent-cancellation.patch new file mode 100644 index 0000000000..ad3619023e --- /dev/null +++ b/patches/server/0531-fix-PigZombieAngerEvent-cancellation.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Trigary <[email protected]> +Date: Thu, 18 Mar 2021 21:38:01 +0100 +Subject: [PATCH] fix PigZombieAngerEvent cancellation + + +diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java +index 6db402d0c515956af8a2462a2461fac783f0c1e2..a6def4133f06c41be287e9942643e80a7b8e8218 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java +@@ -55,6 +55,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { + private static final int ALERT_RANGE_Y = 10; + private static final UniformInt ALERT_INTERVAL = TimeUtil.rangeOfSeconds(4, 6); + private int ticksUntilNextAlert; ++ private HurtByTargetGoal pathfinderGoalHurtByTarget; // Paper - fix PigZombieAngerEvent cancellation + + public ZombifiedPiglin(EntityType<? extends ZombifiedPiglin> type, Level world) { + super(type, world); +@@ -70,7 +71,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { + protected void addBehaviourGoals() { + this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false)); + this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D)); +- this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); ++ this.targetSelector.addGoal(1, pathfinderGoalHurtByTarget = (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); // Paper - fix PigZombieAngerEvent cancellation + this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt)); + this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true)); + } +@@ -178,6 +179,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { + this.level().getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + this.setPersistentAngerTarget(null); ++ pathfinderGoalHurtByTarget.stop(); // Paper - fix PigZombieAngerEvent cancellation + return; + } + this.setRemainingPersistentAngerTime(event.getNewAnger()); |