use of blusunrize.immersiveengineering.common.blocks.wooden.TileEntityWoodenBarrel in project ImmersiveEngineering by BluSunrize.
the class IEWailaDataProvider method getWailaBody.
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
Block b = accessor.getBlock();
TileEntity tile = accessor.getTileEntity();
if (b instanceof BlockIECrop) {
int meta = accessor.getMetadata();
int min = ((BlockIECrop) b).getMinMeta(meta);
int max = ((BlockIECrop) b).getMaxMeta(meta);
if (min == max)
currenttip.add(String.format("%s : %s", I18n.format("hud.msg.growth"), I18n.format("hud.msg.mature")));
else {
float growth = ((meta - min) / (float) (max - min)) * 100f;
if (growth < 100.0)
currenttip.add(String.format("%s : %.0f %%", I18n.format("hud.msg.growth"), growth));
else
currenttip.add(String.format("%s : %s", I18n.format("hud.msg.growth"), I18n.format("hud.msg.mature")));
}
return currenttip;
} else if (tile instanceof TileEntityWoodenBarrel) {
NBTTagCompound tank = accessor.getNBTData().getCompoundTag("tank");
if (!tank.hasKey("Empty") && !tank.hasNoTags()) {
FluidStack fluid = FluidStack.loadFluidStackFromNBT(tank);
currenttip.add(String.format("%s: %d / %d mB", fluid.getLocalizedName(), Integer.valueOf(fluid.amount), 12000));
} else
currenttip.add(I18n.format("hud.msg.empty"));
}
if (accessor.getNBTData().hasKey("Energy")) {
int cur = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
int max = accessor.getNBTInteger(accessor.getNBTData(), "MaxStorage");
if (max > 0 && ((ITaggedList) currenttip).getEntries("IFEnergyStorage").size() == 0)
((ITaggedList) currenttip).add(String.format("%d / %d IF", new Object[] { cur, max }), "IFEnergyStorage");
if (tile instanceof TileEntityTeslaCoil) {
boolean rsInv = accessor.getNBTData().getBoolean("redstoneInverted");
boolean lowPower = accessor.getNBTData().getBoolean("lowPower");
currenttip.add(I18n.format(Lib.CHAT_INFO + "rsControl." + (rsInv ? "invertedOn" : "invertedOff")));
currenttip.add(I18n.format(Lib.CHAT_INFO + "tesla." + (lowPower ? "lowPower" : "highPower")));
}
}
return currenttip;
}
Aggregations