Update BauSystem to new CommandFramework #217
@ -29,6 +29,14 @@ import java.util.List;
|
|||||||
public class SWUtils {
|
public class SWUtils {
|
||||||
|
|
||||||
public static void giveItemToPlayer(Player player, ItemStack itemStack) {
|
public static void giveItemToPlayer(Player player, ItemStack itemStack) {
|
||||||
|
for (int i = 0; i < player.getInventory().getSize(); i++) {
|
||||||
|
ItemStack current = player.getInventory().getItem(i);
|
||||||
|
if (current != null && current.isSimilar(itemStack)) {
|
||||||
|
player.getInventory().setItem(i, null);
|
||||||
|
itemStack = current;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
ItemStack current = player.getInventory().getItemInMainHand();
|
ItemStack current = player.getInventory().getItemInMainHand();
|
||||||
player.getInventory().setItemInMainHand(itemStack);
|
player.getInventory().setItemInMainHand(itemStack);
|
||||||
if (current.getType() != Material.AIR) {
|
if (current.getType() != Material.AIR) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren