1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Stops constant calls to getByItem() for empty book stacks.

This commit is contained in:
Rick 2018-05-03 23:21:14 -04:00
parent e3bbf4b442
commit cc5e7c6e13

View File

@ -97,7 +97,10 @@ public class AutoDisenchanter extends AContainer {
ItemStack item = BlockStorage.getInventory(b).getItemInSlot(slot);
// Check if disenchantable
SlimefunItem sfItem = SlimefunItem.getByItem(item);
SlimefunItem sfItem = null;
if ((item != null) && (item.getType() != Material.BOOK)) { // stops endless checks of getByItem for empty book stacks.
sfItem = SlimefunItem.getByItem(item);
}
if (sfItem != null && !sfItem.isDisenchantable()) return;
// Disenchant