Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
JOIN
event with our own mixin
Fixes a weird issue where packets can't be received during the `JOIN` event, making the client "miss" the server's response
- Loading branch information
Showing
3 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/main/java/com/denizenscript/clientizen/mixin/ClientPlayNetworkHandlerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.denizenscript.clientizen.mixin; | ||
|
||
import com.denizenscript.clientizen.network.NetworkManager; | ||
import net.minecraft.client.network.ClientPlayNetworkHandler; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ClientPlayNetworkHandler.class) | ||
public class ClientPlayNetworkHandlerMixin { | ||
|
||
@Inject(method = "onGameJoin", at = @At("TAIL")) | ||
private void clientizen$onGameJoin(CallbackInfo ci) { | ||
NetworkManager.onConnect(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters