Fixed setup command

This commit is contained in:
boy0001 2015-04-28 00:53:07 +10:00
parent 42a34fc44a
commit dda2636250
5 changed files with 31 additions and 3 deletions

View file

@ -27,6 +27,7 @@ import java.util.zip.ZipInputStream;
import net.milkbowl.vault.economy.Economy;
import org.apache.commons.lang.StringUtils;
import org.bukkit.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.commands.Cluster;
@ -361,18 +362,22 @@ public class PlotSquared {
final PlotGenerator gen_class = generator;
plotWorld = gen_class.getNewPlotWorld(world);
plotManager = gen_class.getPlotManager();
if (!config.contains(path)) {
config.createSection(path);
}
plotWorld.TYPE = 2;
plotWorld.TERRAIN = 0;
plotWorld.saveConfiguration(config.getConfigurationSection(path));
plotWorld.loadDefaultConfiguration(config.getConfigurationSection(path));
try {
config.save(configFile);
} catch (final IOException e) {
e.printStackTrace();
}
if (((plotWorld.TYPE == 2) && !Settings.ENABLE_CLUSTERS) || !(plotManager instanceof SquarePlotManager)) {
log("&c[ERROR] World '" + world + "' in settings.yml is not using PlotSquared generator! Please set the generator correctly or delete the world from the 'settings.yml'!");
return;