Skip to content

Commit

Permalink
ref: removed more debugging and changed Input Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Nov 6, 2023
1 parent 665452e commit 2af02cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.troblecodings.signals.blocks.BasicBlock;
import com.troblecodings.signals.blocks.Signal;
import com.troblecodings.signals.core.LoadHolder;
import com.troblecodings.signals.core.RedstoneUpdatePacket;
import com.troblecodings.signals.core.StateInfo;
import com.troblecodings.signals.core.StateLoadHolder;
import com.troblecodings.signals.enums.LinkType;
Expand Down Expand Up @@ -85,6 +86,10 @@ public boolean link(final BlockPos pos, final NBTTagCompound tag) {
(BasicBlock) block, type);
}

public void updateInput(final RedstoneUpdatePacket update) {
SignalBoxHandler.updateInput(new StateInfo(world, pos), update);
}

@Override
public void onLoad() {
grid.setPosAndWorld(pos, world);
Expand All @@ -94,13 +99,11 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void sendToAll() {
final RedstoneUpdatePacket update = new RedstoneUpdatePacket(world, pos, power,
(RedstoneInput) getBlockType());
linkedPositions.forEach(pos -> loadChunkAndGetTile(SignalBoxTileEntity.class, world, pos,
(_u1, _u2) -> SignalBoxHandler.updateInput(new StateInfo(world, pos), update)));
(tile, _u) -> tile.updateInput(update)));
linkedSignalController.forEach(pos -> {
loadChunkAndGetTile(SignalControllerTileEntity.class, world, pos,
(tile, _u) -> tile.updateFromRSInput());
Expand Down

0 comments on commit 2af02cc

Please sign in to comment.