Fix to setting animation names.

This commit is contained in:
Luis C.M committed 2023-02-14 01:26:40 -06:00
1 parent 354c9808e4
commit e65ba59b8e
2 files changed
+9 -2

No files matched your search

@@ -888,9 +888,10 @@ public class PacketHandlerServer{
}
else if (type == EnumPacketServer.AnimationSave) {
String prevName = Server.readString(buffer);
AnimationController.instance.animations.remove(prevName);
Animation animation = new Animation();
animation.readFromNBT(Server.readNBT(buffer));
if (prevName != null && !prevName.equals(animation.getName()) && AnimationController.instance.has(animation.getName())) {
if (AnimationController.instance.has(animation.getName())) {
animation.name = prevName;
}
animation.save();