Now that WorldEdit has YAML handling classes, YAMLConfiguration is separate from BukkitConfiguration.

This commit is contained in:
zml2008
2011-12-24 21:03:51 -08:00
parent 4a95d03230
commit 9aa8c5f674
3 changed files with 196 additions and 125 deletions

View File

@ -0,0 +1,28 @@
package com.sk89q.bukkit.util;
import org.bukkit.command.CommandMap;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerListener;
/**
* @author zml2008
*/
public class FallbackRegistrationListener extends PlayerListener {
private final CommandMap commandRegistration;
public FallbackRegistrationListener(CommandMap commandRegistration) {
this.commandRegistration = commandRegistration;
}
@Override
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if (event.isCancelled()) {
return;
}
if (commandRegistration.dispatch(event.getPlayer(), event.getMessage())) {
event.setCancelled(true);
}
}
}