Improve SWUtils.giveItemToPlayer #218
@ -29,6 +29,14 @@ import java.util.List;
|
||||
public class SWUtils {
|
||||
|
||||
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();
|
||||
player.getInventory().setItemInMainHand(itemStack);
|
||||
if (current.getType() != Material.AIR) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren