@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 TileEntityFieldProjector) { TileEntityFieldProjector tfp = (TileEntityFieldProjector) te; TileEntityFieldProjector master = tfp.getMasterProjector(); if(master == null) { return; } ItemStack crafting = master.getActiveCraftingResult(); if(!crafting.isEmpty()) { probeInfo.horizontal().text("{*top.compactmachines3.currently_crafting*}").item(crafting).itemLabel(crafting); probeInfo.horizontal().progress((int)(master.getCraftingProgressPercent() * 100), 100, probeInfo.defaultProgressStyle().suffix("%").filledColor(0xff44AA44).alternateFilledColor(0xff44AA44).backgroundColor(0xff836953)); return; } MultiblockRecipe result = MultiblockRecipes.tryCrafting(world, data.getPos(), null); if(result != null) { probeInfo.horizontal().text("{*top.compactmachines3.found_recipe_for*}").item(result.getTargetStack()).itemLabel(result.getTargetStack()); } } } }
@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); } } } }
probeInfo.horizontal().item(connectedStack).itemLabel(connectedStack);
public static void registerTopExtras() { TOPCompatibility.GetTheOneProbe.probe.registerBlockDisplayOverride((mode, probeInfo, player, world, blockState, data) -> { Block block = blockState.getBlock(); if (block == ModBlocks.facadeBlock) { String modid = XNet.MODNAME; ItemStack pickBlock = data.getPickBlock(); TileEntity te = world.getTileEntity(data.getPos()); if (te instanceof FacadeTileEntity) { pickBlock = new ItemStack(NetCableSetup.netCableBlock, 1, pickBlock.getItemDamage()); } if (!pickBlock.isEmpty()) { probeInfo.horizontal() .item(pickBlock) .vertical() .itemLabel(pickBlock) .text(MODNAME + modid); } else { probeInfo.vertical() .text(NAME + getBlockUnlocalizedName(block)) .text(MODNAME + modid); } return true; } return false; }); }