@Override public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) { probeInfo.horizontal() .item(new ItemStack(Items.REDSTONE), probeInfo.defaultItemStyle().width(14).height(14)) .text(blockState.getValue(IS_OUTPUT) ? TextFormatting.DARK_GREEN + "Output" : TextFormatting.DARK_RED + "Input"); super.addProbeInfo(mode, probeInfo, player, world, blockState, data); } }
@Override public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) { TileEntity te = world.getTileEntity(data.getPos()); if(te instanceof BaseTileEntityTunnel) { BaseTileEntityTunnel tnt = (BaseTileEntityTunnel) te; String translate = "enumfacing." + blockState.getValue(BlockBaseTunnel.MACHINE_SIDE).getName(); probeInfo.horizontal() .item(new ItemStack(Items.COMPASS), probeInfo.defaultItemStyle().width(14).height(14)) .text(TextFormatting.YELLOW + "{*" + translate + "*}" + TextFormatting.RESET); ItemStack connectedStack = tnt.getConnectedPickBlock(); if(connectedStack != null && !connectedStack.isEmpty()) { probeInfo.horizontal().item(connectedStack, probeInfo.defaultItemStyle().width(14).height(14)).itemLabel(connectedStack); } } } }
private void showRedstonePower(IProbeInfo probeInfo, World world, IBlockState blockState, IProbeHitData data, Block block, boolean showLever) { if (showLever && block instanceof BlockLever) { // We are showing the lever setting so we don't show redstone in that case return; } int redstonePower; if (block instanceof BlockRedstoneWire) { redstonePower = blockState.getValue(BlockRedstoneWire.POWER); } else { redstonePower = world.getRedstonePower(data.getPos(), data.getSideHit().getOpposite()); } if (redstonePower > 0) { probeInfo.horizontal() .item(new ItemStack(Items.REDSTONE), probeInfo.defaultItemStyle().width(14).height(14)) .text(LABEL + "Power: " + INFO + redstonePower); } }
private void showBrewingStandInfo(IProbeInfo probeInfo, World world, IProbeHitData data, Block block) { if (block instanceof BlockBrewingStand) { TileEntity te = world.getTileEntity(data.getPos()); if (te instanceof TileEntityBrewingStand) { int brewtime = ((TileEntityBrewingStand) te).getField(0); int fuel = ((TileEntityBrewingStand) te).getField(1); probeInfo.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)) .item(new ItemStack(Items.BLAZE_POWDER), probeInfo.defaultItemStyle().width(16).height(16)) .text(LABEL + "Fuel: " + INFO + fuel); if (brewtime > 0) { probeInfo.text(LABEL + "Time: " + INFO + brewtime + " ticks"); } } } }
private void showLeverSetting(IProbeInfo probeInfo, World world, IBlockState blockState, IProbeHitData data, Block block) { if (block instanceof BlockLever) { Boolean powered = blockState.getValue(BlockLever.POWERED); probeInfo.horizontal().item(new ItemStack(Items.REDSTONE), probeInfo.defaultItemStyle().width(14).height(14)) .text(LABEL + "State: " + INFO + (powered ? "On" : "Off")); } else if (block instanceof BlockRedstoneComparator) { BlockRedstoneComparator.Mode mode = blockState.getValue(BlockRedstoneComparator.MODE); probeInfo.text(LABEL + "Mode: " + INFO + mode.getName()); } else if (block instanceof BlockRedstoneRepeater) { Boolean locked = blockState.getValue(BlockRedstoneRepeater.LOCKED); Integer delay = blockState.getValue(BlockRedstoneRepeater.DELAY); probeInfo.text(LABEL + "Delay: " + INFO + delay + " ticks"); if (locked) { probeInfo.text(INFO + "Locked"); } } }