From 6c3b820cb4343b498e20072cd14545368ddfd2f4 Mon Sep 17 00:00:00 2001 From: Cedric Date: Mon, 6 Nov 2023 16:38:30 +0100 Subject: [PATCH] ref: changed Debug Outputs --- src/main/java/com/troblecodings/signals/blocks/Signal.java | 3 +++ .../signals/handler/ClientSignalStateHandler.java | 2 -- .../com/troblecodings/signals/handler/SignalStateHandler.java | 3 +++ 3 files changed, 6 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 1fb6a41fd..67cdc02b1 100644 --- a/src/main/java/com/troblecodings/signals/blocks/Signal.java +++ b/src/main/java/com/troblecodings/signals/blocks/Signal.java @@ -185,6 +185,9 @@ public IBlockState getExtendedState(final IBlockState state, final IBlockAccess final Map 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(); diff --git a/src/main/java/com/troblecodings/signals/handler/ClientSignalStateHandler.java b/src/main/java/com/troblecodings/signals/handler/ClientSignalStateHandler.java index 0c7921000..41b68118d 100644 --- a/src/main/java/com/troblecodings/signals/handler/ClientSignalStateHandler.java +++ b/src/main/java/com/troblecodings/signals/handler/ClientSignalStateHandler.java @@ -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); @@ -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 + "]!"); }); } diff --git a/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java b/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java index 9a8ac664f..da0bdd84b 100644 --- a/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java +++ b/src/main/java/com/troblecodings/signals/handler/SignalStateHandler.java @@ -348,6 +348,8 @@ private static void sendTo(final SignalStateInfo info, final Map 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)); @@ -356,6 +358,7 @@ private static void sendToPlayer(final SignalStateInfo stateInfo, private static void sendToAll(final SignalStateInfo stateInfo, final Map 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);