From f57eb6aa4d67fc69e3febf648bc2f02846508a0f Mon Sep 17 00:00:00 2001 From: AViewFromTheTop <87103914+AViewFromTheTop@users.noreply.github.com> Date: Mon, 16 Oct 2023 00:34:30 -0400 Subject: [PATCH] ok maybe this will work --- src/main/java/net/frozenblock/wilderwild/entity/Crab.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/frozenblock/wilderwild/entity/Crab.java b/src/main/java/net/frozenblock/wilderwild/entity/Crab.java index ed8eb894a9..2a004c513a 100644 --- a/src/main/java/net/frozenblock/wilderwild/entity/Crab.java +++ b/src/main/java/net/frozenblock/wilderwild/entity/Crab.java @@ -382,7 +382,7 @@ public boolean isDiggingOrEmerging() { } public boolean isInvisibleWhileUnderground() { - return this.diggingTicks() > DIG_LENGTH_IN_TICKS; + return this.hasPose(Pose.DIGGING) && this.diggingTicks() > DIG_LENGTH_IN_TICKS; } @Contract("null->false") @@ -580,6 +580,7 @@ public void addAdditionalSaveData(CompoundTag compound) { compound.putBoolean("FromBucket", this.fromBucket()); compound.putInt("DigTicks", this.diggingTicks()); VibrationSystem.Data.CODEC.encodeStart(NbtOps.INSTANCE, this.vibrationData).resultOrPartial(WilderSharedConstants.LOGGER::error).ifPresent(tag -> compound.put("listener", tag)); + compound.putString("EntityPose", this.getPose().name()); } @Override @@ -590,6 +591,7 @@ public void readAdditionalSaveData(CompoundTag compound) { if (compound.contains("listener", 10)) { VibrationSystem.Data.CODEC.parse(new Dynamic<>(NbtOps.INSTANCE, compound.getCompound("listener"))).resultOrPartial(WilderSharedConstants.LOGGER::error).ifPresent(data -> this.vibrationData = data); } + this.setPose(Pose.valueOf(compound.getString("EntityPose"))); } @Override