Fix cubozoa and end fish getting smaller after every reload

Previously, getScale() was used to get the size value when saving the
entity to NBT. However, this means that the entities will get
progressively smaller, since getScale() divides the true scale before
returning it. This commit fixes this by getting the 'raw' scale directly
from the dataTracker when saving the scale to NBT.
This commit is contained in:
vemerion 2021-04-19 15:36:56 +02:00
parent 482ab05112
commit 25b153f515
2 changed files with 2 additions and 2 deletions

View file

@ -75,7 +75,7 @@ public class CubozoaEntity extends SchoolingFishEntity {
public void writeCustomDataToTag(CompoundTag tag) { public void writeCustomDataToTag(CompoundTag tag) {
super.writeCustomDataToTag(tag); super.writeCustomDataToTag(tag);
tag.putByte("Variant", (byte) getVariant()); tag.putByte("Variant", (byte) getVariant());
tag.putByte("Scale", (byte) getScale()); tag.putByte("Scale", dataTracker.get(SCALE));
} }
@Override @Override

View file

@ -69,7 +69,7 @@ public class EndFishEntity extends SchoolingFishEntity {
public void writeCustomDataToTag(CompoundTag tag) { public void writeCustomDataToTag(CompoundTag tag) {
super.writeCustomDataToTag(tag); super.writeCustomDataToTag(tag);
tag.putByte("Variant", (byte) getVariant()); tag.putByte("Variant", (byte) getVariant());
tag.putByte("Scale", (byte) getScale()); tag.putByte("Scale", dataTracker.get(SCALE));
} }
@Override @Override