Allow spells to be learned from double chests

This commit is contained in:
Nate Mortensen 2016-11-07 12:45:28 -07:00 committed by cnr
parent 181f360f11
commit 941be75161

View File

@ -1123,8 +1123,16 @@ public class Wizards extends SoloGame
@EventHandler
public void onClick(InventoryClickEvent event)
{
if (event.getClickedInventory() == null || !(event.getClickedInventory().getHolder() instanceof BlockState))
if (event.getClickedInventory() == null)
{
return;
}
InventoryHolder holder = event.getClickedInventory().getHolder();
// DoubleChests aren't a BlockState as they represent more than one block
if (!(holder instanceof BlockState || holder instanceof DoubleChest))
{
return;
}
ItemStack item = event.getCurrentItem();