Skip to content

Commit

Permalink
ref: added more debug stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Nov 12, 2023
1 parent 0c9e65f commit a037fdd
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ private static void sendTo(final SignalStateInfo info, final Map<SEProperty, Str
private static void sendToPlayer(final SignalStateInfo stateInfo,
final Map<SEProperty, String> properties, final EntityPlayer player) {
if (properties == null || properties.isEmpty()) {
System.out.println("Tried to send empty PropertiesMap on [" + stateInfo
+ "] to Player [" + player + "]! Printing StackTrace...");
for (final StackTraceElement e : Thread.currentThread().getStackTrace()) {
System.out.println(e);
}
return;
}
sendTo(player, packToByteBuffer(stateInfo, properties));
Expand All @@ -349,7 +354,11 @@ private static void sendToPlayer(final SignalStateInfo stateInfo,
private static void sendToAll(final SignalStateInfo stateInfo,
final Map<SEProperty, String> properties) {
if (properties == null || properties.isEmpty()) {
return;
System.out.println("Tried to send empty PropertiesMap on [" + stateInfo
+ "] to all! Printing StackTrace...");
for (final StackTraceElement e : Thread.currentThread().getStackTrace()) {
System.out.println(e);
}
}
final ByteBuffer buffer = packToByteBuffer(stateInfo, properties);
stateInfo.world.playerEntities.forEach(player -> sendTo(player, buffer));
Expand Down

0 comments on commit a037fdd

Please sign in to comment.