Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit e1a9100

Browse files
committed
Mark off the unsupported parts of the API, make them fail hard
1 parent 2e6192b commit e1a9100

5 files changed

Lines changed: 12 additions & 6 deletions

File tree

patchwork-networking/src/main/java/net/minecraftforge/fml/network/NetworkDirection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ private <T extends Packet<?>> ICustomPacket<T> construct() {
9999
return (ICustomPacket<T>) CustomPayloadS2CPacketAccessor.patchwork$create();
100100
case LOGIN_TO_SERVER:
101101
throw new UnsupportedOperationException("login packets are not supported");
102-
// return (ICustomPacket<T>) LoginQueryResponseC2SPacketAccessor.patchwork$create();
102+
// TODO: return (ICustomPacket<T>) LoginQueryResponseC2SPacketAccessor.patchwork$create();
103103
case LOGIN_TO_CLIENT:
104104
throw new UnsupportedOperationException("login packets are not supported");
105-
// return (ICustomPacket<T>) LoginQueryRequestS2CPacketAccessor.patchwork$create();
105+
// TODO: return (ICustomPacket<T>) LoginQueryRequestS2CPacketAccessor.patchwork$create();
106106
default:
107107
throw new IllegalStateException("Unexpected NetworkDirection " + this + ", someone's been tampering with enums!");
108108
}

patchwork-networking/src/main/java/net/minecraftforge/fml/network/event/EventNetworkChannel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public EventNetworkChannel(ListenableChannel channel) {
3939
channel.setPacketListener(this::packetListener);
4040
channel.setRegistrationChangeListener(networkEventBus::post);
4141
channel.setGatherLoginPayloadsListener(networkEventBus::post);
42+
43+
// TODO: Login packet stuff, registration change listeners
44+
throw new UnsupportedOperationException("Registration change / gather login payload events aren't supported");
4245
}
4346

4447
private void handleError(IEventBus bus, Event event, IEventListener[] listeners, int i, Throwable throwable) {

patchwork-networking/src/main/java/net/minecraftforge/fml/network/simple/SimpleChannel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ public void add() {
217217

218218
if (this.loginPacketGenerators != null) {
219219
this.channel.loginPackets.add((Function<Boolean, List<Pair<String, ?>>>) (Object) this.loginPacketGenerators);
220+
221+
// TODO: Login packet stuff
222+
throw new UnsupportedOperationException("Login packet generators are unsupported");
220223
}
221224
}
222225

patchwork-networking/src/main/resources/patchwork-networking.accessor.mixins.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"ClientConnectionAccessor",
77
"CustomPayloadC2SPacketAccessor",
88
"CustomPayloadS2CPacketAccessor",
9-
// "LoginQueryRequestS2CPacketAccessor",
10-
// "LoginQueryResponseC2SPacketAccessor",
9+
"LoginQueryRequestS2CPacketAccessor",
10+
"LoginQueryResponseC2SPacketAccessor",
1111
"ThreadExecutorAccessor"
1212
],
1313
"injectors": {

patchwork-networking/src/main/resources/patchwork-networking.packet.mixins.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"mixins": [
66
"MixinCustomPayloadC2SPacket",
77
"MixinCustomPayloadS2CPacket",
8-
// "MixinLoginQueryRequestS2CPacket",
9-
// "MixinLoginQueryResponseC2SPacket"
8+
"MixinLoginQueryRequestS2CPacket",
9+
"MixinLoginQueryResponseC2SPacket"
1010
],
1111
"injectors": {
1212
"defaultRequire": 1

0 commit comments

Comments
 (0)