@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 TileCasting) { TileCasting casting = (TileCasting) te; ItemStack output = casting.getCurrentResult(); if(output != null) { probeInfo.horizontal().text(Util.translateFormatted("gui.waila.casting.recipe", output.getDisplayName())); } } } }
@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 IProgress) { IProgress progressTe = (IProgress) te; float progress = progressTe.getProgress(); if(progress > 0f) { probeInfo.horizontal().progress((int)(progress*100f), 100, probeInfo.defaultProgressStyle().suffix("%")); } } } }
@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 ); } } }
public void finish() { if (eiobox != null) { if (addMoreIndicator) { addIcon(addIcon(get().horizontal(center()), IconEIO.TOP_NOICON, 0), IconEIO.TOP_MORE, 0); } else { addIcon(addIcon(get().horizontal(center()), IconEIO.TOP_NOICON, 0), IconEIO.TOP_NOMORE, 0); } } else if (addMoreIndicator) { addIcon(addIcon(probeinfo.vertical().horizontal(center()), IconEIO.TOP_NOICON_WIDE, 0), IconEIO.TOP_MORE, 0); } } }
private void mkNotificationLine(ProbeMode mode, EioBox eiobox, TOPData data) { if (data.notifications != null && !data.notifications.isEmpty()) { IProbeInfo vertical = addIcon(eiobox.get().horizontal(eiobox.center()), IconEIO.REDSTONE_MODE_NEVER) .vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1)); for (ILocalizable notification : data.notifications) { vertical.text(locRaw(notification.getUnlocalizedName())); } } }
private void mkPaint(ProbeMode mode, EioBox eiobox, TOPData data) { if (data.isPainted) { IProbeInfo info = eiobox.get().horizontal(eiobox.center()).item(new ItemStack(Items.PAINTING)) .vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1)).text(loc("top.paint.header")); // ItemStack.getDisplayName() should be run on the client, but I don't think we have a way to get the stack there if (Prep.isValid(data.paint2)) { info.horizontal(eiobox.center()).item(data.paint2).text(data.paint2.getDisplayName()); } if (Prep.isValid(data.paint1)) { info.horizontal(eiobox.center()).item(data.paint1).text(data.paint1.getDisplayName()); } } }
@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 DataTileEntity) { DataTileEntity dataTileEntity = (DataTileEntity) te; probeInfo.horizontal() .item(new ItemStack(Items.CLOCK)) .text(TextFormatting.GREEN + STARTLOC + "message.modtut.counter" + ENDLOC + " " + dataTileEntity.getCounter()); probeInfo.horizontal(probeInfo.defaultLayoutStyle().borderColor(0xffff0000)) .entity("minecraft:horse") .progress(dataTileEntity.getCounter() % 100, 100, probeInfo.defaultProgressStyle().suffix("%")); } }
@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); } }
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); } } }
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()); } } }
private void mkRangeLine(ProbeMode mode, EioBox eiobox, TOPData data) { if (data.hasRange) { if (mode != ProbeMode.NORMAL || TopConfig.showRangeByDefault.get()) { int sizeX = (int) data.bounds.sizeX(); int sizeY = (int) data.bounds.sizeY(); int sizeZ = (int) data.bounds.sizeZ(); addIcon(eiobox.get().horizontal(eiobox.center()), IconEIO.SHOW_RANGE) .text(loc("top.range.header", EnderIO.lang.localize("top.range", sizeX, sizeY, sizeZ))); } else { eiobox.addMore(); } } }
private void mkRedstoneLine(ProbeMode mode, EioBox eiobox, TOPData data) { if (data.hasRedstone) { if (mode != ProbeMode.NORMAL || TopConfig.showRedstoneByDefault.get()) { addIcon(eiobox.get().horizontal(eiobox.center()), data.redstoneIcon).vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1)) .text(loc(data.redstoneTooltip)).text(loc("top.redstone.header", loc("top.redstone." + data.redstoneControlStatus))); } else { eiobox.addMore(); } } }
private void mkItemFillLevelLine(ProbeMode mode, EioBox eiobox, TOPData data) { if (data.hasItemFillLevel) { if (mode != ProbeMode.NORMAL || TopConfig.showItemCountDefault.get()) { eiobox.get().horizontal(eiobox.center()).item(new ItemStack(Blocks.CHEST)).progress(data.fillCur, data.fillMax, eiobox.getProbeinfo().defaultProgressStyle().suffix(EnderIO.lang.localize("top.suffix.items")).filledColor(0xfff8f83c) .alternateFilledColor(0xffcfac0b).borderColor(0xffcfac0b)); } else { eiobox.addMore(); } } }
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 mkSideConfigLine(ProbeMode mode, EioBox eiobox, TOPData data) { if (data.hasIOMode) { if (mode != ProbeMode.NORMAL || TopConfig.showSideConfigByDefault.get()) { addIcon(eiobox.get().horizontal(eiobox.center()), IconEIO.IO_CONFIG_UP).vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1)) .text(TextFormatting.YELLOW + loc("top.machine.side", TextFormatting.WHITE + loc("top.machine.side." + data.sideName))) .text(TextFormatting.YELLOW + loc("top.machine.ioMode", loc(data.ioMode.getColorerUnlocalizedName()))); } else { eiobox.addMore(); } } }
@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)); }
private void mkXPLine(ProbeMode mode, EioBox eiobox, TOPData data) { if (data.hasXP) { if (mode != ProbeMode.NORMAL || TopConfig.showXPByDefault.get()) { // We need to put the number of levels in as "current" value for it to be displayed as text. To make the progress bar scale to the partial level, we set // the "max" value in a way that is in the same ratio to the number of levels as the xp needed for the next level is to the current xp. If the bar // should be empty but we do have at least one level in, there will be a small error, as (levels/Integer.MAX_VALUE) > 0. int scalemax = data.xpBarScaled > 0 ? data.experienceLevel * 100 / data.xpBarScaled : Integer.MAX_VALUE; eiobox.get().horizontal(eiobox.center()).item(new ItemStack(Items.EXPERIENCE_BOTTLE)).progress(data.experienceLevel, scalemax, eiobox.getProbeinfo().defaultProgressStyle().suffix(EnderIO.lang.localize("top.suffix.levels")).filledColor(0xff00FF0F) .alternateFilledColor(0xff00AA0A).borderColor(0xff00AA0A)); } else { eiobox.addMore(); } } }
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"); } } }
private void mkOwner(ProbeMode mode, EioBox eiobox, TOPData data) { if (mode == ProbeMode.DEBUG && data.owner != null) { ItemStack skull = new ItemStack(Items.SKULL, 1, 3); NBTTagCompound nbt = new NBTTagCompound(); nbt.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), data.owner.getAsGameProfile())); skull.setTagCompound(nbt); eiobox.get().horizontal(eiobox.center()).item(skull).vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1)).text(loc("top.owner.header")) .text(data.owner.getPlayerName()); } }