mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed items not saving their state correctly
This commit is contained in:
parent
709e8892e8
commit
5821e13728
1 changed files with 4 additions and 4 deletions
|
@ -47,14 +47,14 @@ abstract class MixinItemEntity extends Entity implements IItemEntity {
|
|||
|
||||
@Inject(method = "writeCustomDataToTag(Lnet/minecraft/nbt/CompoundTag;)V", at = @At("HEAD"))
|
||||
private void onWriteCustomDataToTag(CompoundTag tag, CallbackInfo info) {
|
||||
if (tag.contains("unicopia_caster")) {
|
||||
get().fromNBT(tag.getCompound("unicopia_caster"));
|
||||
}
|
||||
tag.put("unicopia_caster", get().toNBT());
|
||||
}
|
||||
|
||||
@Inject(method = "readCustomDataFromTag(Lnet/minecraft/nbt/CompoundTag;)V", at = @At("HEAD"))
|
||||
private void onReadCustomDataFromTag(CompoundTag tag, CallbackInfo info) {
|
||||
tag.put("unicopia_caster", get().toNBT());
|
||||
if (tag.contains("unicopia_caster")) {
|
||||
get().fromNBT(tag.getCompound("unicopia_caster"));
|
||||
}
|
||||
}
|
||||
|
||||
@Accessor("age")
|
||||
|
|
Loading…
Reference in a new issue