fix for saving/loading data for worlds with periods (".") in the name; release 1.0.1

This commit is contained in:
Brettflan 2011-04-07 15:57:07 -05:00
parent 3286c53515
commit dddceca7f1
3 changed files with 6 additions and 6 deletions

View File

@ -11,4 +11,4 @@ This plugin is intended to be able to supersede BorderGuard Lite and rBorder in
More Info
=========
<a href="http://forums.bukkit.org/threads/mech-worldborder-v1-0-borders-for-multiple-worlds-round-or-square-617.11309">Bukkit Forum Topic</a>
<a href="http://forums.bukkit.org/threads/worldborder-617.11309/">Bukkit Forum Topic</a>

View File

@ -216,7 +216,7 @@ public class Config
while(world.hasNext())
{
Entry wdata = (Entry)world.next();
String name = (String)wdata.getKey();
String name = ((String)wdata.getKey()).replace("/", ".");
ConfigurationNode bord = (ConfigurationNode)wdata.getValue();
BorderData border = new BorderData(bord.getDouble("x", 0), bord.getDouble("z", 0), bord.getInt("radius", 0));
borders.put(name, border);
@ -250,9 +250,9 @@ public class Config
Entry wdata = (Entry)world.next();
String name = (String)wdata.getKey();
BorderData bord = (BorderData)wdata.getValue();
cfg.setProperty("worlds." + name + ".x", bord.getX());
cfg.setProperty("worlds." + name + ".z", bord.getZ());
cfg.setProperty("worlds." + name + ".radius", bord.getRadius());
cfg.setProperty("worlds." + name.replace(".", "/") + ".x", bord.getX());
cfg.setProperty("worlds." + name.replace(".", "/") + ".z", bord.getZ());
cfg.setProperty("worlds." + name.replace(".", "/") + ".radius", bord.getRadius());
}
cfg.save();

View File

@ -1,7 +1,7 @@
name: WorldBorder
author: Brettflan
description: Limit the size of your worlds with a border, round or square.
version: 1.0
version: 1.0.1
main: com.wimbli.WorldBorder.WorldBorder
commands:
wborder: