diff --git a/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/ServerPlayerMixin.java b/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/ServerPlayerMixin.java index f989fdc0..f4e22a9f 100644 --- a/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/ServerPlayerMixin.java +++ b/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/ServerPlayerMixin.java @@ -66,4 +66,19 @@ private void init(final CallbackInfo ci) { public final RegionizedPlayerChunkLoader.ViewDistanceHolder moonrise$getViewDistanceHolder() { return this.viewDistanceHolder; } + + /** + * @reason Copy player state when respawning + * @author Spottedleaf + */ + @Inject( + method = "restoreFrom", + at = @At( + value = "HEAD" + ) + ) + private void copyRealPlayer(ServerPlayer from, boolean bl, CallbackInfo ci) { + this.isRealPlayer = ((ServerPlayerMixin)(Object)from).isRealPlayer; + this.viewDistanceHolder = ((ServerPlayerMixin)(Object)from).viewDistanceHolder; + } }