From 8595d27f4181f11006586442e42e03988a329c58 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sun, 2 Sep 2018 22:21:21 -0500 Subject: [PATCH] Eliminate lots of itemstack copying in pure daisy recipe matching. Should give enough of a lag improvement until 1.13 gets here :P --- .../botania/api/recipe/RecipePureDaisy.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java b/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java index 2eb44eaa8..39e4921c4 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java @@ -26,7 +26,6 @@ import java.util.Map; public class RecipePureDaisy { public static final int DEFAULT_TIME = 150; - private static final Map> oreMap = new HashMap<>(); private final Object input; private final IBlockState outputState; @@ -64,21 +63,10 @@ public class RecipePureDaisy { if(stack.isEmpty()) return false; - List ores; - if(oreMap.containsKey(entry)) - ores = oreMap.get(entry); - else { - ores = OreDictionary.getOres(entry); - oreMap.put(entry, ores); - } - - for(ItemStack ostack : ores) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) + for(ItemStack ostack : OreDictionary.getOres(entry, false)) { + if(OreDictionary.itemMatches(ostack, stack, false)) { return true; + } } return false;