Skip to content

Commit

Permalink
Fix issue with rejoining client
Browse files Browse the repository at this point in the history
  • Loading branch information
nnnik committed Dec 18, 2022
1 parent 77a5061 commit 7471cc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import ch.endte.syncmatica.Syncmatica;
import ch.endte.syncmatica.litematica.LitematicManager;
import ch.endte.syncmatica.litematica.ScreenHelper;
import ch.endte.syncmatica.mixin_actor.ActorClientPlayNetworkHandler;
import net.minecraft.client.MinecraftClient;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -17,5 +18,6 @@ private void shutdownSyncmatica(final CallbackInfo ci) {
ScreenHelper.close();
Syncmatica.shutdown();
LitematicManager.clear();
ActorClientPlayNetworkHandler.getInstance().reset();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ public boolean packetEvent(final Identifier id, final PacketByteBuf buf) {
return false;
}

public void reset() {
clientCommunication = null;
exTarget = null;
clientPlayNetworkHandler = null;
}

private static void setClientPlayNetworkHandler(final ClientPlayNetworkHandler clientPlayNetworkHandler) {
ActorClientPlayNetworkHandler.clientPlayNetworkHandler = clientPlayNetworkHandler;
}
Expand Down

0 comments on commit 7471cc0

Please sign in to comment.