This commit is contained in:
parent
8c6e24a3e5
commit
94a7834917
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
package com.sk89q.bukkit.util;
|
package com.sk89q.bukkit.util;
|
||||||
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
|
||||||
import org.bukkit.command.CommandMap;
|
import org.bukkit.command.CommandMap;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
@ -35,12 +34,7 @@ public class FallbackRegistrationListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||||
boolean doubleSlash = WorldEdit.getInstance().getConfiguration().noDoubleSlash;
|
if (commandRegistration.dispatch(event.getPlayer(), event.getMessage().substring(1))) {
|
||||||
String msg = event.getMessage();
|
|
||||||
if (doubleSlash || !msg.startsWith("/")) {
|
|
||||||
msg = "/" + msg;
|
|
||||||
}
|
|
||||||
if (commandRegistration.dispatch(event.getPlayer(), msg)) {
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue