Possible fix for 'inconvertible types' error

Not sure if it will fix it as eclipse had no issue with it at all.
However, jenkins threw up red flags when trying to compile the code.
This commit is contained in:
DarkGuardsman 2013-10-22 17:53:45 -04:00
parent 6d7c6f4eac
commit 4d12e4affe
2 changed files with 19 additions and 19 deletions

View file

@ -98,7 +98,7 @@ public class UnitHelper
}
/** Tries to parse a value that may be anything.
*
*
* @param var - String, Integer, Float, Double
* @param suggestValue - Used by string parsing in case it fails and you want to return a
* default value */
@ -117,14 +117,14 @@ public class UnitHelper
}
if (var instanceof Integer || var instanceof Float || var instanceof Double)
{
return (int) var;
return (Integer) var;
}
return suggestValue;
}
/** Tries to parse a value that may be anything.
*
*
* @param var - String, Integer, Float, Double */
public static int tryToParseInt(Object var)
{
@ -132,7 +132,7 @@ public class UnitHelper
}
/** Tries to parse a value that may be anything.
*
*
* @param var - String, Integer, Float, Double
* @param suggestValue - Used by string parsing in case it fails and you want to return a
* default value */
@ -158,7 +158,7 @@ public class UnitHelper
}
/** Tries to parse a value that may be anything.
*
*
* @param var - String, Integer, Float, Double */
public static Double tryToParseDouble(Object var)
{
@ -166,7 +166,7 @@ public class UnitHelper
}
/** Tries to parse a value that may be anything.
*
*
* @param var - String, Integer, Float, Double
* @param suggestValue - Used by string parsing in case it fails and you want to return a
* default value */
@ -192,7 +192,7 @@ public class UnitHelper
}
/** Tries to parse a value that may be anything.
*
*
* @param var - String, Integer, Float, Double
* @return Zero if it fails to parse the value */
public static Float tryToParseFloat(Object var)

View file

@ -28,7 +28,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.FMLLog;
/** Helper class used to work with minecraft's NBT file system.
*
*
* @author DarkGuardsman */
public class NBTFileHelper
{
@ -42,7 +42,7 @@ public class NBTFileHelper
}
/** Saves an NBT file
*
*
* @param file - exact File
* @param data - nbt data
* @return */
@ -76,7 +76,7 @@ public class NBTFileHelper
}
/** Uses the default world directory to save the data to file by the given name
*
*
* @param filename - file name
* @param data - nbt data
* @return true if everything goes well */
@ -86,7 +86,7 @@ public class NBTFileHelper
}
/** Reads NBT data from the world folder.
*
*
* @return The NBT data */
public static NBTTagCompound loadNBTFile(File saveDirectory, String filename)
{
@ -114,7 +114,7 @@ public class NBTFileHelper
}
/** Loads an NBT file from the current world file
*
*
* @param filename - name of the file
* @return NBTTagCompound that was stored in the file */
public static NBTTagCompound loadNBTFile(String filename)
@ -150,7 +150,7 @@ public class NBTFileHelper
/** Used to save an object without knowing what the object is exactly. Supports most
* NBTTagCompound save methods including some special cases. Which includes boolean being saves
* as a string so it can be loaded as a boolean from an object save.
*
*
* @param tag - NBTTagCompound to save the tag too
* @param key - name to save the object as
* @param value - the actual object
@ -159,15 +159,15 @@ public class NBTFileHelper
{
if (value instanceof Float)
{
tag.setFloat(key, (float) value);
tag.setFloat(key, (Float) value);
}
else if (value instanceof Double)
{
tag.setDouble(key, (double) value);
tag.setDouble(key, (Double) value);
}
else if (value instanceof Integer)
{
tag.setInteger(key, (int) value);
tag.setInteger(key, (Integer) value);
}
else if (value instanceof String)
{
@ -175,7 +175,7 @@ public class NBTFileHelper
}
else if (value instanceof Short)
{
tag.setShort(key, (short) value);
tag.setShort(key, (Short) value);
}
else if (value instanceof Byte)
{
@ -183,7 +183,7 @@ public class NBTFileHelper
}
else if (value instanceof Long)
{
tag.setLong(key, (long) value);
tag.setLong(key, (Long) value);
}
else if (value instanceof Boolean)
{
@ -230,7 +230,7 @@ public class NBTFileHelper
}
/** Reads an unknown object with a known name from NBT
*
*
* @param tag - tag to read the value from
* @param key - name of the value
* @param suggestionValue - value to return in case nothing is found