mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Stops constant calls to getByItem() for empty book stacks.
This commit is contained in:
parent
e3bbf4b442
commit
cc5e7c6e13
@ -97,7 +97,10 @@ public class AutoDisenchanter extends AContainer {
|
|||||||
ItemStack item = BlockStorage.getInventory(b).getItemInSlot(slot);
|
ItemStack item = BlockStorage.getInventory(b).getItemInSlot(slot);
|
||||||
|
|
||||||
// Check if disenchantable
|
// 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;
|
if (sfItem != null && !sfItem.isDisenchantable()) return;
|
||||||
|
|
||||||
// Disenchant
|
// Disenchant
|
||||||
|
Loading…
Reference in New Issue
Block a user