From 47a2046188daff9b9b3aaeda6bbf2787bf14faef Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 5 Aug 2023 15:53:01 +0100 Subject: [PATCH] Fixed crystal hearts not rendering correctly after a relog --- .../unicopia/entity/FloatingArtefactEntity.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java index d1ea98e4..6f60e7e0 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java @@ -145,9 +145,9 @@ public class FloatingArtefactEntity extends Entity implements UDamageSources { @Override protected void readCustomDataFromNbt(NbtCompound compound) { - ItemStack itemStack = ItemStack.fromNbt(compound.getCompound("Item")); - setStack(itemStack); + setStack(ItemStack.fromNbt(compound.getCompound("Item"))); setState(State.valueOf(compound.getInt("State"))); + setSpin(compound.getFloat("spin")); } @Override @@ -157,6 +157,7 @@ public class FloatingArtefactEntity extends Entity implements UDamageSources { compound.put("Item", stack.writeNbt(new NbtCompound())); } compound.putInt("State", getState().ordinal()); + compound.putFloat("spin", getSpin()); } @Override @@ -186,11 +187,6 @@ public class FloatingArtefactEntity extends Entity implements UDamageSources { return true; } - @Override - public Packet createSpawnPacket() { - return Channel.SERVER_SPAWN_PROJECTILE.toPacket(new MsgSpawnProjectile(this)); - } - @Override public World asWorld() { return getWorld();