Speed up pattern validation by using now-fixed cache (#3011)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.refinedmods.refinedstorage.inventory.item.validator;
|
||||
|
||||
import com.refinedmods.refinedstorage.RSItems;
|
||||
import com.refinedmods.refinedstorage.api.autocrafting.ICraftingPatternProvider;
|
||||
import com.refinedmods.refinedstorage.item.PatternItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -15,6 +17,9 @@ public class PatternItemValidator implements Predicate<ItemStack> {
|
||||
|
||||
@Override
|
||||
public boolean test(ItemStack stack) {
|
||||
if (stack.getItem() == RSItems.PATTERN.get()) {
|
||||
return PatternItem.fromCache(world, stack).isValid();
|
||||
}
|
||||
return stack.getItem() instanceof ICraftingPatternProvider && ((ICraftingPatternProvider) stack.getItem()).create(world, stack, null).isValid();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user