Use type safe base method to add information to the tooltip
This commit is contained in:
@@ -367,11 +367,11 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips)
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
super.addInformation( is, player, lines, advancedItemTooltips );
|
||||
super.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
if ( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
|
||||
@@ -72,11 +72,11 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips)
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
super.addInformation( is, player, lines, advancedItemTooltips );
|
||||
super.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
if ( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
|
||||
@@ -56,11 +56,11 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips)
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
super.addInformation( is, player, lines, advancedItemTooltips );
|
||||
super.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
if ( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
|
||||
@@ -48,25 +48,25 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack i, EntityPlayer p, List l, boolean b)
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
super.addInformation( i, p, l, b );
|
||||
super.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
|
||||
if ( i.hasTagCompound() )
|
||||
if ( stack.hasTagCompound() )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( i );
|
||||
NBTTagCompound tag = Platform.openNbtData( stack );
|
||||
if ( tag != null )
|
||||
{
|
||||
String encKey = tag.getString( "encryptionKey" );
|
||||
|
||||
if ( encKey == null || encKey.equals( "" ) )
|
||||
l.add( GuiText.Unlinked.getLocal() );
|
||||
lines.add( GuiText.Unlinked.getLocal() );
|
||||
else
|
||||
l.add( GuiText.Linked.getLocal() );
|
||||
lines.add( GuiText.Linked.getLocal() );
|
||||
}
|
||||
}
|
||||
else
|
||||
l.add( StatCollector.translateToLocal( "AppEng.GuiITooltip.Unlinked" ) );
|
||||
lines.add( StatCollector.translateToLocal( "AppEng.GuiITooltip.Unlinked" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,11 +32,11 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List lines, boolean advancedItemTooltips)
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
NBTTagCompound tag = is.getTagCompound();
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
double internalMaxPower = getAEMaxPower( is );
|
||||
double internalMaxPower = getAEMaxPower( stack );
|
||||
|
||||
if ( tag != null )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user