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 5, 2023
1 parent b7faca3 commit fe1d8ae
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ public boolean equals(final Object obj) {
return Objects.equals(block, other.block) && Objects.equals(pos, other.pos)
&& state == other.state && Objects.equals(world, other.world);
}

@Override
public String toString() {
return "RedstoneUpdatePacket [world=" + world + ",pos=" + pos + ",state=" + state
+ ",block=" + block + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ 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 @@ -74,6 +75,7 @@ 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 @@ -449,7 +449,6 @@ public static void loadSignals(final List<StateLoadHolder> signals,
sendToPlayer(info.info, properties, player);
}
updateListeners(info.info, properties, ChangedState.ADDED_TO_CACHE);
System.out.println("Loaded [" + info.info + "]!");
});
});
}
Expand Down Expand Up @@ -479,7 +478,6 @@ public static void unloadSignals(final List<StateLoadHolder> signals) {
return;
createToFile(info.info, properties);
updateListeners(info.info, properties, ChangedState.REMOVED_FROM_CACHE);
System.out.println("Unloaded [" + info.info + "]!");
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ public boolean requestWay(final Point p1, final Point p2,
this.onWayAdd(way);
updateToNet(way);
});
System.out.println(
"Requested Pathway from [" + p1 + "] to [" + p2 + "]! Printing StackTrace...");
System.out.println(Thread.currentThread().getStackTrace());
System.out.println("Requested Pathway from [" + p1 + "] to [" + p2 + "]!");
return ways.isPresent();
}

Expand Down Expand Up @@ -115,6 +113,7 @@ public void updateInput(final RedstoneUpdatePacket update) {
tryBlock(nodeCopy, update.pos);
tryReset(nodeCopy, update.pos);
}
System.out.println("Updated [" + tilePos + "] with [" + update + "]!");
}

private void tryBlock(final List<SignalBoxPathway> pathways, final BlockPos pos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ public void setPathStatus(final EnumPathUsage status, final @Nullable Point poin
!status.equals(EnumPathUsage.FREE)));
option.setEntry(PathEntryType.PATHUSAGE, status);
}, point);
System.out.println(
"Setting PathStatus [" + status + "] on [" + this + "]! Printing StackTrace...");
System.out.println(Thread.currentThread().getStackTrace());
System.out.println("Setting PathStatus [" + status + "] on [" + this + "]!");
}

public void setPathStatus(final EnumPathUsage status) {
Expand Down Expand Up @@ -263,6 +261,7 @@ public void updatePathwaySignals() {
SignalConfig.change(new ConfigInfo(new SignalStateInfo(world, position, current),
lastSignalInfo, speed, zs2Value, type));
});
System.out.println("Updated PathwaySignals on [" + this + "]!");
}

public void resetPathway() {
Expand All @@ -276,6 +275,7 @@ private void resetFirstSignal() {
if (current == null)
return;
SignalConfig.reset(new SignalStateInfo(world, entry.getKey(), current));
System.out.println("Rested First Signal on [" + this + "]!");
});
}

Expand All @@ -286,6 +286,7 @@ private void resetOther() {
if (current == null)
return;
SignalConfig.reset(new SignalStateInfo(world, position, current));
System.out.println("Rested All Other Signals on [" + this + "]!");
});
}

Expand All @@ -297,6 +298,7 @@ public void resetPathway(final @Nullable Point point) {
this.emptyOrBroken = true;
this.isBlocked = false;
resetOther();
System.out.println("Completly Reseted [" + this + "]!");
}
}

Expand Down Expand Up @@ -324,6 +326,7 @@ public Optional<Point> tryReset(final BlockPos position) {
final SignalBoxNode node = this.mapOfResetPositions.get(position);
if (node == null) {
if (checkReverseReset(position)) {
System.out.println("Revers Reset [" + this + "]!");
return Optional.of(firstPoint);
} else {
return Optional.empty();
Expand All @@ -340,6 +343,7 @@ public Optional<Point> tryReset(final BlockPos position) {
if (atomic.get())
return Optional.empty();
this.resetPathway(point);
System.out.println("Rested [" + this + "] until [" + point + "]!");
return Optional.of(point);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ public void onLoad() {
SignalBoxHandler.readTileNBT(identifier, copy == null ? new NBTWrapper() : copy,
grid.getModeGrid());
SignalBoxHandler.loadSignals(identifier);
System.out.println("Loaded [" + identifier + "]!");
}

@Override
public void onChunkUnload() {
SignalBoxHandler.unloadSignals(new StateInfo(world, pos));
System.out.println("Unloaded [" + new StateInfo(world, pos) + "]!");
}

@Override
Expand Down

0 comments on commit fe1d8ae

Please sign in to comment.