mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 19:56:40 +00:00
Now that WorldEdit has YAML handling classes, YAMLConfiguration is separate from BukkitConfiguration.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user