mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 11:56:40 +00:00
Make sure all WorldEdit files are in the plugins/WorldEdit folder
This commit is contained in:
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2012 sk89q <http://www.sk89q.com> and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.spout;
|
||||
|
||||
import com.sk89q.util.yaml.YAMLProcessor;
|
||||
import com.sk89q.worldedit.util.YAMLConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* @author zml2008
|
||||
*/
|
||||
public class SpoutConfiguration extends YAMLConfiguration {
|
||||
private final WorldEditPlugin plugin;
|
||||
public SpoutConfiguration(YAMLProcessor config, WorldEditPlugin plugin) {
|
||||
super(config, plugin.getLogger());
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getWorkingDirectory() {
|
||||
return plugin.getDataFolder();
|
||||
}
|
||||
}
|
@ -46,7 +46,7 @@ import java.util.regex.Pattern;
|
||||
/**
|
||||
* Handles all events thrown in relation to a Player
|
||||
*/
|
||||
public class WorldEditPlayerListener implements Listener {
|
||||
public class WorldEditListener implements Listener {
|
||||
/**
|
||||
* Plugin.
|
||||
*/
|
||||
@ -61,7 +61,7 @@ public class WorldEditPlayerListener implements Listener {
|
||||
*
|
||||
* @param plugin
|
||||
*/
|
||||
public WorldEditPlayerListener(WorldEditPlugin plugin) {
|
||||
public WorldEditListener(WorldEditPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
@ -49,10 +49,6 @@ import java.util.zip.ZipEntry;
|
||||
* @author sk89q
|
||||
*/
|
||||
public class WorldEditPlugin extends CommonPlugin implements Named {
|
||||
/**
|
||||
* WorldEdit messages get sent here.
|
||||
*/
|
||||
private static final Logger logger = Logger.getLogger("Minecraft.WorldEdit");
|
||||
|
||||
/**
|
||||
* The server interface that all server-related API goes through.
|
||||
@ -80,7 +76,7 @@ public class WorldEditPlugin extends CommonPlugin implements Named {
|
||||
final String pluginYmlVersion = getDescription().getVersion();
|
||||
final String manifestVersion = WorldEdit.getVersion();
|
||||
|
||||
logger.info("WorldEdit " + pluginYmlVersion + " enabled.");
|
||||
getLogger().info("WorldEdit " + pluginYmlVersion + " enabled.");
|
||||
if (!manifestVersion.equalsIgnoreCase(pluginYmlVersion)) {
|
||||
WorldEdit.setVersion(manifestVersion + " (" + pluginYmlVersion + ")");
|
||||
}
|
||||
@ -93,7 +89,7 @@ public class WorldEditPlugin extends CommonPlugin implements Named {
|
||||
|
||||
// Set up configuration and such, including the permissions
|
||||
// resolver
|
||||
config = new YAMLConfiguration(new YAMLProcessor(new File(getDataFolder(), "config.yml"), true), logger);
|
||||
config = new SpoutConfiguration(new YAMLProcessor(new File(getDataFolder(), "config.yml"), true), this);
|
||||
|
||||
// Load the configuration
|
||||
loadConfiguration();
|
||||
@ -136,7 +132,7 @@ public class WorldEditPlugin extends CommonPlugin implements Named {
|
||||
* Register the events used by WorldEdit.
|
||||
*/
|
||||
protected void registerEvents() {
|
||||
getGame().getEventManager().registerEvents(new WorldEditPlayerListener(this), this);
|
||||
getGame().getEventManager().registerEvents(new WorldEditListener(this), this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,7 +151,7 @@ public class WorldEditPlugin extends CommonPlugin implements Named {
|
||||
if (copy == null) throw new FileNotFoundException();
|
||||
input = file.getInputStream(copy);
|
||||
} catch (IOException e) {
|
||||
logger.severe(getDescription().getName() + ": Unable to read default configuration: " + name);
|
||||
getLogger().severe("Unable to read default configuration: " + name);
|
||||
}
|
||||
if (input != null) {
|
||||
FileOutputStream output = null;
|
||||
@ -168,22 +164,19 @@ public class WorldEditPlugin extends CommonPlugin implements Named {
|
||||
output.write(buf, 0, length);
|
||||
}
|
||||
|
||||
logger.info(getDescription().getName()
|
||||
+ ": Default configuration file written: " + name);
|
||||
getLogger().info("Default configuration file written: " + name);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (input != null) {
|
||||
input.close();
|
||||
}
|
||||
} catch (IOException e) {}
|
||||
input.close();
|
||||
} catch (IOException ignore) {}
|
||||
|
||||
try {
|
||||
if (output != null) {
|
||||
output.close();
|
||||
}
|
||||
} catch (IOException e) {}
|
||||
} catch (IOException ignore) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user