mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 23:27: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"))
|
@Inject(method = "writeCustomDataToTag(Lnet/minecraft/nbt/CompoundTag;)V", at = @At("HEAD"))
|
||||||
private void onWriteCustomDataToTag(CompoundTag tag, CallbackInfo info) {
|
private void onWriteCustomDataToTag(CompoundTag tag, CallbackInfo info) {
|
||||||
if (tag.contains("unicopia_caster")) {
|
tag.put("unicopia_caster", get().toNBT());
|
||||||
get().fromNBT(tag.getCompound("unicopia_caster"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "readCustomDataFromTag(Lnet/minecraft/nbt/CompoundTag;)V", at = @At("HEAD"))
|
@Inject(method = "readCustomDataFromTag(Lnet/minecraft/nbt/CompoundTag;)V", at = @At("HEAD"))
|
||||||
private void onReadCustomDataFromTag(CompoundTag tag, CallbackInfo info) {
|
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")
|
@Accessor("age")
|
||||||
|
|
Loading…
Reference in a new issue