25
25
import meteordevelopment .meteorclient .systems .modules .render .NoRender ;
26
26
import meteordevelopment .meteorclient .utils .player .ChatUtils ;
27
27
import net .minecraft .client .MinecraftClient ;
28
+ import net .minecraft .client .network .ClientCommonNetworkHandler ;
29
+ import net .minecraft .client .network .ClientConnectionState ;
28
30
import net .minecraft .client .network .ClientPlayNetworkHandler ;
29
31
import net .minecraft .client .world .ClientWorld ;
30
32
import net .minecraft .entity .Entity ;
31
33
import net .minecraft .entity .ItemEntity ;
34
+ import net .minecraft .network .ClientConnection ;
32
35
import net .minecraft .network .packet .s2c .play .*;
33
36
import net .minecraft .world .chunk .WorldChunk ;
34
- import org .spongepowered .asm .mixin .Final ;
35
37
import org .spongepowered .asm .mixin .Mixin ;
36
38
import org .spongepowered .asm .mixin .Shadow ;
37
39
import org .spongepowered .asm .mixin .Unique ;
40
42
import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
41
43
42
44
@ Mixin (ClientPlayNetworkHandler .class )
43
- public abstract class ClientPlayNetworkHandlerMixin {
44
- @ Shadow
45
- @ Final
46
- private MinecraftClient client ;
45
+ public abstract class ClientPlayNetworkHandlerMixin extends ClientCommonNetworkHandler {
47
46
@ Shadow
48
47
private ClientWorld world ;
49
48
@@ -55,6 +54,10 @@ public abstract class ClientPlayNetworkHandlerMixin {
55
54
56
55
private boolean worldNotNull ;
57
56
57
+ protected ClientPlayNetworkHandlerMixin (MinecraftClient client , ClientConnection connection , ClientConnectionState connectionState ) {
58
+ super (client , connection , connectionState );
59
+ }
60
+
58
61
@ Inject (method = "onEntitySpawn" , at = @ At ("HEAD" ), cancellable = true )
59
62
private void onEntitySpawn (EntitySpawnS2CPacket packet , CallbackInfo info ) {
60
63
if (packet != null && packet .getEntityType () != null ) {
@@ -85,7 +88,7 @@ private void onPlaySound(PlaySoundS2CPacket packet, CallbackInfo info) {
85
88
86
89
@ Inject (method = "onChunkData" , at = @ At ("TAIL" ))
87
90
private void onChunkData (ChunkDataS2CPacket packet , CallbackInfo info ) {
88
- WorldChunk chunk = client .world .getChunk (packet .getX (), packet .getZ ());
91
+ WorldChunk chunk = client .world .getChunk (packet .getChunkX (), packet .getChunkZ ());
89
92
MeteorClient .EVENT_BUS .post (ChunkDataEvent .get (chunk ));
90
93
}
91
94
0 commit comments