forked from maruohon/litematica
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix carpet:hello packet handling for easy place protocol
- Loading branch information
1 parent
8e28551
commit 15f2c6f
Showing
5 changed files
with
70 additions
and
35 deletions.
There are no files selected for viewing
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
27 changes: 27 additions & 0 deletions
27
src/main/java/fi/dy/masa/litematica/mixin/MixinClientCommonNetworkHandler.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,27 @@ | ||
package fi.dy.masa.litematica.mixin; | ||
|
||
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; | ||
import net.minecraft.client.network.ClientCommonNetworkHandler; | ||
import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket; | ||
import fi.dy.masa.litematica.Litematica; | ||
import fi.dy.masa.litematica.data.DataManager; | ||
|
||
/** | ||
* They keep moving where the effective CustomPayload handling is... keeping them both | ||
*/ | ||
@Mixin(ClientCommonNetworkHandler.class) | ||
public class MixinClientCommonNetworkHandler | ||
{ | ||
@Inject(method = "onCustomPayload(Lnet/minecraft/network/packet/s2c/common/CustomPayloadS2CPacket;)V", at = @At("HEAD")) | ||
private void litematica_onCustomPayload(CustomPayloadS2CPacket packet, CallbackInfo ci) | ||
{ | ||
if (packet.payload().getId().id().equals(DataManager.CARPET_HELLO)) | ||
{ | ||
Litematica.debugLog("ClientCommonNetworkHandler#litematica_onCustomPayload(): received carpet hello packet"); | ||
DataManager.setIsCarpetServer(true); | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,37 +1,38 @@ | ||
{ | ||
"required": true, | ||
"package": "fi.dy.masa.litematica.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"minVersion": "0.8", | ||
"client": [ | ||
"IMixinChunkDeltaUpdateS2CPacket", | ||
"IMixinEntity", | ||
"IMixinFenceGateBlock", | ||
"IMixinHandledScreen", | ||
"IMixinRedstoneWireBlock", | ||
"IMixinSignBlockEntity", | ||
"IMixinStairsBlock", | ||
"IMixinVineBlock", | ||
"IMixinWorldTickScheduler", | ||
"MixinAbstractSignEditScreen", | ||
"MixinBlock", | ||
"MixinBlockItem", | ||
"MixinBlockStateFlattening", | ||
"MixinChestBlock", | ||
"MixinClientPlayNetworkHandler", | ||
"MixinClientWorld", | ||
"MixinDebugHud", | ||
"MixinHandledScreen", | ||
"MixinIntegratedServer", | ||
"MixinMinecraftClient", | ||
"MixinModelOverrideList", | ||
"MixinRailBlocks", | ||
"MixinServerPlayNetworkHandler", | ||
"MixinWorld", | ||
"MixinWorldChunk", | ||
"MixinWorldRenderer" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
"required": true, | ||
"package": "fi.dy.masa.litematica.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"minVersion": "0.8", | ||
"client": [ | ||
"IMixinChunkDeltaUpdateS2CPacket", | ||
"IMixinEntity", | ||
"IMixinFenceGateBlock", | ||
"IMixinHandledScreen", | ||
"IMixinRedstoneWireBlock", | ||
"IMixinSignBlockEntity", | ||
"IMixinStairsBlock", | ||
"IMixinVineBlock", | ||
"IMixinWorldTickScheduler", | ||
"MixinAbstractSignEditScreen", | ||
"MixinBlock", | ||
"MixinBlockItem", | ||
"MixinBlockStateFlattening", | ||
"MixinChestBlock", | ||
"MixinClientCommonNetworkHandler", | ||
"MixinClientPlayNetworkHandler", | ||
"MixinClientWorld", | ||
"MixinDebugHud", | ||
"MixinHandledScreen", | ||
"MixinIntegratedServer", | ||
"MixinMinecraftClient", | ||
"MixinModelOverrideList", | ||
"MixinRailBlocks", | ||
"MixinServerPlayNetworkHandler", | ||
"MixinWorld", | ||
"MixinWorldChunk", | ||
"MixinWorldRenderer" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |