reformatted all src files (#141)
This commit is contained in:
@@ -19,88 +19,75 @@
|
||||
package appeng.client.gui;
|
||||
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
public abstract class AEBaseMEGui extends AEBaseGui
|
||||
{
|
||||
public abstract class AEBaseMEGui extends AEBaseGui {
|
||||
|
||||
public AEBaseMEGui( final Container container )
|
||||
{
|
||||
super( container );
|
||||
}
|
||||
public AEBaseMEGui(final Container container) {
|
||||
super(container);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderToolTip( final ItemStack stack, final int x, final int y )
|
||||
{
|
||||
final Slot s = this.getSlot( x, y );
|
||||
@Override
|
||||
protected void renderToolTip(final ItemStack stack, final int x, final int y) {
|
||||
final Slot s = this.getSlot(x, y);
|
||||
|
||||
if( s instanceof SlotME && !stack.isEmpty() )
|
||||
{
|
||||
final int bigNumber = AEConfig.instance().useTerminalUseLargeFont() ? 999 : 9999;
|
||||
if (s instanceof SlotME && !stack.isEmpty()) {
|
||||
final int bigNumber = AEConfig.instance().useTerminalUseLargeFont() ? 999 : 9999;
|
||||
|
||||
IAEItemStack myStack = null;
|
||||
final List<String> currentToolTip = this.getItemToolTip( stack );
|
||||
IAEItemStack myStack = null;
|
||||
final List<String> currentToolTip = this.getItemToolTip(stack);
|
||||
|
||||
try
|
||||
{
|
||||
final SlotME theSlotField = (SlotME) s;
|
||||
myStack = theSlotField.getAEStack();
|
||||
}
|
||||
catch( final Throwable ignore )
|
||||
{
|
||||
}
|
||||
try {
|
||||
final SlotME theSlotField = (SlotME) s;
|
||||
myStack = theSlotField.getAEStack();
|
||||
} catch (final Throwable ignore) {
|
||||
}
|
||||
|
||||
if( myStack != null )
|
||||
{
|
||||
if( myStack.getStackSize() > bigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) )
|
||||
{
|
||||
final String local = ButtonToolTips.ItemsStored.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance( Locale.US ).format( myStack.getStackSize() );
|
||||
final String format = String.format( local, formattedAmount );
|
||||
if (myStack != null) {
|
||||
if (myStack.getStackSize() > bigNumber || (myStack.getStackSize() > 1 && stack.isItemDamaged())) {
|
||||
final String local = ButtonToolTips.ItemsStored.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(myStack.getStackSize());
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add( TextFormatting.GRAY + format );
|
||||
}
|
||||
currentToolTip.add(TextFormatting.GRAY + format);
|
||||
}
|
||||
|
||||
if( myStack.getCountRequestable() > 0 )
|
||||
{
|
||||
final String local = ButtonToolTips.ItemsRequestable.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance( Locale.US ).format( myStack.getCountRequestable() );
|
||||
final String format = String.format( local, formattedAmount );
|
||||
if (myStack.getCountRequestable() > 0) {
|
||||
final String local = ButtonToolTips.ItemsRequestable.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(myStack.getCountRequestable());
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add( format );
|
||||
}
|
||||
currentToolTip.add(format);
|
||||
}
|
||||
|
||||
this.drawHoveringText( currentToolTip, x, y, this.fontRenderer );
|
||||
this.drawHoveringText(currentToolTip, x, y, this.fontRenderer);
|
||||
|
||||
return;
|
||||
}
|
||||
else if( stack.getCount() > bigNumber )
|
||||
{
|
||||
final String local = ButtonToolTips.ItemsStored.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance( Locale.US ).format( stack.getCount() );
|
||||
final String format = String.format( local, formattedAmount );
|
||||
return;
|
||||
} else if (stack.getCount() > bigNumber) {
|
||||
final String local = ButtonToolTips.ItemsStored.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.getCount());
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add( TextFormatting.GRAY + format );
|
||||
currentToolTip.add(TextFormatting.GRAY + format);
|
||||
|
||||
this.drawHoveringText( currentToolTip, x, y, this.fontRenderer );
|
||||
this.drawHoveringText(currentToolTip, x, y, this.fontRenderer);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
super.renderToolTip( stack, x, y );
|
||||
}
|
||||
super.renderToolTip(stack, x, y);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user