Merge branch 'minecraft-lod-mod-refactor/client-world-close'

This commit is contained in:
James Seibel
2023-10-29 16:09:47 -05:00
2 changed files with 13 additions and 15 deletions
@@ -23,14 +23,6 @@ public class MixinClientPacketListener
@Shadow
private ClientLevel level;
@Inject(method = "handleLogin", at = @At("HEAD"))
void onHandleLoginStart(CallbackInfo ci)
{
// not the best way to notify Core that we are no longer in the previous world, but it will have to do for now
ClientApi.INSTANCE.onClientOnlyDisconnected();
}
@Inject(method = "handleLogin", at = @At("RETURN"))
void onHandleLoginEnd(CallbackInfo ci) { ClientApi.INSTANCE.onClientOnlyConnected(); }
@@ -46,11 +38,12 @@ public class MixinClientPacketListener
#endif
void onCleanupStart(CallbackInfo ci)
{
// TODO which unload method should be used? do we need both?
// TODO Is this even needed here?
if (level != null)
{
ClientApi.INSTANCE.clientLevelUnloadEvent(ClientLevelWrapper.getWrapper(level));
}
ClientApi.INSTANCE.onClientOnlyDisconnected();
}
#if POST_MC_1_20_1