Skip to content

Commit

Permalink
ok maybe this will work
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Oct 16, 2023
1 parent 0286632 commit f57eb6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/frozenblock/wilderwild/entity/Crab.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f57eb6a

Please sign in to comment.