mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
simplify config / multiple expiry tasks / block cache fix
This commit is contained in:
@ -134,7 +134,7 @@ public class SpongeMain implements IPlotMain {
|
||||
@Override
|
||||
public void log(String message) {
|
||||
message = C.format(message, C.replacements);
|
||||
if (!Settings.CONSOLE_COLOR) {
|
||||
if (!Settings.CHAT.CONSOLE_COLOR) {
|
||||
message = message.replaceAll('\u00a7' + "[a-z|0-9]", "");
|
||||
}
|
||||
if (this.server == null) {
|
||||
@ -262,7 +262,7 @@ public class SpongeMain implements IPlotMain {
|
||||
@Override
|
||||
public UUIDHandlerImplementation initUUIDHandler() {
|
||||
UUIDWrapper wrapper;
|
||||
if (Settings.OFFLINE_MODE) {
|
||||
if (Settings.UUID.OFFLINE) {
|
||||
wrapper = new SpongeLowerOfflineUUIDWrapper();
|
||||
} else {
|
||||
wrapper = new SpongeOnlineUUIDWrapper();
|
||||
@ -307,7 +307,7 @@ public class SpongeMain implements IPlotMain {
|
||||
World world = SpongeUtil.getWorld(worldName);
|
||||
if (world == null) {
|
||||
// create world
|
||||
ConfigurationSection worldConfig = PS.get().config.getConfigurationSection("worlds." + worldName);
|
||||
ConfigurationSection worldConfig = PS.get().worlds.getConfigurationSection("worlds." + worldName);
|
||||
String manager = worldConfig.getString("generator.plugin", "PlotSquared");
|
||||
String generator = worldConfig.getString("generator.init", manager);
|
||||
|
||||
|
@ -55,14 +55,14 @@ public class SpongeSetupUtils extends SetupUtils {
|
||||
final ConfigurationNode[] steps = object.step;
|
||||
final String world = object.world;
|
||||
for (final ConfigurationNode step : steps) {
|
||||
PS.get().config.set("worlds." + world + "." + step.getConstant(), step.getValue());
|
||||
PS.get().worlds.set("worlds." + world + "." + step.getConstant(), step.getValue());
|
||||
}
|
||||
if (object.type != 0) {
|
||||
PS.get().config.set("worlds." + world + ".generator.type", object.type);
|
||||
PS.get().config.set("worlds." + world + ".generator.terrain", object.terrain);
|
||||
PS.get().config.set("worlds." + world + ".generator.plugin", object.plotManager);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.type", object.type);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.terrain", object.terrain);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.plugin", object.plotManager);
|
||||
if ((object.setupGenerator != null) && !object.setupGenerator.equals(object.plotManager)) {
|
||||
PS.get().config.set("worlds." + world + ".generator.init", object.setupGenerator);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.init", object.setupGenerator);
|
||||
}
|
||||
final PlotGenerator<WorldGenerator> gen = (PlotGenerator<WorldGenerator>) generators.get(object.setupGenerator);
|
||||
if ((gen != null) && (gen.generator instanceof SpongePlotGenerator)) {
|
||||
@ -70,7 +70,7 @@ public class SpongeSetupUtils extends SetupUtils {
|
||||
}
|
||||
}
|
||||
try {
|
||||
PS.get().config.save(PS.get().configFile);
|
||||
PS.get().worlds.save(PS.get().worldsFile);
|
||||
} catch (final IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public class MainListener {
|
||||
if (source == null) {
|
||||
return;
|
||||
}
|
||||
if (Settings.USE_PLOTME_ALIAS) {
|
||||
if (Settings.PLOTME.ALIAS) {
|
||||
SpongeMain.THIS.getGame().getCommandManager().process(source, ("plots " + event.getArguments()).trim());
|
||||
} else {
|
||||
source.sendMessage(SpongeUtil.getText(C.NOT_USING_PLOTME.s()));
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.plotsquared.sponge.util;
|
||||
|
||||
import com.intellectualcrafters.plot.generator.HybridUtils;
|
||||
import com.intellectualcrafters.plot.object.PlotAnalysis;
|
||||
import com.intellectualcrafters.plot.util.expiry.PlotAnalysis;
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||
|
@ -69,10 +69,10 @@ public class SpongeSetupUtils extends SetupUtils {
|
||||
String world = object.world;
|
||||
int type = object.type;
|
||||
String worldPath = "worlds." + object.world;
|
||||
if (!PS.get().config.contains(worldPath)) {
|
||||
PS.get().config.createSection(worldPath);
|
||||
if (!PS.get().worlds.contains(worldPath)) {
|
||||
PS.get().worlds.createSection(worldPath);
|
||||
}
|
||||
ConfigurationSection worldSection = PS.get().config.getConfigurationSection(worldPath);
|
||||
ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection(worldPath);
|
||||
switch (type) {
|
||||
case 2: {
|
||||
if (object.id != null) {
|
||||
@ -115,11 +115,11 @@ public class SpongeSetupUtils extends SetupUtils {
|
||||
for (ConfigurationNode step : steps) {
|
||||
worldSection.set(step.getConstant(), step.getValue());
|
||||
}
|
||||
PS.get().config.set("worlds." + world + ".generator.type", object.type);
|
||||
PS.get().config.set("worlds." + world + ".generator.terrain", object.terrain);
|
||||
PS.get().config.set("worlds." + world + ".generator.plugin", object.plotManager);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.type", object.type);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.terrain", object.terrain);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.plugin", object.plotManager);
|
||||
if (object.setupGenerator != null && !object.setupGenerator.equals(object.plotManager)) {
|
||||
PS.get().config.set("worlds." + world + ".generator.init", object.setupGenerator);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.init", object.setupGenerator);
|
||||
}
|
||||
GeneratorWrapper<?> gen = SetupUtils.generators.get(object.setupGenerator);
|
||||
if (gen != null && gen.isFull()) {
|
||||
@ -133,7 +133,7 @@ public class SpongeSetupUtils extends SetupUtils {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
PS.get().config.save(PS.get().configFile);
|
||||
PS.get().worlds.save(PS.get().worldsFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Reference in New Issue
Block a user