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