mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-26 20:45:17 +01:00
Enforce English locale for decimal formatting in config-file.
This commit is contained in:
parent
8a17c72b4b
commit
3e025ef8be
@ -1,7 +1,7 @@
|
||||
name: MobArena
|
||||
author: garbagemule
|
||||
main: com.garbagemule.MobArena.MobArena
|
||||
version: 0.96.2.13
|
||||
version: 0.96.2.14
|
||||
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
|
||||
commands:
|
||||
ma:
|
||||
|
@ -9,8 +9,9 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
public class ConfigUtils
|
||||
@ -111,12 +112,8 @@ public class ConfigUtils
|
||||
|
||||
String world = location.getWorld().getName();
|
||||
|
||||
StringBuilder buffy = new StringBuilder();
|
||||
buffy.append(x).append(",").append(y).append(",").append(z);
|
||||
buffy.append(",").append(yaw).append(",").append(pit);
|
||||
buffy.append(",").append(world);
|
||||
|
||||
config.set(path, buffy.toString());
|
||||
String value = x + "," + y + "," + z + "," + yaw + "," + pit + "," + world;
|
||||
config.set(path, value);
|
||||
}
|
||||
|
||||
private static String twoPlaces(double value, boolean force) {
|
||||
@ -126,6 +123,11 @@ public class ConfigUtils
|
||||
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#");
|
||||
static {
|
||||
DF_FORCE.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH));
|
||||
DF_NORMAL.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user