plot setup.

This commit is contained in:
boy0001 2014-12-22 18:05:23 +11:00
parent a4afba181c
commit 8e03638d8d
3 changed files with 19 additions and 11 deletions

View File

@ -6,7 +6,7 @@
<groupId>com.intellectualcrafters</groupId>
<artifactId>PlotSquared</artifactId>
<version>2.4.2</version>
<version>2.4.3</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>

View File

@ -941,10 +941,13 @@ import java.util.concurrent.TimeUnit;
plotGenerator = (PlotGenerator) generator;
plotWorld = plotGenerator.getNewPlotWorld(world);
plotManager = plotGenerator.getPlotManager();
sendConsoleSenderMessage(C.PREFIX.s() + "&aDetected world load for '" + world + "'");
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - generator: &7" + plotGenerator.getClass().getName());
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - plotworld: &7" + plotWorld.getClass().getName());
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - manager: &7" + plotManager.getClass().getName());
if (!world.equals("CheckingPlotSquaredGenerator")) {
sendConsoleSenderMessage(C.PREFIX.s() + "&aDetected world load for '" + world + "'");
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - generator: &7" + plotGenerator.getClass().getName());
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - plotworld: &7" + plotWorld.getClass().getName());
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - manager: &7" + plotManager.getClass().getName());
}
if (!config.contains(path)) {
config.createSection(path);

View File

@ -77,8 +77,7 @@ public class Setup extends SubCommand implements Listener {
}
try {
PlotMain.config.save(PlotMain.configFile);
PlotMain.config.load(PlotMain.configFile);
} catch (final IOException | InvalidConfigurationException e) {
} catch (final IOException e) {
e.printStackTrace();
}
@ -125,11 +124,10 @@ public class Setup extends SubCommand implements Listener {
} else {
if (args[0].equalsIgnoreCase("cancel")) {
final String world = object.world;
PlotMain.config.set(world, null);
PlotMain.config.set("worlds." + world, null);
try {
PlotMain.config.save(PlotMain.configFile);
PlotMain.config.load(PlotMain.configFile);
} catch (final IOException | InvalidConfigurationException e) {
} catch (final IOException e) {
e.printStackTrace();
}
setupMap.remove(plrname);
@ -191,7 +189,8 @@ public class Setup extends SubCommand implements Listener {
for (final Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
if (plugin.isEnabled()) {
if (plugin.getDefaultWorldGenerator(world, "") != null) {
if (plugin.getDefaultWorldGenerator("CheckingPlotSquaredGenerator", "") != null) {
PlotMain.removePlotWorld(world);
final String name = plugin.getDescription().getName();
generators.add(name);
if (args[1].equals(name)) {
@ -201,6 +200,12 @@ public class Setup extends SubCommand implements Listener {
}
}
}
PlotMain.config.set("worlds.CheckingPlotSquaredGenerator", null);
try {
PlotMain.config.save(PlotMain.configFile);
} catch (final IOException e) {
e.printStackTrace();
}
if (generator == null) {
sendMessage(plr, C.SETUP_INVALID_GENERATOR, StringUtils.join(generators, C.BLOCK_LIST_SEPARATER.s()));
return true;