/** * Draws the fuel tooltip */ protected void drawFuelTooltip(int mouseX, int mouseY) { List<String> text = Lists.newArrayList(); FluidStack fuel = fuelInfo.fluid; text.add(TextFormatting.WHITE + Util.translate("gui.smeltery.fuel")); if(fuel != null) { if(TinkerRegistry.isSmelteryFuel(fuel)) { text.add(fuel.getLocalizedName()); GuiUtil.liquidToString(fuel, text); text.add(Util.translateFormatted("gui.smeltery.fuel.heat", fuelInfo.heat)); } else { text.add(Util.translateFormatted("gui.smeltery.fuel.invalid", fuel.getLocalizedName())); } } else { text.add(Util.translate("gui.smeltery.fuel.empty")); } this.drawHoveringText(text, mouseX, mouseY); } }
private boolean hasTankWithFuel(BlockPos pos, FluidStack preference) { IFluidTank tank = getTankAt(pos); if(tank != null && tank.getFluid() != null) { if(tank.getFluidAmount() > 0 && TinkerRegistry.isSmelteryFuel(tank.getFluid())) { // if we have a preference, only use that if(preference != null && tank.getFluid().isFluidEqual(preference)) { return true; } else if(preference == null) { return true; } } } return false; }
@BasicObjectMethod.Inject( value = TileHeatingStructureFuelTank.class, modId = TConstruct.modID, doc = "function():table -- Get a list of all fuels currently used by the seared-bricks multiblock." ) public static Object[] getFuels(IContext<TileHeatingStructureFuelTank> context, Object[] args) { TileHeatingStructureFuelTank<?> structure = context.getTarget(); Map<Integer, Object> result = new HashMap<>(); int i = 0; for (BlockPos pos : structure.tanks) { TileEntity te = getRelatedTile(structure, pos); if (!(te instanceof TileTank)) continue; IFluidTank internal = ((TileTank) te).getInternalTank(); if (internal != null && internal.getFluid() != null && TinkerRegistry.isSmelteryFuel(internal.getFluid())) { result.put(++i, context.makePartialChild(internal).getMeta()); } } return new Object[]{result}; }