Compare commits

...

2 Commits

@ -1,6 +1,7 @@
package net.brokenmoon.redcontrol.blocks; package net.brokenmoon.redcontrol.blocks;
import com.simon816.j65el02.device.RedBus; import com.simon816.j65el02.device.RedBus;
import net.brokenmoon.redcontrol.RedControl;
import net.brokenmoon.redcontrol.api.RCWorldBus; import net.brokenmoon.redcontrol.api.RCWorldBus;
import net.brokenmoon.redcontrol.blockentities.Peripheral; import net.brokenmoon.redcontrol.blockentities.Peripheral;
import net.brokenmoon.redcontrol.mixin.RedBusAccessor; import net.brokenmoon.redcontrol.mixin.RedBusAccessor;
@ -87,15 +88,17 @@ public abstract class NetworkCarrier extends BlockWithEntity implements BlockEnt
@Override @Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
if (!world.isClient) { if (!world.isClient) {
Peripheral peripheral = (Peripheral) world.getBlockEntity(pos); if (player.getStackInHand(hand).getItem() == RedControl.SQUEAKY_HAMMER) {
player.sendMessage(Text.literal("Network Carrier Debug: "), false); Peripheral peripheral = (Peripheral) world.getBlockEntity(pos);
player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().hashCode())), false); player.sendMessage(Text.literal("Network Carrier Debug: "), false);
player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().getRedBus().hashCode())), false); player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().hashCode())), false);
player.sendMessage(Text.literal(" Peripherals on RedBus: "), false); player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().getRedBus().hashCode())), false);
RedBus.Peripheral[] peripherals = ((RedBusAccessor)peripheral.getBus().getRedBus()).getPeripherals(); player.sendMessage(Text.literal(" Peripherals on RedBus: "), false);
for (RedBus.Peripheral value : peripherals) { RedBus.Peripheral[] peripherals = ((RedBusAccessor) peripheral.getBus().getRedBus()).getPeripherals();
if (value != null) { for (RedBus.Peripheral value : peripherals) {
player.sendMessage(Text.literal(" " + value.getClass().toString()), false); if (value != null) {
player.sendMessage(Text.literal(" " + value.getClass().toString()), false);
}
} }
} }
} }

@ -0,0 +1,6 @@
{
"item.redcontrol.squeaky_hammer": "Squeaky Hammer",
"block.redcontrol.cpu": "Central Processing Unit",
"block.redcontrol.disk_drive": "Disk drive",
"block.redcontrol.monitor": "Monitor"
}
Loading…
Cancel
Save