Skip to content

Commit

Permalink
ref: changed Debug Outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Nov 6, 2023
1 parent 252017f commit 6c3b820
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/troblecodings/signals/blocks/Signal.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public IBlockState getExtendedState(final IBlockState state, final IBlockAccess
final Map<SEProperty, String> properties = world.isRemote
? ClientSignalStateHandler.getClientStates(new StateInfo(info.world, info.pos))
: SignalStateHandler.getStates(info);
if (properties.isEmpty()) {
System.out.println("PropertiesMap for [" + info + "] is Empty!");
}
properties.forEach((property, value) -> blockState
.getAndUpdate(oldState -> oldState.withProperty(property, value)));
return blockState.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public void deserializeClient(final ByteBuffer buf) {
properties.put(property, value);
}
CURRENTLY_LOADED_STATES.put(stateInfo, properties);
System.out.println("Added [" + stateInfo + "] to Cache with [" + properties + "]!");
}
mc.addScheduledTask(() -> {
final Chunk chunk = level.getChunkFromBlockCoords(signalPos);
Expand All @@ -75,7 +74,6 @@ public void deserializeClient(final ByteBuffer buf) {
mc.renderGlobal.notifyLightSet(signalPos);
mc.renderGlobal.notifyBlockUpdate(level, signalPos, state, state, 8);
level.notifyBlockUpdate(signalPos, state, state, 3);
System.out.println("Updated Signal with state [" + stateInfo + "]!");
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ 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 + "]!");
return;
}
sendTo(player, packToByteBuffer(stateInfo, properties));
Expand All @@ -356,6 +358,7 @@ private static void sendToPlayer(final SignalStateInfo stateInfo,
private static void sendToAll(final SignalStateInfo stateInfo,
final Map<SEProperty, String> properties) {
if (properties == null || properties.isEmpty()) {
System.out.println("Tried to send empty PropertiesMap on [" + stateInfo + "] to all!");
return;
}
final ByteBuffer buffer = packToByteBuffer(stateInfo, properties);
Expand Down

0 comments on commit 6c3b820

Please sign in to comment.