Remove slash from front of perform command

https://github.com/BentoBoxWorld/BentoBox/issues/1369
This commit is contained in:
tastybento 2020-05-26 12:31:56 -07:00
parent 502aaa87a4
commit 7b28c67db0
2 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ public abstract class DefaultPlayerCommand extends CompositeCommand
String command = this.<GameModeAddon>getAddon().getWorldSettings().getDefaultPlayerAction();
// Perform command or use "go" command.
if (command != null && user.performCommand("/" + label + " " + command))
if (command != null && user.performCommand(label + " " + command))
{
return true;
}
@ -124,7 +124,7 @@ public abstract class DefaultPlayerCommand extends CompositeCommand
String command = this.<GameModeAddon>getAddon().getWorldSettings().getDefaultNewPlayerAction();
// Perform command or use "create" command.
if (command != null && user.performCommand("/" + label + " " + command))
if (command != null && user.performCommand(label + " " + command))
{
return true;
}

View File

@ -535,7 +535,7 @@ public class User {
public boolean performCommand(String command) {
PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(getPlayer(), command);
Bukkit.getPluginManager().callEvent(event);
// only perform the command, if the event wasn't cancelled by an other plugin:
if (!event.isCancelled()) {
return getPlayer().performCommand(event.getMessage());