public static void addResearch(ResearchItem ri) { ResearchCategoryList rl = getResearchList(ri.category); if (rl != null && !rl.research.containsKey(ri.key)) { rl.research.put(ri.key, ri); if (ri.displayColumn < rl.minDisplayColumn) { rl.minDisplayColumn = ri.displayColumn; } if (ri.displayRow < rl.minDisplayRow) { rl.minDisplayRow = ri.displayRow; } if (ri.displayColumn > rl.maxDisplayColumn) { rl.maxDisplayColumn = ri.displayColumn; } if (ri.displayRow > rl.maxDisplayRow) { rl.maxDisplayRow = ri.displayRow; } } }
public static void addResearch(ResearchItem ri) { ResearchCategoryList rl = getResearchList(ri.category); if (rl != null && !rl.research.containsKey(ri.key)) { if (!ri.isVirtual()) { for (ResearchItem rr : rl.research.values()) { if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) { FMLLog.log( Level.SEVERE, "[Thaumcraft] Research [" + ri.getName() + "] not added as it overlaps with existing research [" + rr.getName() + "]"); return; } } } rl.research.put(ri.key, ri); if (ri.displayColumn < rl.minDisplayColumn) { rl.minDisplayColumn = ri.displayColumn; } if (ri.displayRow < rl.minDisplayRow) { rl.minDisplayRow = ri.displayRow; } if (ri.displayColumn > rl.maxDisplayColumn) { rl.maxDisplayColumn = ri.displayColumn; } if (ri.displayRow > rl.maxDisplayRow) { rl.maxDisplayRow = ri.displayRow; } } }