Skip to content

Commit

Permalink
next
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan-G committed Jun 16, 2016
1 parent 84baf2d commit 60ff7f4
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 64 deletions.
2 changes: 1 addition & 1 deletion fml/src/main/java/cpw/mods/fml/client/SplashProgress.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ private void drawBar(ProgressBar b)
setColor(barColor);
drawBox((barWidth - 2) * (b.getStep() + 1) / (b.getSteps() + 1), barHeight - 2); // Step can sometimes be 0.
// progress text
String progress = "" + b.getStep() + "/" + b.getSteps();
String progress = String.valueOf(new StringBuilder().append(b.getStep()).append('/').append(b.getSteps()));
glTranslatef(((float)barWidth - 2) / 2 - fontRenderer.getStringWidth(progress), 2, 0);
setColor(fontColor);
glScalef(2, 2, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ public void keyTyped(char eventChar, int eventKey)
String validChars = "0123456789";
String before = this.textFieldValue.getText();
if (validChars.contains(String.valueOf(eventChar))
|| (!before.startsWith("-") && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-')
|| (before.charAt(0) != '-'/*startsWith("-")*/ && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-')
|| eventKey == Keyboard.KEY_BACK || eventKey == Keyboard.KEY_DELETE
|| eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END)
this.textFieldValue.textboxKeyTyped((enabled() ? eventChar : Keyboard.CHAR_NONE), eventKey);
Expand All @@ -1011,7 +1011,7 @@ public void keyTyped(char eventChar, int eventKey)
try
{
long value = Long.parseLong(textFieldValue.getText().trim());
if (value < Integer.parseInt(configElement.getMinValue().toString()) || value > Integer.parseInt(configElement.getMaxValue().toString()))
if (value < Long.parseLong(configElement.getMinValue().toString()) || value > Long.parseLong(configElement.getMaxValue().toString()))
this.isValidValue = false;
else
this.isValidValue = true;
Expand Down Expand Up @@ -1108,7 +1108,7 @@ public void keyTyped(char eventChar, int eventKey)
String validChars = "0123456789";
String before = this.textFieldValue.getText();
if (validChars.contains(String.valueOf(eventChar)) ||
(!before.startsWith("-") && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-')
(before.charAt(0) != '-'/*startsWith("-")*/ && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-')
|| (!before.contains(".") && eventChar == '.')
|| eventKey == Keyboard.KEY_BACK || eventKey == Keyboard.KEY_DELETE || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT
|| eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END)
Expand All @@ -1119,7 +1119,7 @@ public void keyTyped(char eventChar, int eventKey)
try
{
double value = Double.parseDouble(textFieldValue.getText().trim());
if (value < Double.valueOf(configElement.getMinValue().toString()) || value > Double.valueOf(configElement.getMaxValue().toString()))
if (value < Double.parseDouble(configElement.getMinValue().toString()) || value > Double.parseDouble(configElement.getMaxValue().toString()))
this.isValidValue = false;
else
this.isValidValue = true;
Expand Down Expand Up @@ -1175,7 +1175,7 @@ else if (isChanged() && !this.isValidValue)
try
{
double value = Double.parseDouble(textFieldValue.getText().trim());
if (value < Double.valueOf(configElement.getMinValue().toString()))
if (value < Double.parseDouble(configElement.getMinValue().toString()))
this.configElement.set(configElement.getMinValue());
else
this.configElement.set(configElement.getMaxValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public GuiEditArrayEntries(GuiEditArray parent, Minecraft mc, IConfigElement con
}
else if (configElement.isList() && configElement.getType().equals(ConfigGuiType.BOOLEAN))
for (Object value : currentValues)
listEntries.add(new BooleanEntry(this.owningGui, this, configElement, Boolean.valueOf(value.toString())));
listEntries.add(new BooleanEntry(this.owningGui, this, configElement, Boolean.parseBoolean(value.toString())));
else if (configElement.isList() && configElement.getType().equals(ConfigGuiType.INTEGER))
for (Object value : currentValues)
listEntries.add(new IntegerEntry(this.owningGui, this, configElement, Integer.parseInt(value.toString())));
Expand Down Expand Up @@ -134,7 +134,7 @@ protected int getSize()
public void addNewEntry(int index)
{
if (configElement.isList() && configElement.getType() == ConfigGuiType.BOOLEAN)
listEntries.add(index, new BooleanEntry(this.owningGui, this, this.configElement, Boolean.valueOf(true)));
listEntries.add(index, new BooleanEntry(this.owningGui, this, this.configElement, /*Boolean.valueOf*/(true)));
else if (configElement.isList() && configElement.getType() == ConfigGuiType.INTEGER)
listEntries.add(index, new IntegerEntry(this.owningGui, this, this.configElement, 0));
else if (configElement.isList() && configElement.getType() == ConfigGuiType.DOUBLE)
Expand Down Expand Up @@ -233,8 +233,9 @@ protected void saveListChanges()
ArrayEntry entry = (ArrayEntry) ((GuiConfig) owningGui.parentScreen).entryList.getListEntry(owningGui.slotIndex);

Object[] ao = new Object[listLength];
for (int i = 0; i < listLength; i++)
ao[i] = listEntries.get(i).getValue();
System.arraycopy(listEntries.toArray(), 0, ao, 0, listLength);
/*for (int i = 0; i < listLength; i++)
ao[i] = listEntries.get(i).getValue();*/

entry.setListFromChildScreen(ao);
}
Expand All @@ -243,32 +244,36 @@ protected void saveListChanges()
if (configElement.isList() && configElement.getType() == ConfigGuiType.BOOLEAN)
{
Boolean[] abol = new Boolean[listLength];
for (int i = 0; i < listLength; i++)
abol[i] = Boolean.valueOf(listEntries.get(i).getValue().toString());
System.arraycopy(listEntries.toArray(), 0, abol, 0, listLength);
/*for (int i = 0; i < listLength; i++)
abol[i] = Boolean.valueOf(listEntries.get(i).getValue().toString());*/

configElement.set(abol);
}
else if (configElement.isList() && configElement.getType() == ConfigGuiType.INTEGER)
{
Integer[] ai = new Integer[listLength];
for (int i = 0; i < listLength; i++)
ai[i] = Integer.valueOf(listEntries.get(i).getValue().toString());
System.arraycopy(listEntries.toArray(), 0, ai, 0, listLength);
/*for (int i = 0; i < listLength; i++)
ai[i] = Integer.valueOf(listEntries.get(i).getValue().toString());*/

configElement.set(ai);
}
else if (configElement.isList() && configElement.getType() == ConfigGuiType.DOUBLE)
{
Double[] ad = new Double[listLength];
for (int i = 0; i < listLength; i++)
ad[i] = Double.valueOf(listEntries.get(i).getValue().toString());
System.arraycopy(listEntries.toArray(), 0, ad, 0, listLength);
/*for (int i = 0; i < listLength; i++)
ad[i] = Double.valueOf(listEntries.get(i).getValue().toString());*/

configElement.set(ad);
}
else if (configElement.isList())
{
String[] as = new String[listLength];
for (int i = 0; i < listLength; i++)
as[i] = listEntries.get(i).getValue().toString();
System.arraycopy(listEntries.toArray(), 0, as, 0, listLength);
/*for (int i = 0; i < listLength; i++)
as[i] = listEntries.get(i).getValue().toString();*/

configElement.set(as);
}
Expand Down Expand Up @@ -302,7 +307,7 @@ public void keyTyped(char eventChar, int eventKey)
String validChars = "0123456789";
String before = this.textFieldValue.getText();
if (validChars.contains(String.valueOf(eventChar)) ||
(!before.startsWith("-") && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-')
(before.charAt(0) != '-'/*startsWith("-")*/ && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-')
|| (!before.contains(".") && eventChar == '.')
|| eventKey == Keyboard.KEY_BACK || eventKey == Keyboard.KEY_DELETE || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT
|| eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END)
Expand All @@ -313,7 +318,7 @@ public void keyTyped(char eventChar, int eventKey)
try
{
double value = Double.parseDouble(textFieldValue.getText().trim());
if (value < Double.valueOf(configElement.getMinValue().toString()) || value > Double.valueOf(configElement.getMaxValue().toString()))
if (value < Double.parseDouble(configElement.getMinValue().toString()) || value > Double.parseDouble(configElement.getMaxValue().toString()))
this.isValidValue = false;
else
this.isValidValue = true;
Expand All @@ -333,7 +338,7 @@ public Double getValue()
{
try
{
return Double.valueOf(this.textFieldValue.getText().trim());
return Double.parseDouble(this.textFieldValue.getText().trim());
}
catch (Throwable e)
{
Expand All @@ -359,7 +364,7 @@ public void keyTyped(char eventChar, int eventKey)
String validChars = "0123456789";
String before = this.textFieldValue.getText();
if (validChars.contains(String.valueOf(eventChar))
|| (!before.startsWith("-") && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-')
|| (before.charAt(0) != '-'/*startsWith("-")*/ && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-')
|| eventKey == Keyboard.KEY_BACK || eventKey == Keyboard.KEY_DELETE
|| eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END)
this.textFieldValue.textboxKeyTyped((owningScreen.enabled ? eventChar : Keyboard.CHAR_NONE), eventKey);
Expand Down Expand Up @@ -389,7 +394,7 @@ public Integer getValue()
{
try
{
return Integer.valueOf(this.textFieldValue.getText().trim());
return Integer.parseInt(this.textFieldValue.getText().trim());
}
catch (Throwable e)
{
Expand Down Expand Up @@ -526,7 +531,7 @@ public void mouseReleased(int index, int x, int y, int mouseEvent, int relativeX
@Override
public Object getValue()
{
return Boolean.valueOf(value);
return /*Boolean.valueOf*/(value);
}
}

Expand Down
2 changes: 1 addition & 1 deletion fml/src/main/java/cpw/mods/fml/common/Loader.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ public void computeDependencies(String dependencyString, Set<ArtifactVersion> re
}
String instruction = depparts.get(0);
String target = depparts.get(1);
boolean targetIsAll = target.startsWith("*");
boolean targetIsAll = (target.charAt(0) == '*')/*startsWith("*")*/;

// Cannot have an "all" relationship with anything except pure *
if (targetIsAll && target.length() > 1)
Expand Down
4 changes: 2 additions & 2 deletions fml/src/main/java/cpw/mods/fml/common/ZipperUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void zip(File directory, File zipfile) throws IOException
if (kid.isDirectory())
{
queue.push(kid);
name = name.endsWith("/") ? name : name + "/";
if (!name.endsWith("/")) {name +=/* name.endsWith("/") ? name : name + */"/";}
zout.putNextEntry(new ZipEntry(name));
} else
{
Expand All @@ -55,7 +55,7 @@ public static void zip(File directory, File zipfile) throws IOException
}
} finally
{
res.close();
try{res.close();}catch (IOException ex) {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ private static void processJar(File inFile, File outFile, AccessTransformer[] tr

String entryName = entry.getName();

if (entryName.endsWith(".class") && !entryName.startsWith("."))
if (entryName.endsWith(".class") && entryName.charAt(0) != '.'/*startsWith(".")*/)
{
ClassNode cls = new ClassNode();
ClassReader rdr = new ClassReader(entryData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private static void processJar(File inFile, File outFile, MarkerTransformer[] tr

String entryName = entry.getName();

if (entryName.endsWith(".class") && !entryName.startsWith("."))
if (entryName.endsWith(".class") && entryName.charAt(0) != '.'/*startsWith(".")*/)
{
ClassNode cls = new ClassNode();
ClassReader rdr = new ClassReader(entryData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void acceptOptions(List<String> args, File gameDir, File assetsDir, Strin

for (String arg : args)
{
if (arg.startsWith("-"))
if (arg.charAt(0) == '-'/*startsWith("-")*/)
{
if (classifier != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public static String getContentDump(ByteBuf buffer)

for (; i >= 0 && j < i; j++)
{
if (buffer.getByte(j) < 0x20 || buffer.getByte(j) > 0x7F)
if (buffer.getByte(j) < 0x20/* || buffer.getByte(j) > 0x7F*/)
returnString.append('.');
else
returnString.append((char) buffer.getByte(j));
Expand Down
6 changes: 3 additions & 3 deletions fml/src/main/java/cpw/mods/fml/common/patcher/GenDiffSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void main(String[] args) throws IOException
boolean kill = killTarget.equalsIgnoreCase("true");

File f = new File(outputDir);
f.mkdirs();
f.mkdirs();byte[] tempbyte_1 = new byte[0];

for (String name : remapper.getObfedClasses())
{
Expand All @@ -52,14 +52,14 @@ public static void main(String[] args) throws IOException
fileName = "_"+name;
}
File targetFile = new File(targetDir, fileName.replace('/', File.separatorChar) + ".class");
jarName += /*jarName+*/".class";
jarName = String.valueOf(new StringBuilder().append(jarName).append(".class"));
if (targetFile.exists())
{
String sourceClassName = name.replace('/', '.');
String targetClassName = remapper.map(name).replace('/', '.');
JarEntry entry = sourceZip.getJarEntry(jarName);

byte[] vanillaBytes = entry != null ? ByteStreams.toByteArray(sourceZip.getInputStream(entry)) : new byte[0];
byte[] vanillaBytes = entry != null ? ByteStreams.toByteArray(sourceZip.getInputStream(entry)) : tempbyte_1;
byte[] patchedBytes = Files.toByteArray(targetFile);

byte[] diff = delta.compute(vanillaBytes, patchedBytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void addNameForObject(Object objectToName, String lang, String name)
} else {
throw new IllegalArgumentException(String.format("Illegal object for naming %s",objectToName));
}
objectName+=".name";
objectName=String.valueOf(new StringBuilder().append(objectName).append(".name"));
addStringLocalization(objectName, lang, name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public static VersionRange createFromVersionSpec( String spec )

process = process.substring( index + 1 ).trim();

if ( process.length() > 0 && process.startsWith( "," ) )
if ( process.length() > 0 && process.charAt(0) == ','/*startsWith( "," )*/ )
{
process = process.substring( 1 ).trim();
}
Expand All @@ -189,7 +189,7 @@ public static VersionRange createFromVersionSpec( String spec )
private static Restriction parseRestriction( String spec )
throws InvalidVersionSpecificationException
{
boolean lowerBoundInclusive = spec.startsWith( "[" );
boolean lowerBoundInclusive = (spec.charAt(0) == '[')/*startsWith( "[" )*/;
boolean upperBoundInclusive = spec.endsWith( "]" );

String process = spec.substring( 1, spec.length() - 1 ).trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public String toString()
{
return "BBSeekable" +
" bb=" + this.bb.position() + "-" + bb.limit() +
" cur=" + this.cur.position() + "-" + cur.limit() +
"";
" cur=" + this.cur.position() + "-" + cur.limit()/* +
""*/;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ public String toString()
{
return "Source"+
" checksum=" + this.checksum +
" source=" + this.source +
"";
" source=" + this.source/* +
""*/;
}

}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/minecraftforge/client/GuiIngameForge.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void renderGameOverlay(float partialTicks, boolean hasScreen, int mouseX,
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
zLevel = -90.0F;
rand.setSeed((long)(updateCounter * 312871));
rand.setSeed(updateCounter * 312871L);

if (renderCrosshairs) renderCrosshairs(width, height);
if (renderBossHealth) renderBossHealth();
Expand Down Expand Up @@ -337,7 +337,7 @@ public void renderHealth(int width, int height)
mc.mcProfiler.startSection("health");
GL11.glEnable(GL11.GL_BLEND);

boolean highlight = mc.thePlayer.hurtResistantTime / 3 % 2 == 1;
boolean highlight = ((mc.thePlayer.hurtResistantTime / 3) & 1) == 1;

if (mc.thePlayer.hurtResistantTime < 10)
{
Expand All @@ -353,7 +353,7 @@ public void renderHealth(int width, int height)
int healthRows = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F / 10.0F);
int rowHeight = Math.max(10 - (healthRows - 2), 3);

this.rand.setSeed((long)(updateCounter * 312871));
this.rand.setSeed(updateCounter * 312871L);

int left = width / 2 - 91;
int top = height - left_height;
Expand Down

0 comments on commit 60ff7f4

Please sign in to comment.