mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 12:42:26 +00:00
Add a java version detection and nag system for users on Java 7 or below.
Added detection of mods that rely on Java 8 and a graceful error screen. The nag screen will be shown once a day. It can be disabled by editing the forge.cfg. However it is HIGHLY recomended that user update to Java 8.
This commit is contained in:
1 parent
4d27393c91
commit
d8249b7886
15 files changed
+416
-18
No files matched your search
@@ -680,14 +680,7 @@ public class Property
|
||||
*/
|
||||
public int getInt()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Integer.parseInt(value);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
return Integer.parseInt(defaultValue);
|
||||
}
|
||||
return getInt(Integer.parseInt(defaultValue));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -727,6 +720,54 @@ public class Property
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value in this property as a long,
|
||||
* if the value is not a valid long, it will return the initially provided default.
|
||||
*
|
||||
* @return The value
|
||||
*/
|
||||
public long getLong()
|
||||
{
|
||||
return getLong(Long.parseLong(defaultValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value in this property as a long,
|
||||
* if the value is not a valid long, it will return the
|
||||
* provided default.
|
||||
*
|
||||
* @param _default The default to provide if the current value is not a validlong
|
||||
* @return The value
|
||||
*/
|
||||
public long getLong(long _default)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Long.parseLong(value);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
return _default;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the current value stored in this property can be converted to a long.
|
||||
* @return True if the type of the Property is an Long
|
||||
*/
|
||||
public boolean isLongValue()
|
||||
{
|
||||
try
|
||||
{
|
||||
Long.parseLong(value);
|
||||
return true;
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value in this property as a boolean,
|
||||
* if the value is not a valid boolean, it will return the
|
||||
@@ -1148,6 +1189,7 @@ public class Property
|
||||
this.setValues(values);
|
||||
}
|
||||
public void set(int value){ set(Integer.toString(value)); }
|
||||
public void set(long value){ set(Long.toString(value)); }
|
||||
public void set(boolean value){ set(Boolean.toString(value)); }
|
||||
public void set(double value){ set(Double.toString(value)); }
|
||||
}
|
||||
Reference in new issue
Block a user