mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-01 21:21:19 +01:00
Multiworld exit-warp and location formatting.
This commit is contained in:
parent
b3cb258d0b
commit
f98fe0b78f
@ -40,7 +40,7 @@ public class SetWarpCommand implements Command
|
||||
if (arg1.equals("spec")) arg1 = "spectator";
|
||||
|
||||
if (!WARPS.contains(arg1)) {
|
||||
Messenger.tellPlayer(sender, "Usage: /ma setwarp arena|lobby|spectator");
|
||||
Messenger.tellPlayer(sender, "Usage: /ma setwarp arena|lobby|spectator|exit");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ public class SetWarpCommand implements Command
|
||||
Arena arena = am.getSelectedArena();
|
||||
World aw = arena.getWorld();
|
||||
World pw = p.getLocation().getWorld();
|
||||
boolean changeWorld = !aw.getName().equals(pw.getName());
|
||||
boolean changeWorld = !arg1.equals("exit") && !aw.getName().equals(pw.getName());
|
||||
|
||||
// Change worlds to make sure the region check doesn't fail
|
||||
if (changeWorld) arena.setWorld(pw);
|
||||
|
@ -77,9 +77,7 @@ public class ArenaRegion
|
||||
arenaWarp = coords.getLocation("arena", world);
|
||||
lobbyWarp = coords.getLocation("lobby", world);
|
||||
specWarp = coords.getLocation("spectator", world);
|
||||
exitWarp = coords.getLocation("exit", world);
|
||||
|
||||
leaderboard = coords.getLocation("leaderboard", world);
|
||||
exitWarp = coords.getLocation("exit", null);
|
||||
}
|
||||
|
||||
public void reloadLeaderboards() {
|
||||
|
@ -453,8 +453,8 @@ public class Config
|
||||
result.append(twoPlaces(loc.getX())).append(",");
|
||||
result.append(twoPlaces(loc.getY())).append(",");
|
||||
result.append(twoPlaces(loc.getZ())).append(",");
|
||||
result.append(twoPlaces(loc.getYaw())).append(",");
|
||||
result.append(twoPlaces(loc.getPitch())).append(",");
|
||||
result.append(twoPlaces(loc.getYaw(), true)).append(",");
|
||||
result.append(twoPlaces(loc.getPitch(), true)).append(",");
|
||||
result.append(loc.getWorld().getName());
|
||||
|
||||
return result.toString();
|
||||
@ -480,8 +480,13 @@ public class Config
|
||||
}
|
||||
}
|
||||
|
||||
private static String twoPlaces(double value) {
|
||||
return df.format(value);
|
||||
private static String twoPlaces(double value, boolean force) {
|
||||
return force ? DF_FORCE.format(value) : DF_NORMAL.format(value);
|
||||
}
|
||||
private static final DecimalFormat df = new DecimalFormat("0.##");
|
||||
|
||||
private static String twoPlaces(double value) {
|
||||
return twoPlaces(value, false);
|
||||
}
|
||||
private static final DecimalFormat DF_NORMAL = new DecimalFormat("0.##");
|
||||
private static final DecimalFormat DF_FORCE = new DecimalFormat("0.0#");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user