reformatted all src files (#141)

This commit is contained in:
YoungOnion
2022-09-17 05:08:02 -06:00
committed by GitHub
parent 3328bfcda2
commit 9011273229
1056 changed files with 88127 additions and 110597 deletions
@@ -23,41 +23,30 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiTextField;
public class GuiNumberBox extends GuiTextField
{
public class GuiNumberBox extends GuiTextField {
private final Class type;
private final Class type;
public GuiNumberBox( final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type )
{
super( 0, fontRenderer, x, y, width, height );
this.type = type;
}
public GuiNumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type) {
super(0, fontRenderer, x, y, width, height);
this.type = type;
}
@Override
public void writeText( final String selectedText )
{
final String original = this.getText();
super.writeText( selectedText );
@Override
public void writeText(final String selectedText) {
final String original = this.getText();
super.writeText(selectedText);
try
{
if( this.type == int.class || this.type == Integer.class )
{
Integer.parseInt( this.getText() );
}
else if( this.type == long.class || this.type == Long.class )
{
Long.parseLong( this.getText() );
}
else if( this.type == double.class || this.type == Double.class )
{
Double.parseDouble( this.getText() );
}
}
catch( final NumberFormatException e )
{
this.setText( original );
}
}
try {
if (this.type == int.class || this.type == Integer.class) {
Integer.parseInt(this.getText());
} else if (this.type == long.class || this.type == Long.class) {
Long.parseLong(this.getText());
} else if (this.type == double.class || this.type == Double.class) {
Double.parseDouble(this.getText());
}
} catch (final NumberFormatException e) {
this.setText(original);
}
}
}