Fix all warnings

Add and make use of Lombok
Remove Mojang API
Remove ZipFileUtils
Remove StreamTools in favor of Apache IOUtils
Keyframe should be abstract all derivatives final
Replace clone in Keyframe with copy
Move some constants from GuiReplaySetttings to GuiConstants
This commit is contained in:
johni0702
2015-06-29 21:45:37 +02:00
parent 3122c0a71e
commit a058497727
110 changed files with 487 additions and 1921 deletions

View File

@@ -26,7 +26,7 @@ public class GuiNumberInput extends GuiTextField {
public GuiNumberInput(int id, FontRenderer fontRenderer,
int xPos, int yPos, int width, int minimum, int maximum, int defaultValue, boolean acceptFloats) {
this(id, fontRenderer, xPos, yPos, width, new Double(minimum), new Double(maximum), new Double(defaultValue), acceptFloats);
this(id, fontRenderer, xPos, yPos, width, (double) minimum, (double) maximum, (double) defaultValue, acceptFloats);
}
@Override
@@ -42,15 +42,12 @@ public class GuiNumberInput extends GuiTextField {
} else {
val = Integer.valueOf(getText());
}
if(minimum != null && val < minimum) {
setText(acceptFloats ? minimum.toString() : new Integer((int)Math.round(minimum)).toString());
return;
}
if(maximum != null && val > maximum) {
setText(acceptFloats ? maximum.toString() : new Integer((int)Math.round(maximum)).toString());
return;
}
if(minimum != null && val < minimum) {
setText(acceptFloats ? minimum.toString() : Integer.toString((int) Math.round(minimum)));
} else if(maximum != null && val > maximum) {
setText(acceptFloats ? maximum.toString() : Integer.toString((int) Math.round(maximum)));
}
} catch(NumberFormatException e) {
setText(textBefore);
setCursorPosition(cursorPositionBefore);
@@ -81,12 +78,4 @@ public class GuiNumberInput extends GuiTextField {
}
}
public Double getPreciseValueNullable() {
try {
return Double.valueOf(getText());
} catch(Exception e) {
return null;
}
}
}