Merge pull request 'Item Giver Improvements' (#194) from give-commands-improve into master
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
bbb1af71d3
@ -27,6 +27,9 @@ class CommandDebugStick_15 {
|
||||
private CommandDebugStick_15(){}
|
||||
|
||||
static void giveStick(Player player){
|
||||
player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK, 1));
|
||||
if(player.getInventory().getItemInMainHand().getType() == Material.AIR)
|
||||
player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK));
|
||||
else
|
||||
player.getInventory().addItem(new ItemStack(Material.DEBUG_STICK));
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.Permission;
|
||||
import de.steamwar.bausystem.world.Detonator;
|
||||
import de.steamwar.bausystem.world.Welt;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -62,7 +63,10 @@ public class CommandDetonator implements CommandExecutor {
|
||||
case "wand":
|
||||
case "detonator":
|
||||
case "item":
|
||||
player.getInventory().setItemInMainHand(Detonator.WAND);
|
||||
if(player.getInventory().getItemInMainHand().getType() == Material.AIR)
|
||||
player.getInventory().setItemInMainHand(Detonator.WAND);
|
||||
else
|
||||
player.getInventory().addItem(Detonator.WAND);
|
||||
player.updateInventory();
|
||||
Detonator.getDetonator(player);
|
||||
break;
|
||||
|
@ -21,6 +21,7 @@ package de.steamwar.bausystem.commands;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -46,7 +47,11 @@ public class CommandSkull implements CommandExecutor {
|
||||
assert sm != null;
|
||||
sm.setDisplayName("§e" + args[0] + "§8s Kopf");
|
||||
is.setItemMeta(sm);
|
||||
p.getInventory().setItemInMainHand(is);
|
||||
if(p.getInventory().getItemInMainHand().getType() == Material.AIR)
|
||||
p.getInventory().setItemInMainHand(is);
|
||||
else
|
||||
p.getInventory().addItem(is);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren