MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / OreDictManager

Class OreDictManager

src/main/java/gregapi/oredict/OreDictManager.java:61–820  ·  view source on GitHub ↗

@author Gregorius Techneticies This Class is for filtering out the Private and Invalid OreDictionary Events and passing the proper ones to any interested User. It also contains a lot of Utility, which was formerly inside the OreDictUnificator.

Source from the content-addressed store, hash-verified

59 * It also contains a lot of Utility, which was formerly inside the OreDictUnificator.
60 */
61public final class OreDictManager {
62 public static final OreDictManager INSTANCE = new OreDictManager();
63
64 /** Those Listeners can also be registered at certain Prefixes in order to only get their Events */
65 private final Set<IOreDictListenerEvent> mGlobalOreDictListeners = new HashSetNoNulls<>();
66 private final Set<OreDictRegistrationContainer> mGlobalRegistrations = new HashSetNoNulls<>();
67
68 /** These Listeners always get notified if an Item gets a recyclable ItemData Tag attached to it. */
69 private final Set<IOreDictListenerRecyclable> mRecyclableOreDictListeners = new HashSetNoNulls<>();
70 private final Set<OreDictRecyclingContainer> mRecyclableRegistrations = new HashSetNoNulls<>();
71
72 /** Put OreDict Strings which should be registered as something else, right here using addReRegistration */
73 private final Map<String, Collection<String>> mReRegistrationMappings = new HashMap<>();
74 /** Assign Item Data to certain OreDict Strings for recycling and similar. Used for plankWood and slabWood for example.*/
75 private final Map<String, OreDictItemData> mStringToItemDataMappings = new HashMap<>();
76 private final Map<String, Collection<OreDictMaterial>> mVisibilityTriggers = new HashMap<>();
77
78 /** Lists all Names (with their Prefixes) which don't have a Material assigned to them. */
79 private final Set<String> mUnknownMaterials = new HashSetNoNulls<>();
80 /** Lists all Names which don't have a Prefix assigned to them. */
81 private final Set<String> mUnknownNames = new HashSetNoNulls<>();
82 /** Lists all Names which get automatically blacklisted. */
83 private final Set<String> mAutoBlackListedNames = new HashSetNoNulls<>();
84 /** Lists all Mods whiches Items get automatically blacklisted. Needed for TerraFirmaCraft. */
85 private final Set<String> mAutoBlackListedMods = new HashSetNoNulls<>();
86 /** Lists all Names which are definitely not unknown. */
87 private final Set<String> mKnownNames = new HashSetNoNulls<>(F
88 , "oreHeeInstabilityOrb", "oreHeeEndPowder", "oreHeeIgneousRock", "oreHeeStardust", "oreBituminousCoal", "oreBrimstone"
89 , "rennetSource", "yeastBrewers", "yeastLager", "yeastBayanus", "yeastEthereal", "yeastOrigin"
90 , "holystone", "darkStone", "whiteStone", "brightStone", "lavastone"
91 , "mycelium", "podzol", "grass", "soulSand", "taintedSoil"
92 , "snowLayer", "ice", "cloud"
93 , "antiBlock", "transdimBlock"
94 , "carpet", "pendant"
95 , "tyrian", "arcaneAsh", "camoPaste", "burntQuartz", "KangarooPaw", "redstoneRoot", "pigment", "diamondShard", "eternalLifeEssence", "honeyDrop", "grubBee", "salmonRaw", "stringFluxed", "aquaRegia", "sludge", "lexicaBotania", "resourceTaint", "chainLink", "sulfuricAcid", "scribingTools", "bacon", "redalloyBundled", "bluestoneInsulated", "infusedteslatiteInsulated", "bluestoneBundled", "redalloyInsulated", "infusedteslatiteBundled", "universalCable", "laserReceptor", "laserEmitter", "laserFocus", "laserMirror", "mobEgg"
96// , "torchRedstoneActive"
97 , "awesomeiteHammer", "awesomeCore"
98 , "bPlaceholder", "bVial", "bRedString", "bEnderAirBottle", "bFlask", "brDeviceCyaniteProcessor", "prbackpack"
99// , "stonebrick", "stoneAndesiteBricks", "stoneDioriteChiseled", "stoneAndesiteChiseled", "stoneDioritePolished", "stoneAndesitePolished", "stoneDioriteBricks", "stoneBasaltChiseled", "stoneGraniteChiseled", "stoneBasaltBricks", "stoneBasaltPolished", "stoneGraniteBricks", "stoneGranitePolished"
100// , "stoneBrown", "stonePink", "stoneGreen", "stoneWhite", "stoneMagenta", "stoneBlue", "stoneOrange", "stonePurple", "stoneGray", "stoneYellow", "stoneLime", "stoneCyan", "stoneLightBlue", "stoneLightGray"
101 , "diamondNugget", "UUMatter", "gaiaIngot", "pebble", "treatedStick", "universalReactant", "matterDustRefined", "sourceVegetableOil", "matterDust", "drawerBasic"
102 , "hempBrick", "hempBlock", "savehempBrick", "savehempBlock", "saveplatedHempBrick", "saveplatedHempBlock", "platedHempBrick", "platedHempBlock", "platedHemp", "savehemp", "saveplatedHemp"
103 );
104 /** Lists all Names which should not be processed due to technical Issues. */
105 private final Set<String> mIgnoredNames = new HashSetNoNulls<>(F, "rawMeat", "cookedMeat", "rawRubber", "plateTungCar", "ingotRefinedGlowstone", "ingotRefinedObsidian", "oreCompass", "oreBentonite", "oreFullersEarth", "oreKaolinite", "dustRefinedObsidian", "dustRefinedGlowstone", "oreNetherQuartz", "oreNetherite", "oreBasalticMineralSand", "oreLifeCrystal", "cropMaplesyrup", "oreTritanium", "oreDuranium", "plateLapis", "shardEntropy", "shardAir", "shardWater", "shardEarth", "shardFire", "shardOrder", "greggy_greg_do_please_kindly_stuff_a_sock_in_it", "halfSheetCylinderMetal", "halfSheetMetal", "quarterSheetMetal", "sheetCurvedFourMetal", "sheetCurvedOneMetal", "sheetCurvedThreeMetal", "sheetCurvedTwoMetal", "sheetCylinderMetal", "sheetMediumConeMetal", "sheetMetal", "sheetMicroConeMetal", "sheetMicroFinMetal", "sheetSmallConeMetal", "sheetSmallCylinderMetal", "sheetSmallFinMetal", "shirtSheetMetal", "rivetSheetMetal", "triangleSheetMetal");
106 /** Lists all Names which have already been registered. Used for the OreDict Listeners, so that certain Recipes (such as Crafting) don't get registered twice.*/
107 private final Set<String> mAlreadyRegisteredNames = new HashSetNoNulls<>();
108 /** Used to check if Recipe Outputs accidentally contain uncopied OreDict Items. */
109 private final Set<ItemStack> mAllRegisteredOres = new HashSetNoNulls<>();
110
111 /** The Unification Config File */
112 public Config mUnificationConfig;
113
114 private boolean mIsRunningInIterationMode = F;
115
116 private OreDictManager() {
117 mIsRunningInIterationMode = T;
118 for (String tOreName : OreDictionary.getOreNames()) for (ItemStack tOreStack : OreDictionary.getOres(tOreName, F)) onOreRegistration1(new OreRegisterEvent(tOreName, tOreStack));

Callers

nothing calls this directly

Calls 1

hashsetMethod · 0.95

Tested by

no test coverage detected