mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Moved YAML classes from RegionBook from WorldGuard into WorldEdit and made everything use those.
This commit is contained in:
@ -25,26 +25,33 @@ import java.util.logging.FileHandler;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.util.config.Configuration;
|
||||
|
||||
import com.sk89q.util.yaml.YAMLProcessor;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.LogFormat;
|
||||
import com.sk89q.worldedit.snapshots.SnapshotRepository;
|
||||
|
||||
public class BukkitConfiguration extends LocalConfiguration {
|
||||
private Configuration config;
|
||||
private YAMLProcessor config;
|
||||
private Logger logger;
|
||||
private FileHandler logFileHandler;
|
||||
|
||||
public boolean noOpPermissions = false;
|
||||
|
||||
public BukkitConfiguration(Configuration config, Logger logger) {
|
||||
public BukkitConfiguration(YAMLProcessor config, Logger logger) {
|
||||
this.config = config;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
try {
|
||||
config.load();
|
||||
} catch (IOException e) {
|
||||
logger.severe("Error loading WorldEdit configuration: " + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
showFirstUseVersion = false;
|
||||
|
||||
profile = config.getBoolean("debug", profile);
|
||||
|
@ -28,6 +28,7 @@ import java.util.jar.JarFile;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import com.sk89q.util.yaml.YAMLProcessor;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -89,7 +90,7 @@ public class WorldEditPlugin extends JavaPlugin {
|
||||
|
||||
// Set up configuration and such, including the permissions
|
||||
// resolver
|
||||
config = new BukkitConfiguration(getConfiguration(), logger);
|
||||
config = new BukkitConfiguration(new YAMLProcessor(new File(getDataFolder(), "config.yml"), true), logger);
|
||||
perms = new PermissionsResolverManager(this, "WorldEdit", logger);
|
||||
|
||||
// Load the configuration
|
||||
@ -126,7 +127,6 @@ public class WorldEditPlugin extends JavaPlugin {
|
||||
* Loads and reloads all configuration.
|
||||
*/
|
||||
protected void loadConfiguration() {
|
||||
getConfiguration().load();
|
||||
config.unload();
|
||||
config.load();
|
||||
perms.load();
|
||||
|
Reference in New Issue
Block a user