Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void removeInventoryItem(Inventory inv,chestItem ch) {
- ItemStack[] ls = inv.getContents();
- for(ItemStack is : ls) {
- if (compareItem(is,ch)) {
- if (is.getAmount()<=1) {
- is.setType(Material.AIR);
- is.setAmount(0);
- }
- else {
- is.setAmount(is.getAmount()-1);
- }
- break;
- }
- }
- inv.setContents(ls);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement