mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-12-04 14:03:24 +01:00
Fix item duplication bug
This commit is contained in:
parent
5dcbcc6a05
commit
697e6c31d3
@ -166,8 +166,9 @@ public void onItemInteract(PlayerInteractEvent event)
|
||||
{
|
||||
if(allowRightClickOnContainers && event.getAction() == Action.RIGHT_CLICK_BLOCK)
|
||||
{
|
||||
return; //TODO testing
|
||||
//noinspection ConstantConditions
|
||||
if(containerMaterials.contains(event.getClickedBlock().getType())) return;
|
||||
//if(containerMaterials.contains(event.getClickedBlock().getType())) return;
|
||||
}
|
||||
event.getPlayer().performCommand(openCommand);
|
||||
event.setCancelled(true);
|
||||
@ -239,7 +240,7 @@ public void onItemClick(InventoryClickEvent event)
|
||||
{ // right click should place only one
|
||||
ItemStack place = stack.clone();
|
||||
place.setAmount(1);
|
||||
ItemStack full = backpack.addItem(stack);
|
||||
ItemStack full = backpack.addItem(place);
|
||||
if(full == null)
|
||||
{
|
||||
stack.setAmount(stack.getAmount() - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user