SPIGOT-7657: Error when loading angry entities

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2024-05-03 19:06:46 +10:00
parent c604cac551
commit f01e218606

View file

@ -1,6 +1,34 @@
--- a/net/minecraft/world/entity/IEntityAngerable.java
+++ b/net/minecraft/world/entity/IEntityAngerable.java
@@ -114,7 +114,7 @@
@@ -9,6 +9,10 @@
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.World;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end
+
public interface IEntityAngerable {
String TAG_ANGER_TIME = "AngerTime";
@@ -48,14 +52,14 @@
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
- this.setTarget(entityinsentient);
+ this.setTarget(entityinsentient, EntityTargetEvent.TargetReason.UNKNOWN, false); // CraftBukkit
this.setLastHurtByMob(entityinsentient);
}
if (entity instanceof EntityHuman) {
EntityHuman entityhuman = (EntityHuman) entity;
- this.setTarget(entityhuman);
+ this.setTarget(entityhuman, EntityTargetEvent.TargetReason.UNKNOWN, false); // CraftBukkit
this.setLastHurtByPlayer(entityhuman);
}
@@ -114,7 +118,7 @@
default void stopBeingAngry() {
this.setLastHurtByMob((EntityLiving) null);
this.setPersistentAngerTarget((UUID) null);
@ -9,7 +37,7 @@
this.setRemainingPersistentAngerTime(0);
}
@@ -127,6 +127,8 @@
@@ -127,6 +131,8 @@
void setTarget(@Nullable EntityLiving entityliving);