Implement debug stick command
Dieser Commit ist enthalten in:
Ursprung
e4a7164dd3
Commit
b8a2739512
@ -0,0 +1,13 @@
|
|||||||
|
package de.steamwar.bausystem.commands;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
class CommandDebugStick_15 {
|
||||||
|
private CommandDebugStick_15(){}
|
||||||
|
|
||||||
|
static void giveStick(Player player){
|
||||||
|
player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK, 1));
|
||||||
|
}
|
||||||
|
}
|
@ -88,6 +88,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
getCommand("skull").setExecutor(new CommandSkull());
|
getCommand("skull").setExecutor(new CommandSkull());
|
||||||
getCommand("loader").setExecutor(new CommandLoader());
|
getCommand("loader").setExecutor(new CommandLoader());
|
||||||
getCommand("lockschem").setExecutor(new CommandLockschem());
|
getCommand("lockschem").setExecutor(new CommandLockschem());
|
||||||
|
getCommand("debugstick").setExecutor(new CommandDebugStick());
|
||||||
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, this);
|
Bukkit.getPluginManager().registerEvents(this, this);
|
||||||
Bukkit.getPluginManager().registerEvents(new RegionListener(), this);
|
Bukkit.getPluginManager().registerEvents(new RegionListener(), this);
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package de.steamwar.bausystem.commands;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.world.Welt;
|
||||||
|
import de.steamwar.core.Core;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class CommandDebugStick implements CommandExecutor {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if(!(sender instanceof Player))
|
||||||
|
return false;
|
||||||
|
Player player = (Player) sender;
|
||||||
|
|
||||||
|
if (Welt.noPermission(player, Permission.build)){
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "§cKein Debugstick für dich hier.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(Core.getVersion()){
|
||||||
|
case 15:
|
||||||
|
CommandDebugStick_15.giveStick(player);
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
default:
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "§cDen Debugstick gibt es nicht in der 1.12.");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,7 @@ main: de.steamwar.bausystem.BauSystem
|
|||||||
api-version: "1.13"
|
api-version: "1.13"
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
debugstick:
|
||||||
tnt:
|
tnt:
|
||||||
fire:
|
fire:
|
||||||
trace:
|
trace:
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren