From 0c9e65f0f05bf6ce80fa7c61918bdf88cb188a3b Mon Sep 17 00:00:00 2001 From: Cedric Date: Sun, 12 Nov 2023 10:39:57 +0100 Subject: [PATCH] ref: added more debugging stuff --- src/main/java/com/troblecodings/signals/blocks/Signal.java | 6 ++++-- .../signals/handler/ClientSignalStateHandler.java | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/troblecodings/signals/blocks/Signal.java b/src/main/java/com/troblecodings/signals/blocks/Signal.java index a7c5adc3c..80e32b4c2 100644 --- a/src/main/java/com/troblecodings/signals/blocks/Signal.java +++ b/src/main/java/com/troblecodings/signals/blocks/Signal.java @@ -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))); diff --git a/src/main/java/com/troblecodings/signals/handler/ClientSignalStateHandler.java b/src/main/java/com/troblecodings/signals/handler/ClientSignalStateHandler.java index 41b68118d..7f5d8d08c 100644 --- a/src/main/java/com/troblecodings/signals/handler/ClientSignalStateHandler.java +++ b/src/main/java/com/troblecodings/signals/handler/ClientSignalStateHandler.java @@ -30,6 +30,13 @@ public static final Map 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);