Skip to content

Commit

Permalink
ref: added more debugging stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Nov 12, 2023
1 parent 420c378 commit 0c9e65f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/troblecodings/signals/blocks/Signal.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ public IBlockState getExtendedState(final IBlockState state, final IBlockAccess
? ClientSignalStateHandler.getClientStates(new StateInfo(info.world, info.pos))
: SignalStateHandler.getStates(info);
if (properties.isEmpty()) {
System.out.println(
"PropertiesMap for [" + pos + "] is empty! Printing Tile... [" + tile + "]");
System.out.println("PropertiesMap for [" + pos + "] is empty! Printing Tile... [" + tile
+ "]. Is State on Client loaded: "
+ ClientSignalStateHandler.containsState(new StateInfo(info.world, info.pos))
+ "!");
}
properties.forEach((property, value) -> blockState
.getAndUpdate(oldState -> oldState.withProperty(property, value)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public static final Map<SEProperty, String> getClientStates(final StateInfo info
}
}

// TODO Only for debugging
public static boolean containsState(final StateInfo info) {
synchronized (CURRENTLY_LOADED_STATES) {
return CURRENTLY_LOADED_STATES.containsKey(info);
}
}

@Override
public void deserializeClient(final ByteBuffer buf) {
final ReadBuffer buffer = new ReadBuffer(buf);
Expand Down

0 comments on commit 0c9e65f

Please sign in to comment.