This commit is contained in:
Owen1212055 2024-12-14 14:43:19 -05:00
parent ea5c599077
commit c31ab10475

View file

@ -1,14 +1,12 @@
--- a/net/minecraft/world/entity/monster/EnderMan.java --- a/net/minecraft/world/entity/monster/EnderMan.java
+++ b/net/minecraft/world/entity/monster/EnderMan.java +++ b/net/minecraft/world/entity/monster/EnderMan.java
@@ -116,10 +_,26 @@ @@ -117,7 +_,23 @@
}
@Override @Override
- public void setTarget(@Nullable LivingEntity livingEntity) { public void setTarget(@Nullable LivingEntity livingEntity) {
- super.setTarget(livingEntity); - super.setTarget(livingEntity);
+ public void setTarget(@Nullable LivingEntity target) {
+ // CraftBukkit start - fire event + // CraftBukkit start - fire event
+ this.setTarget(target, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true); + this.setTarget(livingEntity, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true);
+ } + }
+ +
+ // Paper start - EndermanEscapeEvent + // Paper start - EndermanEscapeEvent
@ -18,18 +16,15 @@
+ // Paper end - EndermanEscapeEvent + // Paper end - EndermanEscapeEvent
+ +
+ @Override + @Override
+ public boolean setTarget(LivingEntity target, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) { + public boolean setTarget(LivingEntity livingEntity, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) {
+ if (!super.setTarget(target, reason, fireEvent)) { + if (!super.setTarget(livingEntity, reason, fireEvent)) {
+ return false; + return false;
+ } + }
+ target = this.getTarget(); + livingEntity = this.getTarget();
+ // CraftBukkit end + // CraftBukkit end
AttributeInstance attribute = this.getAttribute(Attributes.MOVEMENT_SPEED); AttributeInstance attribute = this.getAttribute(Attributes.MOVEMENT_SPEED);
- if (livingEntity == null) { if (livingEntity == null) {
+ if (target == null) {
this.targetChangeTime = 0; this.targetChangeTime = 0;
this.entityData.set(DATA_CREEPY, false);
this.entityData.set(DATA_STARED_AT, false);
@@ -131,6 +_,7 @@ @@ -131,6 +_,7 @@
attribute.addTransientModifier(SPEED_MODIFIER_ATTACKING); attribute.addTransientModifier(SPEED_MODIFIER_ATTACKING);
} }