Update BauSystem to new CommandFramework #217
@ -93,7 +93,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
||||
new CommandDebugStick();
|
||||
getCommand("watervision").setExecutor(new CommandGills());
|
||||
new CommandDetonator();
|
||||
getCommand("script").setExecutor(new CommandScript());
|
||||
new CommandScript();
|
||||
getCommand("scriptvars").setExecutor(new CommandScriptVars());
|
||||
getCommand("scriptvars").setTabCompleter(new CommandScriptVarsTabCompleter());
|
||||
new CommandSimulator();
|
||||
|
@ -22,10 +22,8 @@
|
||||
package de.steamwar.bausystem.commands;
|
||||
|
||||
import de.steamwar.bausystem.SWUtils;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BookMeta;
|
||||
@ -33,7 +31,11 @@ import org.bukkit.inventory.meta.BookMeta;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandScript implements CommandExecutor {
|
||||
public class CommandScript extends SWCommand {
|
||||
|
||||
public CommandScript() {
|
||||
super("script");
|
||||
}
|
||||
|
||||
public static final ItemStack BOOK = new ItemStack(Material.WRITTEN_BOOK, 1);
|
||||
|
||||
@ -79,13 +81,9 @@ public class CommandScript implements CommandExecutor {
|
||||
BOOK.setItemMeta(bookMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
SWUtils.giveItemToPlayer((Player) sender, BOOK);
|
||||
return false;
|
||||
@Register
|
||||
public void giveCommand(Player p) {
|
||||
SWUtils.giveItemToPlayer(p, BOOK);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ commands:
|
||||
watervision:
|
||||
aliases: wv
|
||||
lockschem:
|
||||
script:
|
||||
scriptvars:
|
||||
gui:
|
||||
redstonetester:
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren