Fix item duplication bug

This commit is contained in:
GeorgH93 2020-05-01 17:37:51 +02:00
parent 5dcbcc6a05
commit 697e6c31d3
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -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);