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
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<ClientPlayPacketListener> createSpawnPacket() {
return Channel.SERVER_SPAWN_PROJECTILE.toPacket(new MsgSpawnProjectile(this));
}
@Override
public World asWorld() {
return getWorld();