Make all valid books work with shift-clicking and hopper insertion

This commit is contained in:
Electroblob77
2020-05-16 18:33:53 +01:00
parent cda9947e17
commit 594c546f11
2 changed files with 10 additions and 5 deletions
@@ -2,6 +2,7 @@ package electroblob.wizardry.tileentity;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.block.BlockBookshelf;
import electroblob.wizardry.inventory.ContainerBookshelf;
import electroblob.wizardry.item.ItemSpellBook;
import electroblob.wizardry.util.NBTExtras;
import net.minecraft.entity.player.EntityPlayer;
@@ -136,8 +137,8 @@ public class TileEntityBookshelf extends TileEntity implements IInventory, ITick
}
@Override
public boolean isItemValidForSlot(int slotNumber, ItemStack itemstack){
return itemstack.isEmpty() || itemstack.getItem() instanceof ItemSpellBook; // TODO: Add a whitelist
public boolean isItemValidForSlot(int slotNumber, ItemStack stack){
return stack.isEmpty() || ContainerBookshelf.isBook(stack);
}
@Override