@Override public void addProbeInfo( AEBaseTile tile, ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data ) { if( tile instanceof TileCraftingMonitorTile ) { final TileCraftingMonitorTile monitor = (TileCraftingMonitorTile) tile; final IAEItemStack displayStack = monitor.getJobProgress(); if( displayStack != null ) { // TODO: check if OK final ItemStack itemStack = displayStack.asItemStackRepresentation(); final String itemName = itemStack.getDisplayName(); final String formattedCrafting = String.format( TheOneProbeText.CRAFTING.getLocal(), itemName ); final IProbeInfo centerAlignedHorizontalLayout = probeInfo .horizontal( probeInfo.defaultLayoutStyle().alignment( ElementAlignment.ALIGN_CENTER ) ); centerAlignedHorizontalLayout.item( itemStack ); centerAlignedHorizontalLayout.text( formattedCrafting ); } } }
@Override public void addProbeInfo( AEBaseTile tile, ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data ) { if( tile instanceof TileCharger ) { final TileCharger charger = (TileCharger) tile; final IItemHandler chargerInventory = charger.getInternalInventory(); final ItemStack chargingItem = chargerInventory.getStackInSlot( 0 ); if( !chargingItem.isEmpty() ) { final String currentInventory = chargingItem.getDisplayName(); final IProbeInfo centerAlignedHorizontalLayout = probeInfo .horizontal( probeInfo.defaultLayoutStyle().alignment( ElementAlignment.ALIGN_CENTER ) ); centerAlignedHorizontalLayout.item( chargingItem ); centerAlignedHorizontalLayout.text( currentInventory ); } } }
@SuppressWarnings("unused") public ILayoutStyle right() { return probeinfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_BOTTOMRIGHT); }
public ILayoutStyle center() { return probeinfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER); }
private void showMobSpawnerInfo(IProbeInfo probeInfo, World world, IProbeHitData data, Block block) { if (block instanceof BlockMobSpawner) { TileEntity te = world.getTileEntity(data.getPos()); if (te instanceof TileEntityMobSpawner) { MobSpawnerBaseLogic logic = ((TileEntityMobSpawner) te).getSpawnerBaseLogic(); String mobName = logic.getCachedEntity().getName(); probeInfo.horizontal(probeInfo.defaultLayoutStyle() .alignment(ElementAlignment.ALIGN_CENTER)) .text(LABEL + "Mob: " + INFO + mobName); } } }
@Override protected void addProbeInfo(IWorkable capability, IProbeInfo probeInfo, TileEntity tileEntity, EnumFacing sideHit) { int currentProgress = capability.getProgress(); int maxProgress = capability.getMaxProgress(); if(maxProgress > 0) { int progressScaled = maxProgress == 0 ? 0 : (int) Math.floor(currentProgress / (maxProgress * 1.0) * 100); IProbeInfo horizontalPane = probeInfo.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)); horizontalPane.text(TextStyleClass.INFO + "{*gregtech.top.progress*} "); horizontalPane.progress(progressScaled, 100, probeInfo.defaultProgressStyle() .suffix("%") .borderColor(0x00000000) .backgroundColor(0x00000000) .filledColor(0xFF000099) .alternateFilledColor(0xFF000077)); } if(!capability.isWorkingEnabled()) { probeInfo.text(TextStyleClass.INFOIMP + "{*gregtech.top.working_disabled*}"); } } }
int dim = v ? 13 : 16; ILayoutStyle alignment = probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER); IIconStyle iconStyle = probeInfo.defaultIconStyle().width(v ? 18 : 20).height(v ? 14 : 16).textureWidth(32).textureHeight(32); IProbeInfo horizontal = probeInfo.horizontal(alignment);
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"); } } } }
@Override protected void addProbeInfo(IEnergyContainer capability, IProbeInfo probeInfo, TileEntity tileEntity, EnumFacing sideHit) { long energyStored = capability.getEnergyStored(); long maxStorage = capability.getEnergyCapacity(); if(maxStorage == 0) return; //do not add empty max storage progress bar IProbeInfo horizontalPane = probeInfo.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)); String additionalSpacing = tileEntity.hasCapability(GregtechCapabilities.CAPABILITY_WORKABLE, sideHit) ? " " : ""; horizontalPane.text(TextStyleClass.INFO + "{*gregtech.top.energy_stored*} " + additionalSpacing); horizontalPane.progress(energyStored, maxStorage, probeInfo.defaultProgressStyle() .suffix("/" + maxStorage + " EU") .borderColor(0x00000000) .backgroundColor(0x00000000) .filledColor(0xFFFFE000) .alternateFilledColor(0xFFEED000)); }
public static void showStandardInfo(ProbeMode mode, IProbeInfo probeInfo, Entity entity, IProbeConfig config) { String modid = Tools.getModName(entity); if (Tools.show(mode, config.getShowModName())) { probeInfo.horizontal() .entity(entity) .vertical() .text(NAME + entity.getDisplayName().getFormattedText()) .text(MODNAME + modid); } else { probeInfo.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)) .entity(entity) .text(NAME + entity.getDisplayName().getFormattedText()); } } }
.text(MODNAME + modid); } else { probeInfo.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER)) .item(pickBlock) .itemLabel(pickBlock);