Fixed Java 6 incompatibility.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package appeng.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
@@ -67,6 +69,19 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
switchingGuis = false;
|
||||
}
|
||||
|
||||
protected int getQty(GuiButton btn)
|
||||
{
|
||||
try
|
||||
{
|
||||
DecimalFormat df = new DecimalFormat("+#;-#");
|
||||
return df.parse( btn.displayString ).intValue();
|
||||
}
|
||||
catch(ParseException e )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isSubGui()
|
||||
{
|
||||
return subGui;
|
||||
|
||||
@@ -133,11 +133,6 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
addQty( getQty( btn ) );
|
||||
}
|
||||
|
||||
private int getQty(GuiButton btn)
|
||||
{
|
||||
return Integer.parseInt( btn.displayString );
|
||||
}
|
||||
|
||||
private void addQty(int i)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -102,11 +102,6 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
addQty( getQty( btn ) );
|
||||
}
|
||||
|
||||
private int getQty(GuiButton btn)
|
||||
{
|
||||
return Integer.parseInt( btn.displayString );
|
||||
}
|
||||
|
||||
private void addQty(long i)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -136,11 +136,6 @@ public class GuiPriority extends AEBaseGui
|
||||
addQty( getQty( btn ) );
|
||||
}
|
||||
|
||||
private int getQty(GuiButton btn)
|
||||
{
|
||||
return Integer.parseInt( btn.displayString );
|
||||
}
|
||||
|
||||
private void addQty(int i)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user