mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
[trunk] 1 to 1 ratio in Nether: The code is in two places. Also fixes 1/16=0 error using /world command.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1207 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
76dda664d7
commit
fc9a9c2b9f
2 changed files with 39 additions and 12 deletions
|
@ -68,12 +68,29 @@ public class EssentialsPlayerListener extends PlayerListener
|
|||
final World world = worlds.get(user.getWorld() == worlds.get(0) ? 1 : 0);
|
||||
|
||||
double factor;
|
||||
if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL)
|
||||
factor = 16.0;
|
||||
else if (user.getWorld().getEnvironment() != world.getEnvironment())
|
||||
factor = 1.0 / 16.0;
|
||||
else
|
||||
if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL) {
|
||||
if (Essentials.getSettings().use1to1RatioInNether())
|
||||
{
|
||||
factor = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
factor = 16.0;
|
||||
}
|
||||
}
|
||||
else if (user.getWorld().getEnvironment() != world.getEnvironment()) {
|
||||
if (Essentials.getSettings().use1to1RatioInNether())
|
||||
{
|
||||
factor = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
factor = 1.0 / 16.0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
factor = 1.0;
|
||||
}
|
||||
|
||||
int x = loc.getBlockX();
|
||||
int y = loc.getBlockY();
|
||||
|
|
|
@ -50,19 +50,29 @@ public class Commandworld extends EssentialsCommand
|
|||
}
|
||||
|
||||
double factor;
|
||||
if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL)
|
||||
if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL) {
|
||||
if (Essentials.getSettings().use1to1RatioInNether())
|
||||
{
|
||||
factor = 1;
|
||||
factor = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
factor = 16;
|
||||
factor = 16.0;
|
||||
}
|
||||
}
|
||||
else if (user.getWorld().getEnvironment() != world.getEnvironment()) {
|
||||
if (Essentials.getSettings().use1to1RatioInNether())
|
||||
{
|
||||
factor = 1.0;
|
||||
}
|
||||
else if (user.getWorld().getEnvironment() != world.getEnvironment())
|
||||
factor = 1 / 16;
|
||||
else
|
||||
factor = 1;
|
||||
{
|
||||
factor = 1.0 / 16.0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
factor = 1.0;
|
||||
}
|
||||
|
||||
Location loc = user.getLocation();
|
||||
loc = new Location(world, loc.getBlockX() * factor + .5, loc.getBlockY(), loc.getBlockZ() * factor + .5);
|
||||
|
|
Loading…
Reference in a new issue