Skip to content

Commit

Permalink
Fix NPE caused by client-side CUI packets
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Feb 27, 2024
1 parent b2f55cf commit 495e592
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public static void init() {
}

public static void onPacketData(CustomPayloadEvent event) {
if (event.getSource().isClientSide()) {
// Ignore client-side packets
return;
}
ServerPlayer player = event.getSource().getSender();
LocalSession session = ForgeWorldEdit.inst.getSession(player);
String text = event.getPayload().toString(StandardCharsets.UTF_8);
Expand Down

0 comments on commit 495e592

Please sign in to comment.