-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2e1c86
commit a376ec6
Showing
26 changed files
with
241 additions
and
170 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
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
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
17 changes: 17 additions & 0 deletions
17
src/main/java/com/irtimaled/bbor/common/BBORCustomPayload.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.irtimaled.bbor.common; | ||
|
||
import net.minecraft.network.PacketByteBuf; | ||
import net.minecraft.network.packet.CustomPayload; | ||
import net.minecraft.util.Identifier; | ||
|
||
public record BBORCustomPayload(PacketByteBuf byteBuf, Identifier id) implements CustomPayload { | ||
|
||
public BBORCustomPayload(Identifier identifier, PacketByteBuf buf) { | ||
this(new PacketByteBuf(buf.readBytes(buf.readableBytes())), identifier); | ||
} | ||
|
||
@Override | ||
public void write(PacketByteBuf buf) { | ||
buf.writeBytes(byteBuf); | ||
} | ||
} |
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
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
6 changes: 3 additions & 3 deletions
6
...xin/access/IServerPlayNetworkHandler.java → ...n/access/IServerCommonNetworkHandler.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
31 changes: 31 additions & 0 deletions
31
.../java/com/irtimaled/bbor/mixin/client/network/common/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,31 @@ | ||
package com.irtimaled.bbor.mixin.client.network.common; | ||
|
||
import com.irtimaled.bbor.client.interop.ClientInterop; | ||
import com.irtimaled.bbor.common.BBORCustomPayload; | ||
import com.irtimaled.bbor.common.EventBus; | ||
import com.irtimaled.bbor.common.messages.AddBoundingBox; | ||
import com.irtimaled.bbor.common.messages.InitializeClient; | ||
import com.irtimaled.bbor.common.messages.PayloadReader; | ||
import com.irtimaled.bbor.common.messages.StructureListSync; | ||
import com.irtimaled.bbor.common.messages.SubscribeToServer; | ||
import com.irtimaled.bbor.common.messages.protocols.PacketSplitter; | ||
import com.irtimaled.bbor.common.messages.servux.ServuxStructurePackets; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.network.ClientCommonNetworkHandler; | ||
import net.minecraft.client.network.ClientPlayNetworkHandler; | ||
import net.minecraft.network.NetworkThreadUtils; | ||
import net.minecraft.network.PacketByteBuf; | ||
import net.minecraft.network.packet.CustomPayload; | ||
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(ClientCommonNetworkHandler.class) | ||
public class MixinClientCommonNetworkHandler { | ||
|
||
@Inject(method = "onDisconnect", at = @At("HEAD")) | ||
private void onDisconnect(CallbackInfo ci) { | ||
ClientInterop.disconnectedFromRemoteServer(); | ||
} | ||
} |
Oops, something went wrong.