use of stevekung.mods.moreplanets.utils.blocks.BlockAdvancedTileMP in project MorePlanets by SteveKunG.
the class ItemBlockDescriptionTESR method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, @Nullable World world, List<String> list, ITooltipFlag flag) {
if (this.getBlock() instanceof IDescription) {
if (ClientUtils.isShiftKeyDown()) {
((IDescription) this.block).getDescription().addDescription(itemStack, list);
} else {
if (this.getBlock() instanceof BlockTileMP) {
TileEntity tile = ((BlockTileMP) this.getBlock()).createNewTileEntity(null, 0);
if (tile instanceof TileBaseElectricBlock) {
float powerDrawn = ((TileBaseElectricBlock) tile).storage.getMaxExtract();
if (powerDrawn > 0) {
list.add(TextFormatting.GREEN + LangUtils.translate("item_desc.powerdraw.name", EnergyDisplayHelper.getEnergyDisplayS(powerDrawn * 20)));
}
}
if (tile instanceof TileBaseUniversalElectrical) {
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("EnergyStored")) {
int power = (int) itemStack.getTagCompound().getFloat("EnergyStored");
list.add(TextFormatting.GREEN + LangUtils.translate("desc.energy_stored.name", EnergyDisplayHelper.getEnergyDisplayS(power)));
}
}
} else if (this.getBlock() instanceof BlockAdvancedTileMP) {
TileEntity tile = ((BlockAdvancedTileMP) this.getBlock()).createNewTileEntity(null, 0);
if (tile instanceof TileBaseElectricBlock) {
float powerDrawn = ((TileBaseElectricBlock) tile).storage.getMaxExtract();
if (powerDrawn > 0) {
list.add(TextFormatting.GREEN + LangUtils.translate("item_desc.powerdraw.name", EnergyDisplayHelper.getEnergyDisplayS(powerDrawn * 20)));
}
}
}
list.add(LangUtils.translate("desc.shift_info.name"));
}
}
}
use of stevekung.mods.moreplanets.utils.blocks.BlockAdvancedTileMP in project MorePlanets by SteveKunG.
the class ItemBlockDescription method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, @Nullable World world, List<String> list, ITooltipFlag flag) {
if (this.getBlock() instanceof IDescription) {
if (ClientUtils.isShiftKeyDown()) {
((IDescription) this.block).getDescription().addDescription(itemStack, list);
} else {
if (this.getBlock() instanceof BlockTileMP) {
TileEntity tile = ((BlockTileMP) this.getBlock()).createNewTileEntity(null, 0);
if (tile instanceof TileBaseElectricBlock) {
float powerDrawn = ((TileBaseElectricBlock) tile).storage.getMaxExtract();
if (powerDrawn > 0) {
list.add(TextFormatting.GREEN + LangUtils.translate("item_desc.powerdraw.name", EnergyDisplayHelper.getEnergyDisplayS(powerDrawn * 20)));
}
}
if (tile instanceof TileBaseUniversalElectrical) {
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("EnergyStored")) {
int power = (int) itemStack.getTagCompound().getFloat("EnergyStored");
list.add(TextFormatting.GREEN + LangUtils.translate("desc.energy_stored.name", EnergyDisplayHelper.getEnergyDisplayS(power)));
}
}
} else if (this.getBlock() instanceof BlockAdvancedTileMP) {
TileEntity tile = ((BlockAdvancedTileMP) this.getBlock()).createNewTileEntity(null, 0);
if (tile instanceof TileBaseElectricBlock) {
float powerDrawn = ((TileBaseElectricBlock) tile).storage.getMaxExtract();
if (powerDrawn > 0) {
list.add(TextFormatting.GREEN + LangUtils.translate("item_desc.powerdraw.name", EnergyDisplayHelper.getEnergyDisplayS(powerDrawn * 20)));
}
}
}
list.add(LangUtils.translate("desc.shift_info.name"));
}
}
}
Aggregations