From 45114dc7b5b3793f6b817ade2942fb03f6b5ee63 Mon Sep 17 00:00:00 2001 From: fullwall Date: Fri, 28 Oct 2022 19:19:43 +0800 Subject: [PATCH] Fix wardens not having their dig cooldown set properly --- .../citizensnpcs/nms/v1_19_R1/entity/WardenController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/v1_19_R1/src/main/java/net/citizensnpcs/nms/v1_19_R1/entity/WardenController.java b/v1_19_R1/src/main/java/net/citizensnpcs/nms/v1_19_R1/entity/WardenController.java index 33c8037aa..6c79cddc6 100644 --- a/v1_19_R1/src/main/java/net/citizensnpcs/nms/v1_19_R1/entity/WardenController.java +++ b/v1_19_R1/src/main/java/net/citizensnpcs/nms/v1_19_R1/entity/WardenController.java @@ -18,9 +18,11 @@ import net.minecraft.core.PositionImpl; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; +import net.minecraft.util.Unit; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.memory.MemoryModuleType; import net.minecraft.world.entity.monster.warden.Warden; import net.minecraft.world.entity.vehicle.AbstractMinecart; import net.minecraft.world.entity.vehicle.Boat; @@ -48,6 +50,7 @@ public class WardenController extends MobEntityController { public EntityWardenNPC(EntityType types, Level level, NPC npc) { super(types, level); this.npc = (CitizensNPC) npc; + this.getBrain().setMemoryWithExpiry(MemoryModuleType.DIG_COOLDOWN, Unit.INSTANCE, 1200L); } @Override @@ -87,6 +90,7 @@ public class WardenController extends MobEntityController { return; } NMSImpl.updateMinecraftAIState(npc, this); + if (npc.useMinecraftAI()) { super.customServerAiStep(); } else {