Skip to content

Commit

Permalink
fix(neoforge): Fix a bug that IntelliJ should have warned about but d…
Browse files Browse the repository at this point in the history
…idn't because not even IntelliJ can tangle its way through this builder code
  • Loading branch information
BlayTheNinth committed Jan 14, 2024
1 parent e79a1e5 commit ecbb9e2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ public void registerPayloadHandlers(final RegisterPayloadHandlerEvent event) {
final var message = messageRegistration.getDecodeFunc().apply(buf);
return new WrappedPacket(messageId, message, (BiConsumer<Object, FriendlyByteBuf>) messageRegistration.getEncodeFunc());
}, it -> {
if (entry instanceof ServerboundMessageRegistration<?> serverboundMessageRegistration) {
if (messageRegistration instanceof ServerboundMessageRegistration<?> serverboundMessageRegistration) {
it.server((payload, context) -> context.workHandler().execute(() -> {
replyHandler = context.replyHandler();
handleServerboundPacket(serverboundMessageRegistration, payload, context);
replyHandler = null;
}));
} else if (entry instanceof ClientboundMessageRegistration<?> clientboundMessageRegistration) {
} else if (messageRegistration instanceof ClientboundMessageRegistration<?> clientboundMessageRegistration) {
it.client(((payload, context) -> context.workHandler().execute(() -> {
replyHandler = context.replyHandler();
handleClientboundPacket(clientboundMessageRegistration, payload, context);
Expand Down

0 comments on commit ecbb9e2

Please sign in to comment.