[trunk] New config property: nether.ratio, defaults to 16.

Please update use1to1ratio to ratio: 1.0

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1378 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-08 22:57:38 +00:00
parent 14b53db85a
commit dae0ce78d1
4 changed files with 13 additions and 33 deletions

View File

@ -101,25 +101,11 @@ public class EssentialsPlayerListener extends PlayerListener
double factor;
if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL)
{
if (ess.getSettings().use1to1RatioInNether())
{
factor = 1.0;
}
else
{
factor = 16.0;
}
factor = ess.getSettings().getNetherRatio();
}
else if (user.getWorld().getEnvironment() != world.getEnvironment())
{
if (ess.getSettings().use1to1RatioInNether())
{
factor = 1.0;
}
else
{
factor = 1.0 / 16.0;
}
factor = 1.0 / ess.getSettings().getNetherRatio();
}
else
{

View File

@ -471,6 +471,14 @@ public class Settings implements IConf
return config.getBoolean("nether.use-1to1-ratio", false);
}
public double getNetherRatio()
{
if (config.getBoolean("nether.use-1to1-ratio", false)) {
return 1.0;
}
return config.getDouble("nether.ratio", 16.0);
}
public boolean isDebug()
{
return config.getBoolean("debug", false);

View File

@ -53,25 +53,11 @@ public class Commandworld extends EssentialsCommand
double factor;
if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL)
{
if (ess.getSettings().use1to1RatioInNether())
{
factor = 1.0;
}
else
{
factor = 16.0;
}
factor = ess.getSettings().getNetherRatio();
}
else if (user.getWorld().getEnvironment() != world.getEnvironment())
{
if (ess.getSettings().use1to1RatioInNether())
{
factor = 1.0;
}
else
{
factor = 1.0 / 16.0;
}
factor = 1.0 / ess.getSettings().getNetherRatio();
}
else
{

View File

@ -75,7 +75,7 @@ nether:
folder: nether
portals-enabled: false
generate-exit-portals: false
use-1to1-ratio: false
ratio: 16
# Mob limit on spawnmob
spawnmob-limit: 10