diff options
author | Emilia Kond <[email protected]> | 2023-06-13 01:00:12 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-12 15:00:12 -0700 |
commit | 2d09115b3a73b27a760dfe7debdbd88b279b29e2 (patch) | |
tree | f9dc39849e410c23536b4f94221b08d8337b13cd /patches/server/0586-fix-PigZombieAngerEvent-cancellation.patch | |
parent | 87dfff4cfabefe329d6b6f6b8e2985e4778bd8d3 (diff) | |
download | Paper-2d09115b3a73b27a760dfe7debdbd88b279b29e2.tar.gz Paper-2d09115b3a73b27a760dfe7debdbd88b279b29e2.zip |
Use net.kyori.ansi for console logging (#9313)
Uses the new ANSIComponentSerializer introduced in Adventure 4.14.0 to
serialize components when logging them via the ComponentLogger, or when
sending messages to the console.
This replaces the old solution which uses legacy jank and custom color
conversions, with a new library that handles the conversion and config
Diffstat (limited to 'patches/server/0586-fix-PigZombieAngerEvent-cancellation.patch')
-rw-r--r-- | patches/server/0586-fix-PigZombieAngerEvent-cancellation.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/server/0586-fix-PigZombieAngerEvent-cancellation.patch b/patches/server/0586-fix-PigZombieAngerEvent-cancellation.patch new file mode 100644 index 0000000000..195a80293d --- /dev/null +++ b/patches/server/0586-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 f1d4a66aa55c4328fe6f834830d70686c95bea51..aff140cfb2bbdce8b512080cf394c84c5c4ff807 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java +@@ -56,6 +56,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { + private int ticksUntilNextAlert; + private static final float ZOMBIFIED_PIGLIN_EYE_HEIGHT = 1.79F; + private static final float ZOMBIFIED_PIGLIN_BABY_EYE_HEIGHT_ADJUSTMENT = 0.82F; ++ private HurtByTargetGoal pathfinderGoalHurtByTarget; // Paper + + public ZombifiedPiglin(EntityType<? extends ZombifiedPiglin> type, Level world) { + super(type, world); +@@ -76,7 +77,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 - assign field + this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt)); + this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true)); + } +@@ -184,6 +185,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { + this.level().getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + this.setPersistentAngerTarget(null); ++ pathfinderGoalHurtByTarget.stop(); // Paper - clear goalTargets to fix cancellation + return; + } + this.setRemainingPersistentAngerTime(event.getNewAnger()); |