diff --git a/paper-server/nms-patches/net/minecraft/world/entity/monster/warden/Warden.patch b/paper-server/nms-patches/net/minecraft/world/entity/monster/warden/Warden.patch new file mode 100644 index 0000000000..ea698caee0 --- /dev/null +++ b/paper-server/nms-patches/net/minecraft/world/entity/monster/warden/Warden.patch @@ -0,0 +1,63 @@ +--- a/net/minecraft/world/entity/monster/warden/Warden.java ++++ b/net/minecraft/world/entity/monster/warden/Warden.java +@@ -370,7 +370,7 @@ + + @Override + public BehaviorController getBrain() { +- return super.getBrain(); ++ return (BehaviorController) super.getBrain(); // CraftBukkit - decompile error + } + + @Override +@@ -421,13 +421,13 @@ + public static void applyDarknessAround(WorldServer worldserver, Vec3D vec3d, @Nullable Entity entity, int i) { + MobEffect mobeffect = new MobEffect(MobEffects.DARKNESS, 260, 0, false, false); + +- MobEffectUtil.addEffectToPlayersAround(worldserver, entity, vec3d, (double) i, mobeffect, 200); ++ MobEffectUtil.addEffectToPlayersAround(worldserver, entity, vec3d, i, mobeffect, 200, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.WARDEN); // CraftBukkit - Add EntityPotionEffectEvent.Cause + } + + @Override + public void addAdditionalSaveData(NBTTagCompound nbttagcompound) { + super.addAdditionalSaveData(nbttagcompound); +- DataResult dataresult = AngerManagement.codec(this::canTargetEntity).encodeStart(DynamicOpsNBT.INSTANCE, this.angerManagement); ++ DataResult dataresult = AngerManagement.codec(this::canTargetEntity).encodeStart(DynamicOpsNBT.INSTANCE, this.angerManagement); // CraftBukkit - decompile error + Logger logger = Warden.LOGGER; + + Objects.requireNonNull(logger); +@@ -452,7 +452,7 @@ + dataresult = AngerManagement.codec(this::canTargetEntity).parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("anger"))); + logger = Warden.LOGGER; + Objects.requireNonNull(logger); +- dataresult.resultOrPartial(logger::error).ifPresent((angermanagement) -> { ++ ((DataResult) dataresult).resultOrPartial(logger::error).ifPresent((angermanagement) -> { // CraftBukkit - decompile error + this.angerManagement = angermanagement; + }); + this.syncClientAngerLevel(); +@@ -462,7 +462,7 @@ + dataresult = VibrationListener.codec(this).parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("listener"))); + logger = Warden.LOGGER; + Objects.requireNonNull(logger); +- dataresult.resultOrPartial(logger::error).ifPresent((vibrationlistener) -> { ++ ((DataResult) dataresult).resultOrPartial(logger::error).ifPresent((vibrationlistener) -> { // CraftBukkit - decompile error + this.dynamicGameEventListener.updateListener(vibrationlistener, this.level); + }); + } +@@ -496,7 +496,7 @@ + public void increaseAngerAt(@Nullable Entity entity, int i, boolean flag) { + if (!this.isNoAi() && this.canTargetEntity(entity)) { + WardenAi.setDigCooldown(this); +- boolean flag1 = !(this.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse((Object) null) instanceof EntityHuman); ++ boolean flag1 = !(this.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null) instanceof EntityHuman); // CraftBukkit - decompile error + int j = this.angerManagement.increaseAnger(entity, i); + + if (entity instanceof EntityHuman && flag1 && AngerLevel.byAnger(j).isAngry()) { +@@ -517,7 +517,7 @@ + @Nullable + @Override + public EntityLiving getTarget() { +- return (EntityLiving) this.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse((Object) null); ++ return (EntityLiving) this.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error + } + + @Override diff --git a/paper-server/pom.xml b/paper-server/pom.xml index 9aa776c935..1ee34196ce 100644 --- a/paper-server/pom.xml +++ b/paper-server/pom.xml @@ -255,6 +255,13 @@ 1.7.3 runtime + + + org.jetbrains + annotations-java5 + 23.0.0 + provided + junit