mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 05:36:45 +01:00
plot setup.
This commit is contained in:
parent
a4afba181c
commit
8e03638d8d
@ -6,7 +6,7 @@
|
|||||||
<groupId>com.intellectualcrafters</groupId>
|
<groupId>com.intellectualcrafters</groupId>
|
||||||
|
|
||||||
<artifactId>PlotSquared</artifactId>
|
<artifactId>PlotSquared</artifactId>
|
||||||
<version>2.4.2</version>
|
<version>2.4.3</version>
|
||||||
<name>PlotSquared</name>
|
<name>PlotSquared</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
|
@ -941,10 +941,13 @@ import java.util.concurrent.TimeUnit;
|
|||||||
plotGenerator = (PlotGenerator) generator;
|
plotGenerator = (PlotGenerator) generator;
|
||||||
plotWorld = plotGenerator.getNewPlotWorld(world);
|
plotWorld = plotGenerator.getNewPlotWorld(world);
|
||||||
plotManager = plotGenerator.getPlotManager();
|
plotManager = plotGenerator.getPlotManager();
|
||||||
|
|
||||||
|
if (!world.equals("CheckingPlotSquaredGenerator")) {
|
||||||
sendConsoleSenderMessage(C.PREFIX.s() + "&aDetected world load for '" + world + "'");
|
sendConsoleSenderMessage(C.PREFIX.s() + "&aDetected world load for '" + world + "'");
|
||||||
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - generator: &7" + plotGenerator.getClass().getName());
|
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 - plotworld: &7" + plotWorld.getClass().getName());
|
||||||
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - manager: &7" + plotManager.getClass().getName());
|
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - manager: &7" + plotManager.getClass().getName());
|
||||||
|
}
|
||||||
|
|
||||||
if (!config.contains(path)) {
|
if (!config.contains(path)) {
|
||||||
config.createSection(path);
|
config.createSection(path);
|
||||||
|
@ -77,8 +77,7 @@ public class Setup extends SubCommand implements Listener {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
PlotMain.config.save(PlotMain.configFile);
|
PlotMain.config.save(PlotMain.configFile);
|
||||||
PlotMain.config.load(PlotMain.configFile);
|
} catch (final IOException e) {
|
||||||
} catch (final IOException | InvalidConfigurationException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,11 +124,10 @@ public class Setup extends SubCommand implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
if (args[0].equalsIgnoreCase("cancel")) {
|
if (args[0].equalsIgnoreCase("cancel")) {
|
||||||
final String world = object.world;
|
final String world = object.world;
|
||||||
PlotMain.config.set(world, null);
|
PlotMain.config.set("worlds." + world, null);
|
||||||
try {
|
try {
|
||||||
PlotMain.config.save(PlotMain.configFile);
|
PlotMain.config.save(PlotMain.configFile);
|
||||||
PlotMain.config.load(PlotMain.configFile);
|
} catch (final IOException e) {
|
||||||
} catch (final IOException | InvalidConfigurationException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
setupMap.remove(plrname);
|
setupMap.remove(plrname);
|
||||||
@ -191,7 +189,8 @@ public class Setup extends SubCommand implements Listener {
|
|||||||
|
|
||||||
for (final Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
for (final Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
||||||
if (plugin.isEnabled()) {
|
if (plugin.isEnabled()) {
|
||||||
if (plugin.getDefaultWorldGenerator(world, "") != null) {
|
if (plugin.getDefaultWorldGenerator("CheckingPlotSquaredGenerator", "") != null) {
|
||||||
|
PlotMain.removePlotWorld(world);
|
||||||
final String name = plugin.getDescription().getName();
|
final String name = plugin.getDescription().getName();
|
||||||
generators.add(name);
|
generators.add(name);
|
||||||
if (args[1].equals(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) {
|
if (generator == null) {
|
||||||
sendMessage(plr, C.SETUP_INVALID_GENERATOR, StringUtils.join(generators, C.BLOCK_LIST_SEPARATER.s()));
|
sendMessage(plr, C.SETUP_INVALID_GENERATOR, StringUtils.join(generators, C.BLOCK_LIST_SEPARATER.s()));
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user