mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 23:27:59 +01:00
Fixed player race not being persisted between instances
This commit is contained in:
parent
2afe31c706
commit
6ccc91a2c1
1 changed files with 4 additions and 4 deletions
|
@ -74,14 +74,14 @@ abstract class MixinLivingEntity extends Entity implements PonyContainer<Ponylik
|
|||
|
||||
@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"));
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- temporary
|
||||
|
|
Loading…
Reference in a new issue