Fixed crystal hearts not rendering correctly after a relog

This commit is contained in:
Sollace 2023-08-05 15:53:01 +01:00
parent b337709f78
commit 47a2046188
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -145,9 +145,9 @@ public class FloatingArtefactEntity extends Entity implements UDamageSources {
@Override @Override
protected void readCustomDataFromNbt(NbtCompound compound) { protected void readCustomDataFromNbt(NbtCompound compound) {
ItemStack itemStack = ItemStack.fromNbt(compound.getCompound("Item")); setStack(ItemStack.fromNbt(compound.getCompound("Item")));
setStack(itemStack);
setState(State.valueOf(compound.getInt("State"))); setState(State.valueOf(compound.getInt("State")));
setSpin(compound.getFloat("spin"));
} }
@Override @Override
@ -157,6 +157,7 @@ public class FloatingArtefactEntity extends Entity implements UDamageSources {
compound.put("Item", stack.writeNbt(new NbtCompound())); compound.put("Item", stack.writeNbt(new NbtCompound()));
} }
compound.putInt("State", getState().ordinal()); compound.putInt("State", getState().ordinal());
compound.putFloat("spin", getSpin());
} }
@Override @Override
@ -186,11 +187,6 @@ public class FloatingArtefactEntity extends Entity implements UDamageSources {
return true; return true;
} }
@Override
public Packet<ClientPlayPacketListener> createSpawnPacket() {
return Channel.SERVER_SPAWN_PROJECTILE.toPacket(new MsgSpawnProjectile(this));
}
@Override @Override
public World asWorld() { public World asWorld() {
return getWorld(); return getWorld();