Skip to content

Commit a0fbb90

Browse files
committed
Don't send packets to mocked game test players
1 parent f243ec1 commit a0fbb90

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

loader-neoforge/src/main/java/org/cyclops/cyclopscore/network/PacketHandlerNeoForge.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ public void sendToServer(PacketBase packet) {
9696

9797
@Override
9898
public void sendToPlayer(PacketBase packet, ServerPlayer player) {
99-
PacketDistributor.sendToPlayer(player, packet);
99+
if (!player.getProfile().name().orElse("missing").equals("test-mock-player")) {
100+
// Don't send packets to the mock player, as it is not a real player and will throw exceptions.
101+
PacketDistributor.sendToPlayer(player, packet);
102+
}
100103
}
101104

102105
@Override

0 commit comments

Comments
 (0)