mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2025-01-04 18:57:47 +01:00
Fixed item frames logging incorrect item amounts (fixes #477)
This commit is contained in:
parent
4308d4afca
commit
1c57ba52aa
@ -75,6 +75,9 @@ public final class PlayerInteractEntityListener extends Queue implements Listene
|
|||||||
if (frame.getItem().getType().equals(Material.AIR) && !handItem.getType().equals(Material.AIR)) { // add item to item frame
|
if (frame.getItem().getType().equals(Material.AIR) && !handItem.getType().equals(Material.AIR)) { // add item to item frame
|
||||||
ItemStack[] oldState = new ItemStack[] { new ItemStack(Material.AIR) };
|
ItemStack[] oldState = new ItemStack[] { new ItemStack(Material.AIR) };
|
||||||
ItemStack[] newState = new ItemStack[] { handItem.clone() };
|
ItemStack[] newState = new ItemStack[] { handItem.clone() };
|
||||||
|
if (newState[0].getAmount() > 1) {
|
||||||
|
newState[0].setAmount(1); // never add more than 1 item to an item frame at once
|
||||||
|
}
|
||||||
queueContainerSpecifiedItems(player.getName(), Material.ITEM_FRAME, new Object[] { oldState, newState, frame.getFacing() }, frame.getLocation(), false);
|
queueContainerSpecifiedItems(player.getName(), Material.ITEM_FRAME, new Object[] { oldState, newState, frame.getFacing() }, frame.getLocation(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user