public static void loadPostCache() { for (int i = 0; i < researchList.length; i++) { ChromaResearch r = researchList[i]; if (!r.isDummiedOut()) { Collection<ItemStack> c = r.getItemStacks(); if (c != null) { for (ItemStack is : c) { if (is != null && is.getItem() != null) itemMap.put(is, r); } } Collection<CastingRecipe> crc = r.getCraftingRecipes(); for (CastingRecipe cr : crc) { cr.setFragment(r); } } } }
static { for (int i = 0; i < researchList.length; i++) { ChromaResearch r = researchList[i]; if (!r.isDummiedOut()) { if (r.level != null) levelMap.addValue(r.level, r); byName.put(r.name(), r); if (r.isParent) parents.add(r); else nonParents.add(r); } ChromaResearch pre = duplicateChecker.get(r.getIDObject()); if (pre != null) throw new RegistrationException( ChromatiCraft.instance, "Two research fragments have the same block/item/ability/etc: " + r + " & " + pre); duplicateChecker.put(r.getIDObject(), r); ChromaResearchManager.instance.register(r); } }
/** * Is this research one of the next ones available to the player, but without the player already * having it */ public boolean canPlayerStepTo(EntityPlayer ep, ChromaResearch r) { return !r.isDummiedOut() && this.getNextResearchesFor(ep).contains(r); }