Skip to content

Commit

Permalink
Changed world to only include the name
Browse files Browse the repository at this point in the history
Fixed v6 list.ncsv import
  • Loading branch information
spathizilla committed May 12, 2011
1 parent 99b4d7c commit f3de28f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/com/argo/bukkit/honeypot/Honeyfarm.java
Expand Up @@ -19,7 +19,8 @@ public class Honeyfarm {
private static List<String> potSelectUsers = new ArrayList<String>();

public static boolean refreshData(Honeypot plugin) {

World potWorld;

TextFileHandler r = new TextFileHandler(potListPath);
pots.clear();
try {
Expand All @@ -29,13 +30,17 @@ public static boolean refreshData(Honeypot plugin) {
coord = list.remove(0).split(",");
if(coord.length == 4) {
String world = coord[0];
World potWorld;
if (plugin.getServer().getWorld(world) == null)
potWorld = plugin.getServer().getWorlds().get(0);
else
potWorld = plugin.getServer().getWorld(world);

pots.add(new Location(potWorld, new Double(coord[1]), new Double(coord[2]), new Double(coord[3])));
} else {
// Earlier than version 7 - No world set, have to assume primary world.
String potWorldname = plugin.getServer().getWorlds().get(0).getName();
potWorld = plugin.getServer().getWorld(potWorldname);
pots.add(new Location(potWorld, new Double(coord[0]), new Double(coord[1]), new Double(coord[2])));
}
}

Expand All @@ -55,7 +60,7 @@ public static boolean saveData() {
Location loc;
while(!pots.isEmpty()) {
loc = pots.remove(0);
tmp.add(loc.getWorld() + "," + loc.getX() + "," + loc.getY() + "," + loc.getZ());
tmp.add(loc.getWorld().getName() + "," + loc.getX() + "," + loc.getY() + "," + loc.getZ());
}
try {
r.writeLines(tmp);
Expand Down

0 comments on commit f3de28f

Please sign in to comment.