Remove backpack item if user does not have the permission to use it

This commit is contained in:
GeorgH93 2023-12-08 11:13:15 +01:00
parent d11f959ead
commit 26abcf31e4
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
1 changed files with 11 additions and 0 deletions

View File

@ -120,6 +120,17 @@ public class ItemShortcut extends MinepacksListener
player.getInventory().addItem(HeadUtils.fromBase64(value, itemName, MINEPACKS_UUID));
}
}
else
{
for(ItemStack itemStack : player.getInventory())
{
if(isItemShortcut(itemStack))
{
player.getInventory().remove(itemStack);
return;
}
}
}
}
private void removeItem(Player player)