3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 02:20:07 +01:00

Updated WorldEdit for command preprocessor event, changed initialization.

Dieser Commit ist enthalten in:
sk89q 2011-02-19 17:54:47 -08:00
Ursprung a0d5e02292
Commit a273a86a7d
2 geänderte Dateien mit 13 neuen und 20 gelöschten Zeilen

Datei anzeigen

@ -30,7 +30,6 @@ import org.bukkit.event.player.PlayerListener;
/**
* Handles all events thrown in relation to a Player
*/
@SuppressWarnings("deprecation")
public class WorldEditPlayerListener extends PlayerListener {
/**
* Plugin.
@ -74,7 +73,7 @@ public class WorldEditPlayerListener extends PlayerListener {
* @param event Relevant event details
*/
@Override
public void onPlayerCommand(PlayerChatEvent event) {
public void onPlayerCommandPreprocess(PlayerChatEvent event) {
String[] split = event.getMessage().split(" ");
if (plugin.controller.handleCommand(wrapPlayer(event.getPlayer()), split)) {

Datei anzeigen

@ -47,26 +47,23 @@ import com.sk89q.worldedit.regions.Region;
public class WorldEditPlugin extends JavaPlugin {
private static final Logger logger = Logger.getLogger("Minecraft.WorldEdit");
final ServerInterface server;
final WorldEdit controller;
final WorldEditAPI api;
ServerInterface server;
WorldEdit controller;
WorldEditAPI api;
private final BukkitConfiguration config;
private final PermissionsResolverManager perms;
private BukkitConfiguration config;
private PermissionsResolverManager perms;
private final WorldEditPlayerListener playerListener =
private WorldEditPlayerListener playerListener =
new WorldEditPlayerListener(this);
private final WorldEditBlockListener blockListener =
private WorldEditBlockListener blockListener =
new WorldEditBlockListener(this);
private final PermissionsResolverServerListener permsListener;
private PermissionsResolverServerListener permsListener;
public WorldEditPlugin(PluginLoader pluginLoader, Server instance,
PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
super(pluginLoader, instance, desc, folder, plugin, cLoader);
public void onEnable() {
logger.info("WorldEdit " + getDescription().getVersion() + " loaded.");
logger.info("WorldEdit " + desc.getVersion() + " loaded.");
folder.mkdirs();
getDataFolder().mkdirs();
createDefaultConfiguration("config.yml");
@ -83,9 +80,6 @@ public class WorldEditPlugin extends JavaPlugin {
registerEvents();
}
public void onEnable() {
}
public void onDisable() {
controller.clearSessions();
}
@ -97,7 +91,7 @@ public class WorldEditPlugin extends JavaPlugin {
playerListener, Priority.Normal, this);
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_ITEM,
playerListener, Priority.Normal, this);
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND,
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS,
playerListener, Priority.Normal, this);
getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DAMAGED,
blockListener, Priority.Normal, this);