Skip to content

Commit

Permalink
Fix wardens not having their dig cooldown set properly
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 28, 2022
1 parent d532dae commit 45114dc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
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;
Expand Down Expand Up @@ -48,6 +50,7 @@ public EntityWardenNPC(EntityType<? extends Warden> types, Level level) {
public EntityWardenNPC(EntityType<? extends Warden> types, Level level, NPC npc) {
super(types, level);
this.npc = (CitizensNPC) npc;
this.getBrain().setMemoryWithExpiry(MemoryModuleType.DIG_COOLDOWN, Unit.INSTANCE, 1200L);
}

@Override
Expand Down Expand Up @@ -87,6 +90,7 @@ public void customServerAiStep() {
return;
}
NMSImpl.updateMinecraftAIState(npc, this);

if (npc.useMinecraftAI()) {
super.customServerAiStep();
} else {
Expand Down

0 comments on commit 45114dc

Please sign in to comment.