diff --git a/api/common/build.gradle b/api/common/build.gradle index 5e4e3829a..c75f8b51b 100644 --- a/api/common/build.gradle +++ b/api/common/build.gradle @@ -20,7 +20,7 @@ tasks.named('test') { } group = 'gregtech' -version = '1.8.0' +version = '1.9.0' base { archivesName = 'gt6ce-api' } java { diff --git a/api/common/src/main/java/gregtech/api/addon/GregTechAddons.java b/api/common/src/main/java/gregtech/api/addon/GregTechAddons.java index fc432cce3..06869bd91 100644 --- a/api/common/src/main/java/gregtech/api/addon/GregTechAddons.java +++ b/api/common/src/main/java/gregtech/api/addon/GregTechAddons.java @@ -14,11 +14,11 @@ */ public final class GregTechAddons { private static final int API_MAJOR = 1; - private static final int API_MINOR = 8; + private static final int API_MINOR = 9; /** * Monotonic version code of the independent API artifact: {@code major * 1000 + minor}. - * The current 1.8 release reports 1008. Development builds still need a matching SDK and host + * The current 1.9 release reports 1009. Development builds still need a matching SDK and host * runtime; this number alone does not check the installed mod or Minecraft version. * *

Not a compile-time constant. A {@code static final} primitive set to a literal is copied into diff --git a/api/common/src/main/java/gregtech/api/addon/material/MaterialCatalogView.java b/api/common/src/main/java/gregtech/api/addon/material/MaterialCatalogView.java index d7745f0f8..f97d2e15e 100644 --- a/api/common/src/main/java/gregtech/api/addon/material/MaterialCatalogView.java +++ b/api/common/src/main/java/gregtech/api/addon/material/MaterialCatalogView.java @@ -27,4 +27,8 @@ default MaterialFormsView formBindings() { default MaterialProcessesView processes() { throw new UnsupportedOperationException("This material catalog does not expose process views"); } + /** Immutable special-process method declarations captured with this definition view. */ + default SpecialProcessesView specialProcesses() { + throw new UnsupportedOperationException("This material catalog does not expose special processes"); + } } diff --git a/api/common/src/main/java/gregtech/api/addon/material/MaterialInfoTool.java b/api/common/src/main/java/gregtech/api/addon/material/MaterialInfoTool.java index 15ec22cbb..45dd1caab 100644 --- a/api/common/src/main/java/gregtech/api/addon/material/MaterialInfoTool.java +++ b/api/common/src/main/java/gregtech/api/addon/material/MaterialInfoTool.java @@ -171,6 +171,11 @@ public interface Registrar { Registrar registerGroup(MaterialGroupDeclaration declaration); + /** Declares one special process method; target and reagent rules use its typed process key. */ + default Registrar registerSpecialProcess(SpecialProcessMethod method) { + throw new UnsupportedOperationException("This material info host does not expose special processes"); + } + /** * Registers a typed process rule. The rule value must be treated as immutable after this call. */ diff --git a/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessMethod.java b/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessMethod.java new file mode 100644 index 000000000..46fe1caca --- /dev/null +++ b/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessMethod.java @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: LGPL-3.0-or-later */ + +package gregtech.api.addon.material; + +import java.util.Objects; + +/** + * One special process method. Target and reagent materials attach {@link SpecialProcessValue} + * rules through the same {@link MaterialProcessKey}. + */ +public record SpecialProcessMethod( + MaterialProcessKey process, + String recipeMap, + String displayNameKey) { + public SpecialProcessMethod { + Objects.requireNonNull(process, "process"); + if (process.type() != SpecialProcessValue.class) + throw new IllegalArgumentException("Special process method has the wrong process value type"); + if (recipeMap == null || recipeMap.isBlank()) + throw new IllegalArgumentException("Special process method has no recipe map"); + if (displayNameKey == null || displayNameKey.isBlank()) + throw new IllegalArgumentException("Special process method has no display name key"); + } + + /** Material classification tag assigned to every processable material. */ + public DataKey targetTag() { + return new DataKey(process.id().namespace(), process.id().path() + "/target"); + } + + /** Material classification tag assigned to every processing reagent. */ + public DataKey reagentTag() { + return new DataKey(process.id().namespace(), process.id().path() + "/reagent"); + } +} diff --git a/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessValue.java b/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessValue.java new file mode 100644 index 000000000..5bbfc90ac --- /dev/null +++ b/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessValue.java @@ -0,0 +1,71 @@ +/* SPDX-License-Identifier: LGPL-3.0-or-later */ + +package gregtech.api.addon.material; + +import java.util.List; +import java.util.Objects; + +/** + * A target or reagent rule for one declared special process method. Values are caller-owned and + * must be treated as immutable after registration. + */ +public sealed interface SpecialProcessValue permits SpecialProcessValue.Target, SpecialProcessValue.Reagent { + /** + * One processable material's recipe plan. The process rule's form set names accepted inputs; + * {@link #inputCounts()} supplies the exact item count for every accepted form. + */ + record Target( + java.util.Map inputCounts, + List itemOutputs, + List fluidOutputs, + long reagentAmount, + long duration, + long euPerTick) + implements SpecialProcessValue { + public Target { + inputCounts = java.util.Map.copyOf(inputCounts); + if (inputCounts.isEmpty()) throw new IllegalArgumentException("Special process target has no input form"); + for (var entry : inputCounts.entrySet()) { + Objects.requireNonNull(entry.getKey(), "input form"); + if (entry.getValue() < 1) throw new IllegalArgumentException("Invalid special process input count"); + } + itemOutputs = List.copyOf(itemOutputs); + fluidOutputs = List.copyOf(fluidOutputs); + if (itemOutputs.isEmpty() && fluidOutputs.isEmpty()) + throw new IllegalArgumentException("Special process target has no output"); + if (reagentAmount < 1 || duration < 1 || euPerTick < 0) + throw new IllegalArgumentException("Invalid special process target quantities"); + } + } + + /** Marks one reagent material and its accepted forms through the enclosing process rule. */ + record Reagent() implements SpecialProcessValue {} + + /** One output material and ordered form alternatives. The first available form wins. */ + record ItemOutput(MaterialKey material, List forms, int chance) { + public ItemOutput { + Objects.requireNonNull(material, "output material"); + forms = List.copyOf(forms); + if (forms.isEmpty()) throw new IllegalArgumentException("Item output has no form"); + if (chance < 1 || chance > 10_000) throw new IllegalArgumentException("Invalid output chance"); + } + } + + /** One certain fluid output and ordered phase/form alternatives. */ + record FluidOutput(MaterialKey material, List forms, int millibuckets) { + public FluidOutput { + Objects.requireNonNull(material, "output material"); + forms = List.copyOf(forms); + if (forms.isEmpty() || millibuckets < 1) + throw new IllegalArgumentException("Invalid fluid output"); + } + } + + /** A form and the concrete item count or millibucket amount emitted in that form. */ + record FormCount(FormKey form, int count) { + public FormCount { + Objects.requireNonNull(form, "form"); + if (count < 1) throw new IllegalArgumentException("Form count must be positive"); + } + } +} diff --git a/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessesView.java b/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessesView.java new file mode 100644 index 000000000..d7e40caa7 --- /dev/null +++ b/api/common/src/main/java/gregtech/api/addon/material/SpecialProcessesView.java @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: LGPL-3.0-or-later */ + +package gregtech.api.addon.material; + +import java.util.List; +import java.util.Optional; + +/** Immutable special-process method declarations from the current material publication. */ +public interface SpecialProcessesView { + List methods(); + + Optional find(DataKey id); +} diff --git a/api/common/src/main/java/gregtech/api/addon/material/package-info.java b/api/common/src/main/java/gregtech/api/addon/material/package-info.java index 10bf43484..7a9cfb1d5 100644 --- a/api/common/src/main/java/gregtech/api/addon/material/package-info.java +++ b/api/common/src/main/java/gregtech/api/addon/material/package-info.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-3.0-or-later */ -/** Addon material, prefix, composition, metadata, tag, group and process declarations. */ +/** Addon material, prefix, composition, metadata, tag, group, process and special-process declarations. */ @NullMarked package gregtech.api.addon.material; diff --git a/api/common/src/test/java/gregtech/api/addon/GregTechAddonsTest.java b/api/common/src/test/java/gregtech/api/addon/GregTechAddonsTest.java index 4a7cac89f..647535233 100644 --- a/api/common/src/test/java/gregtech/api/addon/GregTechAddonsTest.java +++ b/api/common/src/test/java/gregtech/api/addon/GregTechAddonsTest.java @@ -23,8 +23,8 @@ void reset() { void apiVersionCodeMatchesTheMajorAndMinorParts() { assertEquals(GregTechAddons.apiMajor() * 1000 + GregTechAddons.apiMinor(), GregTechAddons.apiVersion()); assertEquals(1, GregTechAddons.apiMajor()); - assertEquals(8, GregTechAddons.apiMinor()); - assertEquals(1008, GregTechAddons.apiVersion()); + assertEquals(9, GregTechAddons.apiMinor()); + assertEquals(1009, GregTechAddons.apiVersion()); } @Test diff --git a/api/common/src/test/java/gregtech/api/addon/material/SpecialProcessValueTest.java b/api/common/src/test/java/gregtech/api/addon/material/SpecialProcessValueTest.java new file mode 100644 index 000000000..b016f0b3a --- /dev/null +++ b/api/common/src/test/java/gregtech/api/addon/material/SpecialProcessValueTest.java @@ -0,0 +1,73 @@ +package gregtech.api.addon.material; + +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +final class SpecialProcessValueTest { + @Test + void methodDerivesStableMaterialTags() { + var method = new SpecialProcessMethod( + MaterialProcessKey.multiple( + new DataKey("example", "special_process/wash"), SpecialProcessValue.class), + "gt.recipe.bath", + "example.special_process.wash"); + + assertEquals(new DataKey("example", "special_process/wash/target"), method.targetTag()); + assertEquals(new DataKey("example", "special_process/wash/reagent"), method.reagentTag()); + } + + @Test + void targetRejectsIncompleteRecipePlans() { + var output = new SpecialProcessValue.ItemOutput( + new MaterialKey("Iron"), + List.of(new SpecialProcessValue.FormCount(new FormKey("dust"), 1)), + 10_000); + + assertThrows( + IllegalArgumentException.class, + () -> new SpecialProcessValue.Target( + Map.of(), List.of(output), List.of(), 1, 1, 0)); + assertThrows( + IllegalArgumentException.class, + () -> new SpecialProcessValue.Target( + Map.of(new FormKey("dust"), 1), List.of(), List.of(), 1, 1, 0)); + } + + @Test + void unsupportedCatalogFailsExplicitly() { + MaterialCatalogView catalog = new MaterialCatalogView() { + @Override + public long revision() { + return 0; + } + + @Override + public Optional resolve(String name) { + return Optional.empty(); + } + + @Override + public MaterialTagsView tags() { + throw new UnsupportedOperationException(); + } + + @Override + public Optional find(MaterialKey key) { + return Optional.empty(); + } + + @Override + public List materials() { + return List.of(); + } + }; + + assertThrows(UnsupportedOperationException.class, catalog::specialProcesses); + } +} diff --git a/api/common/src/test/java/gregtech/api/contracts/MaterialViewContracts.java b/api/common/src/test/java/gregtech/api/contracts/MaterialViewContracts.java index b64a0fba8..f81da250a 100644 --- a/api/common/src/test/java/gregtech/api/contracts/MaterialViewContracts.java +++ b/api/common/src/test/java/gregtech/api/contracts/MaterialViewContracts.java @@ -2,6 +2,7 @@ package gregtech.api.contracts; import gregtech.api.addon.material.*; + import java.util.List; /** Only the delivered API JAR participates in this consumer. */ @@ -41,6 +42,20 @@ public List> processes() { || contributor.materialGroups().size() != 1 || contributor.processes().size() != 1) throw new AssertionError("tag, group and process SPI"); + var specialKey = MaterialProcessKey.multiple( + new DataKey("consumer", "special_process/wash"), SpecialProcessValue.class); + var method = new SpecialProcessMethod(specialKey, "gt.recipe.bath", "consumer.special.wash"); + var target = new SpecialProcessValue.Target( + java.util.Map.of(new FormKey("dust"), 1), + List.of(new SpecialProcessValue.ItemOutput( + key, List.of(new SpecialProcessValue.FormCount(new FormKey("dust"), 1)), 10_000)), + List.of(), + 1, + 1, + 0); + if (!method.targetTag().equals(new DataKey("consumer", "special_process/wash/target")) + || !(target.itemOutputs().get(0).material().equals(key))) + throw new AssertionError("special process contract"); try { GregTechMaterials.catalog(); throw new AssertionError("unbound host must fail"); } catch (IllegalStateException expected) { } } diff --git a/core/src/main/java/gregtech/content/block/stone/OreHostFacts.java b/core/src/main/java/gregtech/content/block/stone/OreHostFacts.java new file mode 100644 index 000000000..5da8580f5 --- /dev/null +++ b/core/src/main/java/gregtech/content/block/stone/OreHostFacts.java @@ -0,0 +1,119 @@ +package gregtech.content.block.stone; + +import static gregtech.api.material.GTValues.U; +import static gregtech.content.material.MaterialFactKeys.Decision; +import static gregtech.content.material.MaterialFactKeys.Identity; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Source ore-host prefixes, gangue composition and broken-ore pairing. */ +public final class OreHostFacts { + private OreHostFacts() {} + + public record HostProfile( + String sourcePrefix, Identity gangueMaterial, long gangueAmount, boolean hexoriumAdjusted) { + public HostProfile { + Objects.requireNonNull(sourcePrefix); + if (gangueAmount < 0) throw new IllegalArgumentException("Negative gangue amount"); + if (gangueAmount > 0) Objects.requireNonNull(gangueMaterial); + } + + public boolean hasGangue() { + return gangueAmount > 0; + } + } + + private static final Map HOSTS = createHosts(); + private static final Set BROKEN_SOURCE_PAIRS = Set.of( + "oreVanillastone", + "oreNetherrack", + "oreEndstone", + "oreBlackgranite", + "oreRedgranite", + "oreBasalt", + "oreMarble", + "oreLimestone", + "oreVanillagranite", + "oreDiorite", + "oreAndesite", + "oreKomatiite", + "oreGreenschist", + "oreBlueschist", + "oreKimberlite", + "oreQuartzite", + "oreLightprismarine", + "oreDarkprismarine", + "oreSlate", + "oreShale"); + + public static HostProfile hostProfile(String nativeHostId) { + return nativeHostId == null ? null : HOSTS.get(nativeHostId); + } + + public static Decision hostDecision(String nativeHostId) { + if (hostProfile(nativeHostId) != null) return Decision.YES; + if ("bedrock".equals(nativeHostId) + || "sand".equals(nativeHostId) + || "red_sand".equals(nativeHostId) + || "gravel".equals(nativeHostId) + || "mud".equals(nativeHostId)) return Decision.NO; + return Decision.UNKNOWN; + } + + public static boolean hasBrokenSourcePair(String nativeHostId) { + HostProfile profile = hostProfile(nativeHostId); + return profile != null && BROKEN_SOURCE_PAIRS.contains(profile.sourcePrefix()); + } + + private static Map createHosts() { + var result = new LinkedHashMap(); + host(result, "oreVanillastone", 8500, "Stone", false, "stone"); + host(result, "oreVanillagranite", 8518, "Granite", false, "granite", "stone_granite"); + host(result, "oreDiorite", 8511, "Diorite", false, "diorite", "stone_diorite"); + host(result, "oreAndesite", 9188, "Andesite", false, "andesite", "stone_andesite"); + host(result, "oreDeepslate", 9248, "Deepslate", true, "deepslate"); + host(result, "oreNetherrack", 8502, "Netherrack", true, "netherrack"); + host(result, "oreEndstone", 8504, "Endstone", false, "end_stone"); + host(result, "oreBlackgranite", 8508, "GraniteBlack", false, "stone_granite_black"); + host(result, "oreRedgranite", 8507, "GraniteRed", false, "stone_granite_red"); + host(result, "oreKomatiite", 9177, "Komatiite", true, "stone_komatiite"); + host(result, "oreBasalt", 8505, "Basalt", true, "stone_basalt"); + host(result, "oreMarble", 8506, "Marble", false, "stone_marble"); + host(result, "oreLimestone", 9189, "Limestone", false, "stone_limestone"); + host(result, "oreShale", 9190, "Shale", false, "stone_shale"); + host(result, "oreSlate", 9222, "Slate", false, "stone_slate"); + host(result, "oreGreenschist", 9171, "Greenschist", false, "stone_greenschist"); + host(result, "oreBlueschist", 9184, "Blueschist", false, "stone_blueschist"); + host(result, "oreLightprismarine", 9219, "Prismarine", false, "stone_prismarine_light"); + host(result, "oreDarkprismarine", 9220, "PrismarineDark", false, "stone_prismarine_dark"); + host(result, "oreKimberlite", 9218, "Kimberlite", false, "stone_kimberlite"); + host(result, "oreQuartzite", 9180, "Quartzite", false, "stone_quartzite"); + if (result.put("sandstone", new HostProfile("oreSandstone", null, 0, false)) != null) + throw new IllegalStateException("Duplicate source host sandstone"); + portHost(result, "gypsum", 9161, "Gypsum"); + portHost(result, "salt", 8204, "Salt"); + return Map.copyOf(result); + } + + private static void host( + Map result, + String prefix, + int materialId, + String canonicalName, + boolean adjusted, + String... nativeHostIds) { + var profile = new HostProfile(prefix, new Identity(materialId, canonicalName), 4 * U, adjusted); + for (String host : nativeHostIds) + if (result.put(host, profile) != null) throw new IllegalStateException("Duplicate source host " + host); + } + + private static void portHost(Map result, String stone, int materialId, String name) { + String host = "stone_" + stone; + String prefix = "portOre" + Character.toUpperCase(stone.charAt(0)) + stone.substring(1); + if (result.put(host, new HostProfile(prefix, new Identity(materialId, name), 4 * U, false)) != null) + throw new IllegalStateException("Duplicate source host " + host); + } +} diff --git a/core/src/main/java/gregtech/content/block/wood/WoodSpecies.java b/core/src/main/java/gregtech/content/block/wood/WoodSpecies.java index ef3ba20eb..7eb5ea21a 100644 --- a/core/src/main/java/gregtech/content/block/wood/WoodSpecies.java +++ b/core/src/main/java/gregtech/content/block/wood/WoodSpecies.java @@ -46,9 +46,4 @@ public boolean fireproof() { public String enName() { return enName; } - /** Compatibility only; localized names come from language resources. */ - @Deprecated - public String zhName() { - return enName; - } } diff --git a/core/src/main/java/gregtech/content/data/FluidCatalog.java b/core/src/main/java/gregtech/content/data/FluidCatalog.java index b14eb7053..a2d5c9a72 100644 --- a/core/src/main/java/gregtech/content/data/FluidCatalog.java +++ b/core/src/main/java/gregtech/content/data/FluidCatalog.java @@ -3,6 +3,8 @@ import gregtech.api.material.GTMaterial; import gregtech.api.material.MaterialProperty; import gregtech.content.data.generated.MaterialForms; +import gregtech.content.material.MaterialDefinitions; +import gregtech.content.material.MaterialFactKeys; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Locale; @@ -991,33 +993,16 @@ public static Map all() { } /** - * Missing imported MOLTEN declarations, not new general material properties. - * GT6 3703e40308c8c030763fd6297dea8b210d2a77b1 MT; - * Loader_Fluids creates these phases through FL.createMolten. - * Keep this finite ID/name proof local to fluid generation: MELTING, METAL, item forms, - * targets and compatibility overrides must not be inferred or mutated from it. + * Missing imported MOLTEN declarations are material facts. Fluid generation only consumes the + * typed process; MELTING, METAL, item forms, targets and overrides are not inferred from it. */ - private static boolean hasReviewedSourceMoltenPhase(GTMaterial material) { + private static boolean hasSourceMoltenPhase(GTMaterial material) { if (!gregtech.engine.material.GTMaterialRegistry.isCoreMaterial(material)) return false; - String name = switch (material.getId()) { - case 62 -> "Carbon14"; - case 1250 -> "TritaniumElemental"; - case 1260 -> "Trinium"; - case 1450 -> "DuraniumElemental"; - case 1740 -> "Naquadah"; - case 1741 -> "NaquadahEnriched"; - case 1742 -> "Naquadria"; - case 8020 -> "PotassiumCarbonate"; - case 8026 -> "TungstenTrioxide"; - case 8030 -> "FerrousChloride"; - case 8034 -> "LithiumPerchlorate"; - case 8266 -> "Asphalt"; - case 8500 -> "Stone"; - case 9120 -> "Ilmenite"; - case 9192 -> "Rutile"; - default -> null; - }; - return material.getName().equals(name); + return MaterialDefinitions.info(material.getName()) + .processes() + .findSingle(MaterialFactKeys.SOURCE_MOLTEN_FLUID) + .map(rule -> rule.value().booleanValue()) + .orElse(false); } /** @@ -1043,7 +1028,7 @@ public static void registerGeneratedMoltenFluids(Collection material && !material.has(MaterialProperty.METAL) && !material.has(MaterialProperty.ALLOY) && !MaterialForms.has(material, "MOLTEN") - && !hasReviewedSourceMoltenPhase(material)) { + && !hasSourceMoltenPhase(material)) { continue; } String field = "GenMolten_" + material.getName(); diff --git a/core/src/main/java/gregtech/content/data/MaterialDataRules.java b/core/src/main/java/gregtech/content/data/MaterialDataRules.java index ee3d354d9..4c638fcd7 100644 --- a/core/src/main/java/gregtech/content/data/MaterialDataRules.java +++ b/core/src/main/java/gregtech/content/data/MaterialDataRules.java @@ -1,6 +1,5 @@ package gregtech.content.data; -import gregtech.api.material.*; import java.util.List; /** Source1 scanner/printer/replicator work and material-form preference. Units remain at the platform boundary. */ @@ -21,10 +20,6 @@ private MaterialDataRules() {} public static final int ENVIRONMENT_KELVIN = 293; - /** Compatibility name from the earlier port; its value is duration, not packet power. */ - @Deprecated - public static final long REPLICATOR_POWER_PER_NUCLEON = REPLICATOR_TICKS_PER_NUCLEON; - public enum AmbientPhase { SOLID, LIQUID, diff --git a/core/src/main/java/gregtech/content/machine/OriginalMachineMaterialData.java b/core/src/main/java/gregtech/content/machine/OriginalMachineMaterialData.java index 74b6488e8..ca9ce71c8 100644 --- a/core/src/main/java/gregtech/content/machine/OriginalMachineMaterialData.java +++ b/core/src/main/java/gregtech/content/machine/OriginalMachineMaterialData.java @@ -1,6 +1,5 @@ /* GregTech-6 Team / Gregorius Techneticies; LGPL-3.0-or-later. - * Adapted from CR.shaped, OreDictItemData, OP and Loader_MultiTileEntities. - * Generated by tools/integration/generate_machine_material_data.py; source provenance is in docs/integration/verification. */ + * Adapted from CR.shaped, OreDictItemData, OP and Loader_MultiTileEntities. */ package gregtech.content.machine; import gregtech.api.material.GTMaterial; diff --git a/core/src/main/java/gregtech/content/material/MaterialDefinitions.java b/core/src/main/java/gregtech/content/material/MaterialDefinitions.java index b8846ea7c..3bb5cb948 100644 --- a/core/src/main/java/gregtech/content/material/MaterialDefinitions.java +++ b/core/src/main/java/gregtech/content/material/MaterialDefinitions.java @@ -27,6 +27,18 @@ private static List collect() { result.addAll(WoodMaterials.definitions()); result.addAll(SpecialMaterials.definitions()); result.addAll(GroupMaterials.definitions()); + result.replaceAll(ReviewedSourceMaterialFacts::applyOne); + result.replaceAll(ReviewedOreMaterialFacts::apply); + result.replaceAll(SourceMacerationMaterialFacts::apply); + result.replaceAll(SourceWashingMaterialFacts::apply); + result.replaceAll(MaterialFluidUnitFacts::apply); + result.replaceAll(GenerifyingMaterialFacts::apply); + result.replaceAll(SourceExtrusionMaterialFacts::apply); + result.replaceAll(SourceLensMaterialFacts::apply); + result.replaceAll(SourceRecyclingMaterialFacts::apply); + result.replaceAll(SourceOreCrushingMaterialFacts::apply); + result.replaceAll(PurifiedCentrifugeMaterialFacts::apply); + result.replaceAll(gregtech.content.recipe.SpecialProcessMaterialFacts::apply); result.replaceAll(MaterialDefinitions::attachDecomposition); DecompositionMaterials.validateConsumed(result); result.sort(Comparator.comparing(MaterialDefinition.Declaration::name)); diff --git a/core/src/main/java/gregtech/content/material/MaterialFactKeys.java b/core/src/main/java/gregtech/content/material/MaterialFactKeys.java new file mode 100644 index 000000000..3585162fd --- /dev/null +++ b/core/src/main/java/gregtech/content/material/MaterialFactKeys.java @@ -0,0 +1,193 @@ +package gregtech.content.material; + +import gregtech.api.addon.material.*; +import gregtech.api.material.GTMaterial; +import gregtech.content.material.catalog.SourceExtrusionMaterialFacts; +import gregtech.content.material.catalog.SourceLensMaterialFacts; +import gregtech.content.material.catalog.SourceRecyclingMaterialFacts; +import gregtech.content.material.catalog.SourceWashingMaterialFacts; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +/** Typed material process keys for facts consumed by recipe families. */ +public final class MaterialFactKeys { + private MaterialFactKeys() {} + + public static void put( + Map, List>> rules, + MaterialProcessKey key, + List> values) { + if (rules.putIfAbsent(key, List.copyOf(values)) != null) + throw new IllegalArgumentException("Duplicate material process fact " + key.id()); + } + + public enum Decision { + YES, + NO, + UNKNOWN + } + + public record Identity(int id, String name) { + public Identity { + java.util.Objects.requireNonNull(name, "name"); + } + + public boolean matches(int materialId, String canonicalName) { + return id == materialId && name.equals(canonicalName); + } + } + + public static final MaterialProcessKey SOURCE_FURNACE = single("source_furnace", Decision.class); + public static final MaterialProcessKey SOURCE_GRADED_GEM = single("source_graded_gem", Decision.class); + public static final MaterialProcessKey SOURCE_ORE_INPUT = single("source_ore_input", Decision.class); + public static final MaterialProcessKey SOURCE_SIFTING_EXCLUSIONS = + single("source_sifting_exclusions", PrefixExclusions.class); + public static final MaterialProcessKey SOURCE_CRUSHED_EXCLUSIONS = + single("source_crushed_exclusions", PrefixExclusions.class); + public static final MaterialProcessKey SOURCE_ORE_SHREDDER = + single("source_ore_shredder", OreShredderProfile.class); + public static final MaterialProcessKey SOURCE_MACERATION = single("source_maceration", Decision.class); + public static final MaterialProcessKey SOURCE_WASHING = + single("source_washing", SourceWashingMaterialFacts.Binding.class); + public static final MaterialProcessKey MATERIAL_FLUID_UNIT = + single("material_fluid_unit", MaterialFluidUnits.class); + public static final MaterialProcessKey GENERIFICATION_TARGET = + single("generification_target", GenerificationTarget.class); + public static final MaterialProcessKey SOURCE_EXTRUSION = + single("source_extrusion", SourceExtrusionMaterialFacts.Profile.class); + public static final MaterialProcessKey SOURCE_LENS_ROLE = + single("source_lens_role", SourceLensMaterialFacts.Color.class); + public static final MaterialProcessKey SOURCE_CINNABAR_FOLLOWON = + single("source_cinnabar_followon", CinnabarFollowonRule.class); + public static final MaterialProcessKey SOURCE_GENERATED_FLUID = + single("source_generated_fluid", GeneratedFluidRules.class); + public static final MaterialProcessKey SOURCE_RECYCLING = + single("source_recycling", SourceRecyclingMaterialFacts.Facts.class); + public static final MaterialProcessKey SOURCE_MOLTEN_FLUID = single("source_molten_fluid", Boolean.class); + public static final MaterialProcessKey SOURCE_ORE_CRUSHING = + single("source_ore_crushing", OreCrushingFact.class); + public static final MaterialProcessKey SOURCE_PURIFIED_CENTRIFUGE_PHASE = + single("source_purified_centrifuge_phase", PurifiedCentrifugePhase.class); + public static final MaterialProcessKey SOURCE_PURIFIED_CENTRIFUGE_NO_DEFAULT = + single("source_purified_centrifuge_no_default", PurifiedCentrifugeNoDefault.class); + public static final MaterialProcessKey SOURCE_ADDITIONAL_WIRE_FAMILY = + single("source_additional_wire_family", Boolean.class); + public static final MaterialProcessKey COMPRESSOR_DUST_TO_GEM_PLATE = + single("compressor_dust_to_gem_plate", Boolean.class); + + public record PrefixExclusions(Set prefixes) { + public PrefixExclusions { + prefixes = Set.copyOf(prefixes); + } + + public boolean excludes(String prefix) { + return prefixes.contains(prefix); + } + } + + public record OreShredderProfile(int quality, boolean mortar) { + public OreShredderProfile { + if (quality < 0) throw new IllegalArgumentException("Negative source tool quality"); + } + } + + public record MaterialFluidUnit( + String phase, + String fluidField, + String registryPath, + long referenceSourceUnits, + long referenceMillibuckets) { + public MaterialFluidUnit { + if (phase == null || phase.isBlank()) throw new IllegalArgumentException("Missing material fluid phase"); + if (fluidField == null || fluidField.isBlank()) + throw new IllegalArgumentException("Missing material fluid field"); + if (registryPath == null || registryPath.isBlank()) + throw new IllegalArgumentException("Missing material fluid registry path"); + if (referenceSourceUnits <= 0 || referenceMillibuckets <= 0) + throw new IllegalArgumentException("Invalid material fluid unit"); + } + } + + public record MaterialFluidUnits(Set units) { + public MaterialFluidUnits { + units = Set.copyOf(units); + if (units.isEmpty()) throw new IllegalArgumentException("Material fluid units must not be empty"); + } + } + + public record GenerificationTarget(int materialId) { + public GenerificationTarget { + if (materialId <= 0 || materialId >= 10_000) + throw new IllegalArgumentException("Invalid generification target id: " + materialId); + } + } + + public record CinnabarFollowonRule(Identity cinnabar, java.util.List byproducts, Identity sluiceSand) { + public CinnabarFollowonRule { + java.util.Objects.requireNonNull(cinnabar, "cinnabar"); + byproducts = java.util.List.copyOf(byproducts); + java.util.Objects.requireNonNull(sluiceSand, "sluiceSand"); + } + } + + public record GeneratedFluidRule( + String field, String registryPath, int temperature, float materialDensity, boolean wholeDustMetal) { + public GeneratedFluidRule { + if (field == null || field.isBlank() || registryPath == null || registryPath.isBlank()) + throw new IllegalArgumentException("Invalid generated fluid binding"); + if (temperature < 0 || !Float.isFinite(materialDensity) || materialDensity < 0) + throw new IllegalArgumentException("Invalid generated fluid physical facts"); + } + } + + public record GeneratedFluidRules(Set rules) { + public GeneratedFluidRules { + rules = Set.copyOf(rules); + if (rules.isEmpty()) throw new IllegalArgumentException("Generated fluid rules must not be empty"); + } + } + + public enum HexoriumKind { + NONE, + BLACK_WHITE, + RED_GREEN_BLUE + } + + public record OreCrushingFact(Decision pulverizing, HexoriumKind hexorium) { + public OreCrushingFact { + java.util.Objects.requireNonNull(pulverizing, "pulverizing"); + java.util.Objects.requireNonNull(hexorium, "hexorium"); + } + } + + public record PurifiedCentrifugePhase(String phase, int meltingKelvin, int boilingKelvin) { + public PurifiedCentrifugePhase { + if (!"gas".equals(phase) && !"liquid".equals(phase)) + throw new IllegalArgumentException("Invalid purified centrifuge phase"); + } + } + + public record PurifiedCentrifugeNoDefault(String phase, int meltingKelvin, int boilingKelvin) { + public PurifiedCentrifugeNoDefault { + if (!"gas".equals(phase) && !"liquid".equals(phase)) + throw new IllegalArgumentException("Invalid purified centrifuge default phase"); + } + } + + public static Optional value(GTMaterial material, MaterialProcessKey key) { + if (material == null || !material.isValid()) return Optional.empty(); + return MaterialInfoTool.currentProcess( + new MaterialKey(material.resolve().getName()), key) + .map(rule -> rule.value()); + } + + public static Optional sourceRecycling(GTMaterial material) { + return value(material, SOURCE_RECYCLING); + } + + private static MaterialProcessKey single(String path, Class type) { + return MaterialProcessKey.single(new DataKey("gt6ce", path), type); + } +} diff --git a/core/src/main/java/gregtech/content/material/catalog/DecompositionMaterials.java b/core/src/main/java/gregtech/content/material/catalog/DecompositionMaterials.java index 0eff82eaf..4c71526ad 100644 --- a/core/src/main/java/gregtech/content/material/catalog/DecompositionMaterials.java +++ b/core/src/main/java/gregtech/content/material/catalog/DecompositionMaterials.java @@ -4,7 +4,6 @@ import gregtech.api.addon.material.MaterialDecompositionRule.Route; import gregtech.api.addon.material.MaterialProcessKeys; import gregtech.api.material.GTValues; -import gregtech.content.recipe.OriginalMaterialFluidUnits; import gregtech.engine.material.MaterialDefinition; import java.util.*; @@ -227,7 +226,7 @@ private static Thermal thermal(int id, String name) { } private static Binding shared(String material, int id, String phase) { - var binding = OriginalMaterialFluidUnits.binding(material, id, phase); + var binding = MaterialFluidUnitFacts.binding(material, id, phase); if (binding == null) throw new IllegalStateException("Missing shared fluid binding for " + material + " / " + phase); return new Binding(binding.registryName(), binding.referenceSourceUnits(), binding.referenceMillibuckets()); diff --git a/core/src/main/java/gregtech/content/material/catalog/GenerifyingMaterialFacts.java b/core/src/main/java/gregtech/content/material/catalog/GenerifyingMaterialFacts.java new file mode 100644 index 000000000..8051db51d --- /dev/null +++ b/core/src/main/java/gregtech/content/material/catalog/GenerifyingMaterialFacts.java @@ -0,0 +1,73 @@ +package gregtech.content.material.catalog; + +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * GT6's generifier rule: every material whose {@code mTargetGenerifying} differs from itself becomes + * one {@code RecipeMapHandlerMaterial} on {@code RM.Generifier}, and that handler expands over every + * prefix the condition {@code And(SIMPLIFIABLE, ingotHot.NOT)} accepts. Each row converts one item of + * a form in the source material into one item of the same form in the target material; the duration + * is the form's material weight in ticks, the EU cost is zero, and nothing converts back. + * + *

The material targets are {@code MT.java}'s {@code setGenerifying} calls plus the + * {@code ANY.*.mToThis} loops that follow them, keyed by GT6 material id so the table does not depend + * on display names. {@code ANY} groups that point at a plain material other than their own name + * (ashes, gems, woods, wax, rubber, plastics, phosphorus, clay, silicon) are already folded into the + * targets, because the loops overwrite the explicit rows they contain.

+ */ +public final class GenerifyingMaterialFacts { + private GenerifyingMaterialFacts() {} + + /** {@code MT.java} {@code setGenerifying} rows and {@code ANY.*.mToThis} loops, as source/target ids. */ + private static final int[] TARGET_IDS = { + 8196, 8218, 8197, 8218, 8201, 8200, 8222, 8221, 8224, 8221, 8236, 8235, 8238, 8235, 8239, 8235, 8267, 8221, + 8276, 8215, 8278, 8300, 8289, 8221, 8290, 8221, 8296, 8221, 8297, 8221, 8302, 8304, 8305, 8304, 8307, 8306, + 8314, 8304, 8315, 8304, 8323, 8301, 8324, 8301, 8328, 8304, 8346, 8445, 8347, 8445, 8348, 8347, 8375, 8333, + 8376, 8332, 8377, 8300, 8378, 8334, 8379, 8301, 8380, 260, 8383, 8304, 8384, 8301, 8385, 8301, 8386, 8301, 8387, + 8301, 8393, 8445, 8395, 8445, 8396, 8445, 8397, 8445, 8399, 8445, 8418, 8221, 8423, 8300, 8424, 8300, 8425, + 8309, 8426, 8309, 8427, 8309, 8428, 8309, 8429, 8309, 8431, 8430, 8432, 8430, 8433, 8430, 8434, 8430, 8435, + 8430, 8436, 9215, 8437, 9215, 8438, 9215, 8439, 9215, 8440, 9215, 8441, 9215, 8442, 9215, 8443, 9215, 8444, + 9215, 8455, 8215, 8458, 8208, 8459, 8208, 8460, 8208, 8464, 8300, 8465, 8300, 8467, 8300, 8468, 8300, 8501, + 8500, 8503, 8502, 8505, 8500, 8506, 8500, 8507, 8500, 8508, 8500, 8511, 8500, 8516, 8500, 8518, 8500, 8521, + 8500, 8528, 8500, 8599, 8500, 8640, 290, 8643, 260, 8645, 260, 8646, 8630, 8647, 600, 8652, 740, 8674, 8630, + 8675, 8630, 8679, 260, 8697, 8634, 8698, 8673, 8720, 260, 8803, 260, 9000, 8500, 9153, 8215, 9154, 8215, 9167, + 8215, 9170, 8500, 9171, 8500, 9176, 8500, 9177, 8500, 9179, 8500, 9180, 8500, 9184, 8500, 9185, 8500, 9186, + 8500, 9187, 8500, 9188, 8500, 9189, 8500, 9190, 8500, 9218, 8500, 9222, 8500, 9223, 8500, 9248, 8500, 9261, + 8500, 9300, 8221, 9301, 8221, 9302, 8221, 9303, 8221, 9304, 8221, 9305, 8221, 9306, 8221, 9307, 8221, 9308, + 8221, 9309, 8221, 9310, 8221, 9311, 8221, 9312, 8221, 9313, 8221, 9314, 8221, 9315, 8221, 9316, 8221, 9317, + 8221, 9318, 8221, 9319, 8221, 9344, 8221, 9372, 8221, 9409, 8221, 9853, 9190, + }; + + private static final Map TARGETS; + + static { + Map targets = new HashMap<>(TARGET_IDS.length / 2); + for (int i = 0; i < TARGET_IDS.length; i += 2) targets.put(TARGET_IDS[i], TARGET_IDS[i + 1]); + TARGETS = Map.copyOf(targets); + } + + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + var target = TARGETS.get(declaration.id()); + if (target == null || target == declaration.id()) return declaration; + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + MaterialFactKeys.put( + rules, + MaterialFactKeys.GENERIFICATION_TARGET, + List.of(MaterialProcessRule.anyForm(new MaterialFactKeys.GenerificationTarget(target)))); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); + } +} diff --git a/core/src/main/java/gregtech/content/material/catalog/MaterialFluidUnitFacts.java b/core/src/main/java/gregtech/content/material/catalog/MaterialFluidUnitFacts.java new file mode 100644 index 000000000..bdec71aba --- /dev/null +++ b/core/src/main/java/gregtech/content/material/catalog/MaterialFluidUnitFacts.java @@ -0,0 +1,190 @@ +package gregtech.content.material.catalog; + +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.api.material.GTMaterial; +import gregtech.api.material.GTValues; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import gregtech.engine.recipe.UnitConversion; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Set; + +/** + * Explicit source phase bindings for audited chemistry and fixed Centrifuge rows. + * Original CS.U=648648000; FL.createMolten uses144mB/U, createGas1000mB/U. + * Physical temperature, texture, and current legacy fluid names do not determine this dimension. + */ +public final class MaterialFluidUnitFacts { + public static final long SOURCE_UNIT = GTValues.U; + + public record Binding( + String materialName, + int materialId, + String phase, + String fluidField, + String registryName, + long referenceSourceUnits, + long referenceMillibuckets) {} + + private static final Binding[] BINDINGS = { + new Binding("AquaRegia", 9827, "liquid", "GenLiquid_AquaRegia", "aquaregia", SOURCE_UNIT, 1000), + new Binding("Glass", 8001, "liquid", "Glass", "glass", SOURCE_UNIT, 144), + new Binding("Blaze", 8211, "liquid", "Blaze", "blaze", SOURCE_UNIT, 1296), + new Binding("BlueVitriol", 8404, "liquid", "GenLiquid_BlueVitriol", "bluevitriol", SOURCE_UNIT, 1000), + new Binding("Plastic", 8218, "liquid", "Plastic", "molten.plastic", SOURCE_UNIT, 1000), + new Binding("Ender", 8318, "liquid", "Ender", "molten.enderpearl", SOURCE_UNIT, 144), + new Binding("Redstone", 8333, "liquid", "Redstone", "molten.redstone", SOURCE_UNIT, 144), + new Binding("Lava", 9810, "liquid", "Lava", "lava", 9 * SOURCE_UNIT, 1000), + new Binding("CFoam", 9883, "liquid", "CFoam", "ic2constructionfoam", SOURCE_UNIT, 100), + new Binding("Rubber", 8217, "liquid", "GenMolten_Rubber", "molten.rubber", SOURCE_UNIT, 144), + new Binding("Sugar", 9703, "liquid", "GenMolten_Sugar", "molten.sugar", SOURCE_UNIT, 144), + new Binding("Cheese", 9780, "liquid", "GenMolten_Cheese", "molten.cheese", SOURCE_UNIT, 144), + new Binding("Cryolite", 8009, "liquid", "GenLiquid_Cryolite", "cryolite", SOURCE_UNIT, 144), + new Binding( + "AluminiumFluoride", + 8010, + "liquid", + "GenLiquid_AluminiumFluoride", + "aluminiumfluoride", + SOURCE_UNIT, + 144), + new Binding( + "LithiumChloride", 8029, "liquid", "GenLiquid_LithiumChloride", "lithiumchloride", SOURCE_UNIT, 144), + new Binding( + "LithiumChlorate", 8033, "liquid", "GenLiquid_LithiumChlorate", "lithiumchlorate", SOURCE_UNIT, 144), + new Binding("CarbonDioxide", 9836, "gas", "CarbonDioxide", "carbondioxide", SOURCE_UNIT, 1000), + new Binding("Chlorine", 170, "gas", "GenGas_Chlorine", "chlorine", SOURCE_UNIT, 1000), + new Binding( + "ChloroplatinicAcid", + 8401, + "liquid", + "GenLiquid_ChloroplatinicAcid", + "chloroplatinicacid", + SOURCE_UNIT, + 1000), + new Binding("CyanVitriol", 8408, "liquid", "GenLiquid_CyanVitriol", "cyanvitriol", SOURCE_UNIT, 1000), + new Binding("Fluorine", 90, "gas", "GenGas_Fluorine", "fluorine", SOURCE_UNIT, 1000), + new Binding("Chocolate", 9783, "liquid", "GenMolten_Chocolate", "molten.chocolate", SOURCE_UNIT, 144), + new Binding("Deuterium", 11, "gas", "Deuterium", "deuterium", SOURCE_UNIT, 1000), + new Binding("FishOil", 9871, "liquid", "Oil_Fish", "fishoil", SOURCE_UNIT, 1000), + new Binding("GrayVitriol", 8410, "liquid", "GenLiquid_GrayVitriol", "grayvitriol", SOURCE_UNIT, 1000), + new Binding("GreenVitriol", 8405, "liquid", "GenLiquid_GreenVitriol", "greenvitriol", SOURCE_UNIT, 1000), + new Binding("HeavyWater", 9812, "liquid", "GenGas_HeavyWater", "heavywater", SOURCE_UNIT, 1000), + new Binding("Helium", 20, "gas", "Helium", "helium", SOURCE_UNIT, 1000), + new Binding("Helium3", 21, "gas", "GenGas_Helium3", "helium3", SOURCE_UNIT, 1000), + new Binding("Honey", 9791, "liquid", "Honey", "honey", SOURCE_UNIT, 1000), + new Binding("Honeydew", 9793, "liquid", "Honeydew", "honeydew", SOURCE_UNIT, 1000), + new Binding("HydrochloricAcid", 9826, "gas", "GenGas_HydrochloricAcid", "hydrochloricacid", SOURCE_UNIT, 1000), + new Binding("HydrogenFluoride", 9829, "gas", "GenGas_HydrogenFluoride", "hydrogenfluoride", SOURCE_UNIT, 1000), + new Binding("Hydrogen", 10, "gas", "Hydrogen", "hydrogen", SOURCE_UNIT, 1000), + new Binding("Ice", 9802, "liquid", "Ice", "ice", SOURCE_UNIT, 1000), + new Binding("Mercury", 800, "liquid", "GenLiquid_Mercury", "mercury", SOURCE_UNIT, 144), + new Binding("NitrogenDioxide", 9831, "gas", "GenGas_NitrogenDioxide", "nitrogendioxide", SOURCE_UNIT, 1000), + new Binding("NitrogenMonoxide", 9837, "gas", "GenGas_NitrogenMonoxide", "nitrogenmonoxide", SOURCE_UNIT, 1000), + new Binding("PinkVitriol", 8407, "liquid", "GenLiquid_PinkVitriol", "pinkvitriol", SOURCE_UNIT, 1000), + new Binding("RedVitriol", 8406, "liquid", "GenLiquid_RedVitriol", "redvitriol", SOURCE_UNIT, 1000), + new Binding("SemiheavyWater", 9811, "liquid", "GenGas_SemiheavyWater", "semiheavywater", SOURCE_UNIT, 1000), + new Binding("SulfuricAcid", 9824, "liquid", "GenLiquid_SulfuricAcid", "sulfuricacid", SOURCE_UNIT, 1000), + new Binding("TritiatedWater", 9813, "liquid", "GenGas_TritiatedWater", "tritiatedwater", SOURCE_UNIT, 1000), + new Binding( + "Uranium235Hexafluoride", + 9012, + "gas", + "GenGas_Uranium235Hexafluoride", + "uranium235hexafluoride", + SOURCE_UNIT, + 1000), + new Binding( + "Uranium238Hexafluoride", + 9010, + "gas", + "GenGas_Uranium238Hexafluoride", + "uranium238hexafluoride", + SOURCE_UNIT, + 1000), + new Binding( + "UraniumHexafluoride", + 9008, + "gas", + "GenGas_UraniumHexafluoride", + "uraniumhexafluoride", + SOURCE_UNIT, + 1000), + new Binding("VitriolOfClay", 8412, "liquid", "GenLiquid_VitriolOfClay", "vitriolofclay", SOURCE_UNIT, 1000), + new Binding("Water", 9800, "liquid", "Water", "water", SOURCE_UNIT, 1000), + new Binding("Wax", 8235, "liquid", "GenMolten_Wax", "molten.wax", SOURCE_UNIT, 144), + new Binding("WaxBee", 8236, "liquid", "GenMolten_WaxBee", "molten.waxbee", SOURCE_UNIT, 144), + new Binding("WaxParaffin", 8238, "liquid", "GenMolten_WaxParaffin", "molten.waxparaffin", SOURCE_UNIT, 144), + new Binding("WaxPlant", 8239, "liquid", "GenMolten_WaxPlant", "molten.waxplant", SOURCE_UNIT, 144), + new Binding("WhiteVitriol", 8409, "liquid", "GenLiquid_WhiteVitriol", "whitevitriol", SOURCE_UNIT, 1000), + }; + + private MaterialFluidUnitFacts() {} + + /** Unknown or conflicting source identities are deliberately unsupported, not guessed. */ + static Binding binding(String canonicalName, int materialId, String phase) { + for (Binding binding : BINDINGS) { + if (binding.materialName().equals(canonicalName) + && binding.materialId() == materialId + && binding.phase().equals(phase)) return binding; + } + return null; + } + + public static Binding binding(GTMaterial material, String phase) { + if (material == null || !material.isValid()) return null; + var resolved = material.resolve(); + return MaterialFactKeys.value(resolved, MaterialFactKeys.MATERIAL_FLUID_UNIT) + .flatMap(rule -> rule.units().stream() + .filter(value -> value.phase().equals(phase)) + .findFirst()) + .map(value -> new Binding( + resolved.getName(), + resolved.getId(), + value.phase(), + value.fluidField(), + value.registryPath(), + value.referenceSourceUnits(), + value.referenceMillibuckets())) + .orElse(null); + } + + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + var values = new java.util.ArrayList(); + for (Binding binding : BINDINGS) { + if (binding.materialId() != declaration.id() + || !binding.materialName().equals(declaration.name())) continue; + values.add(new MaterialFactKeys.MaterialFluidUnit( + binding.phase(), + binding.fluidField(), + binding.registryName(), + binding.referenceSourceUnits(), + binding.referenceMillibuckets())); + } + if (values.isEmpty()) return declaration; + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + MaterialFactKeys.put( + rules, + MaterialFactKeys.MATERIAL_FLUID_UNIT, + List.of(MaterialProcessRule.anyForm(new MaterialFactKeys.MaterialFluidUnits(Set.copyOf(values))))); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); + } + + /** + * Original UT.Code.units ratio and final rounding, without signed multiplication overflow. + * Returns -1 for invalid inputs or results outside native FluidStack int capacity; zero stays + * zero, never coerced to1. This is quantity arithmetic, not zero-volume catalyst semantics. + */ + public static int millibuckets(long sourceAmount, long sourceUnit, long referenceMillibuckets, boolean roundUp) { + return UnitConversion.fluidAmount(sourceUnit, referenceMillibuckets, sourceAmount, roundUp); + } +} diff --git a/core/src/main/java/gregtech/content/material/catalog/PurifiedCentrifugeMaterialFacts.java b/core/src/main/java/gregtech/content/material/catalog/PurifiedCentrifugeMaterialFacts.java new file mode 100644 index 000000000..8606beabe --- /dev/null +++ b/core/src/main/java/gregtech/content/material/catalog/PurifiedCentrifugeMaterialFacts.java @@ -0,0 +1,64 @@ +package gregtech.content.material.catalog; + +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.LinkedHashMap; +import java.util.List; + +/** Material-owned ambient phase and explicit no-default-phase facts for purified Centrifuge. */ +public final class PurifiedCentrifugeMaterialFacts { + private PurifiedCentrifugeMaterialFacts() {} + + private record Phase(int id, String name, MaterialFactKeys.PurifiedCentrifugePhase value) {} + + private record None(int id, String name, MaterialFactKeys.PurifiedCentrifugeNoDefault value) {} + + private static final List PHASES = List.of( + new Phase(21, "Helium3", new MaterialFactKeys.PurifiedCentrifugePhase("gas", 1, 4)), + new Phase(90, "Fluorine", new MaterialFactKeys.PurifiedCentrifugePhase("gas", 53, 85)), + new Phase(800, "Mercury", new MaterialFactKeys.PurifiedCentrifugePhase("liquid", 234, 629)), + new Phase(9791, "Honey", new MaterialFactKeys.PurifiedCentrifugePhase("liquid", 273, 373)), + new Phase(9793, "Honeydew", new MaterialFactKeys.PurifiedCentrifugePhase("liquid", 273, 373)), + new Phase(9802, "Ice", new MaterialFactKeys.PurifiedCentrifugePhase("liquid", 273, 373))); + + private static final List NONE = List.of( + new None(1120, "Copernicium", new MaterialFactKeys.PurifiedCentrifugeNoDefault("liquid", 150, 357)), + new None(1180, "Oganesson", new MaterialFactKeys.PurifiedCentrifugeNoDefault("gas", 258, 263)), + new None(9110, "Celestine", new MaterialFactKeys.PurifiedCentrifugeNoDefault("liquid", 275, 455)), + new None( + 9199, "DuraniumHexafluoride", new MaterialFactKeys.PurifiedCentrifugeNoDefault("liquid", 216, 428)), + new None(9801, "Snow", new MaterialFactKeys.PurifiedCentrifugeNoDefault("liquid", 273, 373)), + new None(9851, "OilSand", new MaterialFactKeys.PurifiedCentrifugeNoDefault("liquid", 100, 400)), + new None(9852, "CrudeOil", new MaterialFactKeys.PurifiedCentrifugeNoDefault("liquid", 100, 400))); + + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + MaterialFactKeys.PurifiedCentrifugePhase phase = null; + MaterialFactKeys.PurifiedCentrifugeNoDefault none = null; + for (Phase value : PHASES) + if (value.id == declaration.id() && value.name.equals(declaration.name())) phase = value.value; + for (None value : NONE) + if (value.id == declaration.id() && value.name.equals(declaration.name())) none = value.value; + if (phase == null && none == null) return declaration; + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + if (phase != null) + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_PURIFIED_CENTRIFUGE_PHASE, + List.of(MaterialProcessRule.anyForm(phase))); + if (none != null) + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_PURIFIED_CENTRIFUGE_NO_DEFAULT, + List.of(MaterialProcessRule.anyForm(none))); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); + } +} diff --git a/core/src/main/java/gregtech/content/material/catalog/ReviewedOreMaterialFacts.java b/core/src/main/java/gregtech/content/material/catalog/ReviewedOreMaterialFacts.java new file mode 100644 index 000000000..2eb631965 --- /dev/null +++ b/core/src/main/java/gregtech/content/material/catalog/ReviewedOreMaterialFacts.java @@ -0,0 +1,182 @@ +package gregtech.content.material.catalog; + +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** Reviewed processing facts whose payload is bound to exact built-in material identities. */ +public final class ReviewedOreMaterialFacts { + private ReviewedOreMaterialFacts() {} + + /** Bounded baseline ORES-property proof; omission is UNKNOWN, not a negative. */ + private static final Map ORE_INPUT_NO = Map.ofEntries( + Map.entry(8418, "Bamboo"), + Map.entry(8275, "Bark"), + Map.entry(8620, "Brass"), + Map.entry(8610, "Bronze"), + Map.entry(8501, "Concrete"), + Map.entry(8290, "Dreamwood"), + Map.entry(8751, "Duranium"), + Map.entry(8504, "Endstone"), + Map.entry(8035, "FerricOxyhydroxide"), + Map.entry(8698, "Fireleaf"), + Map.entry(9712, "FishRaw"), + Map.entry(8002, "Flint"), + Map.entry(90, "Fluorine"), + Map.entry(9175, "Graphene"), + Map.entry(8296, "Greatwood"), + Map.entry(9802, "Ice"), + Map.entry(8645, "IronMagnetic"), + Map.entry(8241, "Leather"), + Map.entry(9189, "Limestone"), + Map.entry(8289, "Livingwood"), + Map.entry(8506, "Marble"), + Map.entry(9700, "MeatRaw"), + Map.entry(8647, "NeodymiumMagnetic"), + Map.entry(8502, "Netherrack"), + Map.entry(8214, "Obsidian"), + Map.entry(8218, "Plastic"), + Map.entry(8197, "PVC"), + Map.entry(8104, "RedSand"), + Map.entry(8217, "Rubber"), + Map.entry(8297, "Silverwood"), + Map.entry(9801, "Snow"), + Map.entry(8673, "Steeleaf"), + Map.entry(8651, "SteelGalvanized"), + Map.entry(8646, "SteelMagnetic"), + Map.entry(8196, "Teflon"), + Map.entry(8752, "Tritanium"), + Map.entry(8027, "TungsticAcid"), + Map.entry(8221, "Wood"), + Map.entry(8224, "WoodRubber")); + + private static final Set CRUSHED_EXCLUSIONS = Set.of( + "crushed", + "crushedTiny", + "crushedPurified", + "crushedPurifiedTiny", + "crushedCentrifuged", + "crushedCentrifugedTiny"); + + /** Handlers145-150 source ORES/MORTAR/self-pulver profiles. */ + private record ShredderFact(String name, MaterialFactKeys.OreShredderProfile profile) {} + + private static final Map SHREDDER = Map.ofEntries( + Map.entry(290, new ShredderFact("Copper", new MaterialFactKeys.OreShredderProfile(0, true))), + Map.entry(9117, new ShredderFact("Galena", new MaterialFactKeys.OreShredderProfile(0, true))), + Map.entry(8346, new ShredderFact("NetherQuartz", new MaterialFactKeys.OreShredderProfile(3, true))), + Map.entry(9111, new ShredderFact("Chalcopyrite", new MaterialFactKeys.OreShredderProfile(0, true))), + Map.entry(9145, new ShredderFact("Pentlandite", new MaterialFactKeys.OreShredderProfile(0, true))), + Map.entry(9130, new ShredderFact("Sphalerite", new MaterialFactKeys.OreShredderProfile(0, true))), + Map.entry(9132, new ShredderFact("Tetrahedrite", new MaterialFactKeys.OreShredderProfile(0, true))), + Map.entry(9125, new ShredderFact("Pyrite", new MaterialFactKeys.OreShredderProfile(0, true))), + Map.entry(280, new ShredderFact("Nickel", new MaterialFactKeys.OreShredderProfile(2, true))), + Map.entry(9116, new ShredderFact("Cooperite", new MaterialFactKeys.OreShredderProfile(0, true))), + Map.entry(9137, new ShredderFact("YellowLimonite", new MaterialFactKeys.OreShredderProfile(0, true)))); + + private static final Map CRUSHED_SOURCE_MATERIALS = Map.ofEntries( + Map.entry(2220, "Adamantium"), + Map.entry(260, "Iron"), + Map.entry(140, "Silicon"), + Map.entry(130, "Aluminium"), + Map.entry(220, "Titanium"), + Map.entry(740, "Tungsten"), + Map.entry(90, "Fluorine"), + Map.entry(730, "Tantalum"), + Map.entry(410, "Niobium")); + + /** Shared MT3709/w3803 Cinnabar follow-on identity set. */ + private static final MaterialFactKeys.CinnabarFollowonRule CINNABAR_FOLLOWON = + new MaterialFactKeys.CinnabarFollowonRule( + new MaterialFactKeys.Identity(9114, "Cinnabar"), + List.of( + new MaterialFactKeys.Identity(8333, "Redstone"), + new MaterialFactKeys.Identity(160, "Sulfur"), + new MaterialFactKeys.Identity(8341, "Glowstone"), + new MaterialFactKeys.Identity(340, "Selenium")), + new MaterialFactKeys.Identity(8102, "SluiceSand")); + + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + String name = declaration.name(); + if (name.equals(ORE_INPUT_NO.get(declaration.id()))) { + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_ORE_INPUT, + List.of(MaterialProcessRule.anyForm(MaterialFactKeys.Decision.NO))); + } + var shredder = SHREDDER.get(declaration.id()); + if (shredder != null && shredder.name().equals(name)) { + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_ORE_SHREDDER, + List.of(MaterialProcessRule.anyForm(shredder.profile()))); + } + if (name.equals(CRUSHED_SOURCE_MATERIALS.get(declaration.id()))) { + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_CRUSHED_EXCLUSIONS, + List.of(MaterialProcessRule.anyForm(new MaterialFactKeys.PrefixExclusions(CRUSHED_EXCLUSIONS)))); + } + if (declaration.id() == 9114 && name.equals("Cinnabar")) { + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_CINNABAR_FOLLOWON, + List.of(MaterialProcessRule.anyForm(CINNABAR_FOLLOWON))); + } + var generatedFluid = generatedFluid(declaration.id(), name); + if (generatedFluid != null) { + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_GENERATED_FLUID, + List.of(MaterialProcessRule.anyForm( + new MaterialFactKeys.GeneratedFluidRules(Set.of(generatedFluid))))); + } + if (declaration.id() == 8745 && name.equals("Netherite") + || declaration.id() == 1740 && name.equals("Naquadah")) { + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_ADDITIONAL_WIRE_FAMILY, + List.of(MaterialProcessRule.anyForm(Boolean.TRUE))); + } + if (declaration.id() == 9802 && name.equals("Ice")) { + MaterialFactKeys.put( + rules, + MaterialFactKeys.COMPRESSOR_DUST_TO_GEM_PLATE, + List.of(MaterialProcessRule.anyForm(Boolean.FALSE))); + } + if (rules.equals(info.processes().rules())) return declaration; + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); + } + + private static MaterialFactKeys.GeneratedFluidRule generatedFluid(int id, String name) { + return switch (id) { + case 800 -> + name.equals("Mercury") + ? new MaterialFactKeys.GeneratedFluidRule("GenLiquid_Mercury", "mercury", 300, 0F, false) + : null; + case 220 -> + name.equals("Titanium") + ? new MaterialFactKeys.GeneratedFluidRule( + "GenMolten_Titanium", "molten.titanium", 1941, 4.54F, true) + : null; + case 260 -> + name.equals("Iron") + ? new MaterialFactKeys.GeneratedFluidRule("GenMolten_Iron", "molten.iron", 1811, 7.874F, true) + : null; + default -> null; + }; + } +} diff --git a/core/src/main/java/gregtech/content/recipe/ReviewedOreSourceProfile.java b/core/src/main/java/gregtech/content/material/catalog/ReviewedSourceMaterialFacts.java similarity index 72% rename from core/src/main/java/gregtech/content/recipe/ReviewedOreSourceProfile.java rename to core/src/main/java/gregtech/content/material/catalog/ReviewedSourceMaterialFacts.java index 5f42fa19e..c25de4c33 100644 --- a/core/src/main/java/gregtech/content/recipe/ReviewedOreSourceProfile.java +++ b/core/src/main/java/gregtech/content/material/catalog/ReviewedSourceMaterialFacts.java @@ -1,28 +1,27 @@ -package gregtech.content.recipe; +package gregtech.content.material.catalog; +import static gregtech.content.material.MaterialFactKeys.Decision; + +import gregtech.api.addon.material.MaterialProcessRule; import gregtech.api.material.GTMaterial; -import gregtech.engine.addon.AddonMaterials; -import gregtech.engine.material.GTMaterialRegistry; +import gregtech.api.material.MaterialProperty; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.*; -/** Generated from reviewed-source-policy.json. Incomplete by design; absent is UNKNOWN. */ -public final class ReviewedOreSourceProfile { - public enum Decision { - YES, - NO, - UNKNOWN; +/** Bounded source facts whose scope is an exact built-in material identity. */ +public final class ReviewedSourceMaterialFacts { + private ReviewedSourceMaterialFacts() {} - public boolean orLegacy(boolean legacy) { - return this == UNKNOWN ? legacy : this == YES; - } - } - - public enum Rule { + private enum Rule { FURNACE, GRADED_GEM } private record Entry(int id, String name, Rule rule, Decision decision) {} + /** FURNACE and GRADED_GEM decisions from the reviewed source-policy extract. */ private static final Entry[] ENTRIES = { new Entry(30, "Lithium", Rule.FURNACE, Decision.YES), new Entry(31, "Lithium-6", Rule.FURNACE, Decision.YES), @@ -226,15 +225,95 @@ private record Entry(int id, String name, Rule rule, Decision decision) {} new Entry(9114, "Cinnabar", Rule.GRADED_GEM, Decision.YES), }; - private ReviewedOreSourceProfile() {} + /** Paired MT direct magnetic-tag positives; omission is UNKNOWN, never a negative. */ + private static final Map MAGNETIC = Map.ofEntries( + Map.entry(250, "Manganese"), + Map.entry(260, "Iron"), + Map.entry(270, "Cobalt"), + Map.entry(278, "Cobalt60"), + Map.entry(280, "Nickel"), + Map.entry(600, "Neodymium"), + Map.entry(670, "Holmium"), + Map.entry(830, "Bismuth"), + Map.entry(2220, "Adamantium"), + Map.entry(8030, "FerrousChloride"), + Map.entry(8234, "VanadiumPentoxide"), + Map.entry(8247, "Basalz"), + Map.entry(8630, "Steel"), + Map.entry(8634, "DamascusSteel"), + Map.entry(8635, "Tungstensteel"), + Map.entry(8643, "WroughtIron"), + Map.entry(8645, "IronMagnetic"), + Map.entry(8646, "SteelMagnetic"), + Map.entry(8647, "NeodymiumMagnetic"), + Map.entry(8653, "VanadiumSteel"), + Map.entry(8661, "Invar"), + Map.entry(8662, "Constantan"), + Map.entry(8672, "Ironwood"), + Map.entry(8673, "Steeleaf"), + Map.entry(8674, "Knightmetal"), + Map.entry(8675, "FierySteel"), + Map.entry(8679, "Thaumium"), + Map.entry(8685, "ChromiumDioxide"), + Map.entry(8697, "FlamascusSteel"), + Map.entry(8698, "Fireleaf"), + Map.entry(8704, "VibraniumSteel"), + Map.entry(8706, "Vibramantium"), + Map.entry(8727, "ConductiveIron"), + Map.entry(8730, "ElectricalSteel"), + Map.entry(8744, "AncientDebris"), + Map.entry(8745, "Netherite"), + Map.entry(8746, "NetherizedDiamond"), + Map.entry(8747, "Efrine"), + Map.entry(8784, "Adamantine"), + Map.entry(8803, "CastIron"), + Map.entry(9003, "BasalticMineralSand"), + Map.entry(9004, "GraniticMineralSand"), + Map.entry(9104, "Hematite"), + Map.entry(9106, "BrownLimonite"), + Map.entry(9115, "Cobaltite"), + Map.entry(9118, "Garnierite"), + Map.entry(9120, "Ilmenite"), + Map.entry(9122, "Magnetite"), + Map.entry(9125, "Pyrite"), + Map.entry(9126, "Pyrolusite"), + Map.entry(9137, "YellowLimonite"), + Map.entry(9143, "VanadiumMagnetite"), + Map.entry(9145, "Pentlandite")); + + private static final Set SIFTING_ABSENT = Set.of("gemLegendary", "gemExquisite", "gemFlawless"); - public static Decision decision(GTMaterial material, Rule rule) { - if (material == null || !material.isValid()) return Decision.UNKNOWN; - material = material.resolve(); - if (AddonMaterials.owns(material) || !GTMaterialRegistry.isCoreMaterial(material)) return Decision.UNKNOWN; - for (Entry row : ENTRIES) - if (row.id == material.getId() && row.name.equals(material.getName()) && row.rule == rule) - return row.decision; - return Decision.UNKNOWN; + public static MaterialDefinition.Declaration applyOne(MaterialDefinition.Declaration declaration) { + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + for (var entry : ENTRIES) { + if (entry.id != declaration.id() || !GTMaterial.sanitize(entry.name).equals(declaration.name())) continue; + var key = entry.rule == Rule.FURNACE ? MaterialFactKeys.SOURCE_FURNACE : MaterialFactKeys.SOURCE_GRADED_GEM; + MaterialFactKeys.put(rules, key, List.of(MaterialProcessRule.anyForm(entry.decision))); + } + if (declaration.id() == 9802 && declaration.name().equals("Ice")) { + MaterialFactKeys.put( + rules, + MaterialFactKeys.SOURCE_SIFTING_EXCLUSIONS, + List.of(MaterialProcessRule.anyForm(new MaterialFactKeys.PrefixExclusions(SIFTING_ABSENT)))); + } + + var material = declaration.material(); + if (MAGNETIC.get(declaration.id()) != null + && MAGNETIC.get(declaration.id()).equals(declaration.name())) { + var properties = EnumSet.noneOf(MaterialProperty.class); + properties.addAll(material.properties()); + properties.add(MaterialProperty.MAGNETIC); + material = new MaterialDefinition( + material.identity(), material.presentation(), material.physical(), properties, material.source()); + } + if (rules.equals(info.processes().rules()) && material == declaration.material()) return declaration; + return new MaterialDefinition.Declaration( + material, + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); } } diff --git a/core/src/main/java/gregtech/content/material/catalog/SourceExtrusionMaterialFacts.java b/core/src/main/java/gregtech/content/material/catalog/SourceExtrusionMaterialFacts.java new file mode 100644 index 000000000..93b22d98c --- /dev/null +++ b/core/src/main/java/gregtech/content/material/catalog/SourceExtrusionMaterialFacts.java @@ -0,0 +1,798 @@ +package gregtech.content.material.catalog; + +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** Native GT6 MT factory/direct extrusion flags and forging targets, pinned to 3703e403. + * Generated from GT6 {@code MT.java} at 3703e403; absence is not inferred from the port's broad METAL flag. + * Profiles are bound to exact native identities; addons are not assigned original identities by name. + */ +public final class SourceExtrusionMaterialFacts { + private SourceExtrusionMaterialFacts() {} + + public record Profile(boolean extrudable, boolean simple, boolean smithable, String target, long forgingAmount) {} + + private record Row(String name, Profile profile) {} + + private static final Map ROWS = new HashMap<>(); + private static final String DATA = """ + 0|Empty|000||648648000 + 1|Photon|000||648648000 + 2|Neutrino|000||648648000 + 3|Neutron|000||648648000 + 4|Proton|000||648648000 + 5|Electron|000||648648000 + 10|Hydrogen|000||648648000 + 11|Deuterium|000||648648000 + 12|Tritium|000||648648000 + 20|Helium|000||648648000 + 21|Helium3|000||648648000 + 30|Lithium|111||648648000 + 31|Lithium6|111||648648000 + 40|Beryllium|101||648648000 + 41|Beryllium7|101||648648000 + 42|Beryllium8|101||648648000 + 50|Boron|101||648648000 + 51|Boron11|101||648648000 + 60|Carbon|000||648648000 + 61|Carbon13|000||648648000 + 62|Carbon14|000||648648000 + 70|Nitrogen|000||648648000 + 80|Oxygen|000||648648000 + 90|Fluorine|000||648648000 + 100|Neon|000||648648000 + 110|Sodium|111||648648000 + 120|Magnesium|111||648648000 + 130|Aluminium|111||648648000 + 140|Silicon|101||648648000 + 150|Phosphor|000||648648000 + 160|Sulfur|000||648648000 + 170|Chlorine|000||648648000 + 180|Argon|000||648648000 + 190|Potassium|111||648648000 + 200|Calcium|111||648648000 + 210|Scandium|101||648648000 + 220|Titanium|101||648648000 + 230|Vanadium|101||648648000 + 240|Chromium|101||648648000 + 250|Manganese|101||648648000 + 260|Iron|101||648648000 + 270|Cobalt|101||648648000 + 278|Cobalt60|101||648648000 + 280|Nickel|101||648648000 + 290|Copper|111||648648000 + 300|Zinc|111||648648000 + 310|Gallium|111||648648000 + 320|Germanium|111||648648000 + 330|Arsenic|111||648648000 + 340|Selenium|000||648648000 + 350|Bromine|000||648648000 + 360|Krypton|000||648648000 + 370|Rubidium|111||648648000 + 380|Strontium|111||648648000 + 390|Yttrium|101||648648000 + 400|Zirconium|101||648648000 + 410|Niobium|101||648648000 + 420|Molybdenum|101||648648000 + 430|Technetium|101||648648000 + 440|Ruthenium|101||648648000 + 450|Rhodium|101||648648000 + 460|Palladium|101||648648000 + 470|Silver|101||648648000 + 480|Cadmium|111||648648000 + 490|Indium|111||648648000 + 500|Tin|111||648648000 + 510|Antimony|111||648648000 + 520|Tellurium|111||648648000 + 530|Iodine|000||648648000 + 540|Xenon|000||648648000 + 550|Caesium|111||648648000 + 560|Barium|111||648648000 + 570|Lanthanium|111||648648000 + 580|Cerium|111||648648000 + 590|Praseodymium|101||648648000 + 600|Neodymium|101||648648000 + 610|Promethium|101||648648000 + 620|Samarium|101||648648000 + 630|Europium|111||648648000 + 640|Gadolinium|101||648648000 + 650|Terbium|101||648648000 + 660|Dysprosium|101||648648000 + 670|Holmium|101||648648000 + 680|Erbium|101||648648000 + 690|Thulium|101||648648000 + 700|Ytterbium|111||648648000 + 710|Lutetium|101||648648000 + 720|Hafnium|101||648648000 + 730|Tantalum|101||648648000 + 740|Tungsten|101||648648000 + 750|Rhenium|101||648648000 + 760|OsmiumElemental|101||648648000 + 770|Iridium|101||648648000 + 780|Platinum|101||648648000 + 790|Gold|101||648648000 + 791|Gold198|101||648648000 + 800|Mercury|111||648648000 + 810|Thallium|111||648648000 + 820|Lead|111||648648000 + 830|Bismuth|111||648648000 + 840|Polonium|111||648648000 + 850|Astatine|111||648648000 + 860|Radon|000||648648000 + 870|Francium|111||648648000 + 880|Radium|111||648648000 + 890|Actinium|101||648648000 + 900|Thorium|101||648648000 + 910|Protactinium|101||648648000 + 920|Uranium|101||648648000 + 921|Uranium235|101||648648000 + 922|Uranium233|101||648648000 + 930|Neptunium|111||648648000 + 940|Plutonium|111||648648000 + 942|Plutonium240|111||648648000 + 943|Plutonium241|111||648648000 + 945|Plutonium243|111||648648000 + 946|Plutonium238|111||648648000 + 947|Plutonium239|111||648648000 + 950|Americium|101||648648000 + 951|Americium241|101||648648000 + 952|Americium242|101||648648000 + 960|Curium|101||648648000 + 970|Berkelium|101||648648000 + 980|Californium|111||648648000 + 990|Einsteinium|111||648648000 + 1000|Fermium|111||648648000 + 1010|Mendelevium|111||648648000 + 1020|Nobelium|111||648648000 + 1030|Lawrencium|101||648648000 + 1040|Rutherfordium|101||648648000 + 1050|Dubnium|111||648648000 + 1060|Seaborgium|111||648648000 + 1070|Bohrium|111||648648000 + 1080|Hassium|111||648648000 + 1090|Meitnerium|000||648648000 + 1100|Darmstadtium|000||648648000 + 1110|Roentgenium|000||648648000 + 1120|Copernicium|111||648648000 + 1130|Nihonium|000||648648000 + 1140|Flerovium|111||648648000 + 1148|Flerovium298|111||648648000 + 1150|Moscovium|000||648648000 + 1160|Livermorium|000||648648000 + 1170|Farnsium|000||648648000 + 1180|Oganesson|000||648648000 + 1250|TritaniumElemental|101||648648000 + 1260|Trinium|101||648648000 + 1450|DuraniumElemental|111||648648000 + 1520|Vibranium|000||648648000 + 1740|Naquadah|101||648648000 + 1741|NaquadahEnriched|101||648648000 + 1742|Naquadria|101||648648000 + 2220|Adamantium|101||648648000 + 3720|Gravitonium|000||648648000 + 4000|Magic|000||648648000 + 8000|SiliconDioxide|000||648648000 + 8001|Glass|110||648648000 + 8002|Flint|000||648648000 + 8003|Carborundum|101||648648000 + 8006|Datolite|000||648648000 + 8007|HydrogenBorate|000||648648000 + 8008|Alumina|000||648648000 + 8009|Cryolite|000||648648000 + 8010|AluminiumFluoride|000||648648000 + 8011|HexafluorosilicicAcid|000||648648000 + 8012|SodiumAluminate|000||648648000 + 8013|SodiumCarbonate|000||648648000 + 8014|AluminiumHydroxide|000||648648000 + 8015|PotassiumHydroxide|000||648648000 + 8016|MagnesiumCarbonate|000||648648000 + 8017|FerricChloride|000||648648000 + 8018|MagnesiumChloride|000||648648000 + 8019|SodiumNitrate|000||648648000 + 8020|PotassiumCarbonate|000||648648000 + 8021|PotassiumSulfite|000||648648000 + 8022|PotassiumPersulfate|000||648648000 + 8023|PotassiumAluminate|000||648648000 + 8024|HydrosulfuricAcid|000||648648000 + 8025|Ammonia|000||648648000 + 8026|TungstenTrioxide|000||648648000 + 8027|TungsticAcid|000||648648000 + 8028|CalciumChloride|000||648648000 + 8029|LithiumChloride|000||648648000 + 8030|FerrousChloride|000||648648000 + 8031|ManganeseChloride|000||648648000 + 8032|LithiumHydroxide|000||648648000 + 8033|LithiumChlorate|000||648648000 + 8034|LithiumPerchlorate|000||648648000 + 8035|FerricOxyhydroxide|000||648648000 + 8036|PotassiumFluoride|000||648648000 + 8037|SodiumFluoride|000||648648000 + 8038|PotassiumHeptafluorotantalate|000||648648000 + 8039|SodiumHydrogencarbonate|000||648648000 + 8100|Sand|000||648648000 + 8101|Soulsand|000||648648000 + 8102|SluiceSand|000||648648000 + 8103|PlatinumGroupSludge|000||648648000 + 8104|RedSand|000||648648000 + 8196|Teflon|110||648648000 + 8197|PVC|110||648648000 + 8200|Ashes|000||648648000 + 8201|DarkAshes|000||648648000 + 8203|Sylvite|000||648648000 + 8204|Salt|000||648648000 + 8205|PotassiumNitrate|000||648648000 + 8206|Niter|000||648648000 + 8207|Phosphate|000||648648000 + 8208|Phosphorus|000||648648000 + 8209|Apatite|000||648648000 + 8210|Blizz|000||648648000 + 8211|Blaze|000||648648000 + 8214|Obsidian|000||648648000 + 8215|Clay|000||648648000 + 8216|Paper|000||648648000 + 8217|Rubber|110||648648000 + 8218|Plastic|110||648648000 + 8219|Bone|000||648648000 + 8220|Gunpowder|000||648648000 + 8221|Wood|000||648648000 + 8222|WoodTreated|000||648648000 + 8223|LiveRoot|000||648648000 + 8224|WoodRubber|000||648648000 + 8225|Ceramic|000||648648000 + 8226|Phosphorite|000||648648000 + 8229|CobaltHexahydrate|000||648648000 + 8230|SodiumBisulfate|000||648648000 + 8231|SodiumPyrosulfate|000||648648000 + 8232|PotassiumBisulfate|000||648648000 + 8233|PotassiumPyrosulfate|000||648648000 + 8234|VanadiumPentoxide|000||648648000 + 8235|Wax|110||648648000 + 8236|WaxBee|110||648648000 + 8238|WaxParaffin|110||648648000 + 8239|WaxPlant|110||648648000 + 8241|Leather|000||648648000 + 8242|IodineSalt|000||648648000 + 8247|Basalz|000||648648000 + 8248|Blitz|000||648648000 + 8249|Dynamite|000||648648000 + 8250|DyeBlack|000||648648000 + 8251|DyeRed|000||648648000 + 8252|DyeGreen|000||648648000 + 8253|DyeBrown|000||648648000 + 8254|DyeBlue|000||648648000 + 8255|DyePurple|000||648648000 + 8256|DyeCyan|000||648648000 + 8257|DyeLightGray|000||648648000 + 8258|DyeGray|000||648648000 + 8259|DyePink|000||648648000 + 8260|DyeLime|000||648648000 + 8261|DyeYellow|000||648648000 + 8262|DyeLightBlue|000||648648000 + 8263|DyeMagenta|000||648648000 + 8264|DyeOrange|000||648648000 + 8265|DyeWhite|000||648648000 + 8266|Asphalt|110||648648000 + 8267|WoodPolished|000||648648000 + 8268|SodiumHydroxide|000||648648000 + 8269|SodiumSulfite|000||648648000 + 8270|SodiumSulfate|000||648648000 + 8271|PotassiumSulfate|000||648648000 + 8272|PotassiumSulfide|000||648648000 + 8273|Porcelain|000||648648000 + 8274|CalciumSulfate|000||648648000 + 8275|Bark|000||648648000 + 8276|ClayBrown|000||648648000 + 8277|PetrifiedWood|000||648648000 + 8278|ManaDiamond|000||648648000 + 8289|Livingwood|000||648648000 + 8290|Dreamwood|000||648648000 + 8296|Greatwood|000||648648000 + 8297|Silverwood|000||648648000 + 8298|EnergiumRed|000||648648000 + 8299|EnergiumCyan|000||648648000 + 8300|Diamond|000||648648000 + 8301|Emerald|000||648648000 + 8302|Ruby|000||648648000 + 8303|BalasRuby|000||648648000 + 8304|Sapphire|000||648648000 + 8305|GreenSapphire|000||648648000 + 8306|Topaz|000||648648000 + 8307|BlueTopaz|000||648648000 + 8308|Tanzanite|000||648648000 + 8309|RedJasper|000||648648000 + 8310|Amber|000||648648000 + 8311|Peridot|000||648648000 + 8312|Opal|000||648648000 + 8313|Amethyst|000||648648000 + 8314|OrangeSapphire|000||648648000 + 8315|YellowSapphire|000||648648000 + 8318|EnderPearl|000||648648000 + 8319|EnderEye|000||648648000 + 8320|NetherStar|000||648648000 + 8321|Jade|000||648648000 + 8322|Craponite|000||648648000 + 8323|Aquamarine|000||648648000 + 8324|Morganite|000||648648000 + 8325|Dioptase|000||648648000 + 8326|Spinel|000||648648000 + 8328|BlueSapphire|000||648648000 + 8330|Lazurite|000||648648000 + 8331|Sodalite|000||648648000 + 8332|Lapis|000||648648000 + 8333|Redstone|000||648648000 + 8334|Coal|000||648648000 + 8335|HydratedCoal|000||648648000 + 8336|Charcoal|000||648648000 + 8337|Lignite|000||648648000 + 8338|Monazite|000||648648000 + 8340|Nikolite|000||648648000 + 8341|Glowstone|000||648648000 + 8342|Firestone|000||648648000 + 8346|NetherQuartz|000||648648000 + 8347|CertusQuartz|000||648648000 + 8348|ChargedCertusQuartz|000||648648000 + 8349|CoalCoke|000||648648000 + 8360|Peat|000||648648000 + 8365|LigniteCoke|000||648648000 + 8383|PurpleSapphire|000||648648000 + 8384|Heliodor|000||648648000 + 8385|Goshenite|000||648648000 + 8386|Bixbite|000||648648000 + 8387|Maxixe|000||648648000 + 8389|Fluix|000||648648000 + 8390|PetroleumCoke|000||648648000 + 8393|SunnyQuartz|000||648648000 + 8395|RedQuartz|000||648648000 + 8396|BlazeQuartz|000||648648000 + 8397|SmokeyQuartz|000||648648000 + 8399|ElvenQuartz|000||648648000 + 8400|ChloroauricAcid|000||648648000 + 8401|ChloroplatinicAcid|000||648648000 + 8402|StannicChloride|000||648648000 + 8403|BlackVitriol|000||648648000 + 8404|BlueVitriol|000||648648000 + 8405|GreenVitriol|000||648648000 + 8406|RedVitriol|000||648648000 + 8407|PinkVitriol|000||648648000 + 8408|CyanVitriol|000||648648000 + 8409|WhiteVitriol|000||648648000 + 8410|GrayVitriol|000||648648000 + 8412|VitriolOfClay|000||648648000 + 8413|TitaniumTetrachloride|000||648648000 + 8415|OnyxRed|000||648648000 + 8416|OnyxBlack|000||648648000 + 8417|Amazonite|000||648648000 + 8418|Bamboo|000||648648000 + 8419|Zircon|000||648648000 + 8420|Azurite|000||648648000 + 8421|Eudialyte|000||648648000 + 8423|DiamondIndustrial|000||648648000 + 8424|PinkDiamond|000||648648000 + 8425|OceanJasper|000||648648000 + 8426|RainforestJasper|000||648648000 + 8427|BlueJasper|000||648648000 + 8428|GreenJasper|000||648648000 + 8429|YellowJasper|000||648648000 + 8430|TigerEye|000||648648000 + 8431|CatsEye|000||648648000 + 8432|DragonEye|000||648648000 + 8433|HawksEye|000||648648000 + 8434|BlackEye|000||648648000 + 8435|TigerIron|000||648648000 + 8436|RedFluorite|000||648648000 + 8437|PinkFluorite|000||648648000 + 8438|BlueFluorite|000||648648000 + 8439|GreenFluorite|000||648648000 + 8440|BlackFluorite|000||648648000 + 8441|WhiteFluorite|000||648648000 + 8442|YellowFluorite|000||648648000 + 8443|OrangeFluorite|000||648648000 + 8444|MagentaFluorite|000||648648000 + 8445|MilkyQuartz|000||648648000 + 8446|BrownAventurine|000||648648000 + 8447|YellowAventurine|000||648648000 + 8448|GreenAventurine|000||648648000 + 8449|BlackAventurine|000||648648000 + 8450|BlueAventurine|000||648648000 + 8451|RedAventurine|000||648648000 + 8455|ClayRed|000||648648000 + 8458|BluePhosphorus|000||648648000 + 8459|RedPhosphorus|000||648648000 + 8460|WhitePhosphorus|000||648648000 + 8461|NiobiumPentoxide|000||648648000 + 8462|TantalumPentoxide|000||648648000 + 8464|BlueDiamond|000||648648000 + 8465|GreenDiamond|000||648648000 + 8467|RedDiamond|000||648648000 + 8468|YellowDiamond|000||648648000 + 8470|Carminite|000||648648000 + 8471|Breeze|000||648648000 + 8500|Stone|110||648648000 + 8501|Concrete|110||648648000 + 8502|Netherrack|110||648648000 + 8503|NetherBrick|110||648648000 + 8504|Endstone|110||648648000 + 8505|Basalt|110||648648000 + 8506|Marble|110||648648000 + 8507|GraniteRed|110||648648000 + 8508|GraniteBlack|110||648648000 + 8511|Diorite|110||648648000 + 8516|MarsSand|110||648648000 + 8518|Granite|110||648648000 + 8521|Livingrock|110||648648000 + 8528|SkyStone|110||648648000 + 8599|Bedrock|000||648648000 + 8600|Electrum|101||648648000 + 8601|SterlingSilver|101||648648000 + 8602|RoseGold|101||648648000 + 8605|CdInAgAlloy|101||648648000 + 8610|Bronze|111||648648000 + 8611|BlackBronze|101||648648000 + 8612|BismuthBronze|111||648648000 + 8614|ArsenicCopper|111||648648000 + 8615|ArsenicBronze|111||648648000 + 8620|Brass|111||648648000 + 8621|CobaltBrass|111||648648000 + 8622|AluminiumAlloy|101||648648000 + 8630|Steel|101||648648000 + 8631|BlackSteel|101||648648000 + 8632|BlueSteel|101||648648000 + 8633|RedSteel|101||648648000 + 8634|DamascusSteel|101||648648000 + 8635|Tungstensteel|101||648648000 + 8636|StainlessSteel|101||648648000 + 8638|TungstenCarbide|101||648648000 + 8640|AnnealedCopper|111||648648000 + 8643|WroughtIron|101||648648000 + 8645|IronMagnetic|101|Fe|648648000 + 8646|SteelMagnetic|101|Steel|648648000 + 8647|NeodymiumMagnetic|101|Nd|648648000 + 8651|SteelGalvanized|101|Steel|648648000 + 8652|TungstenSintered|101||648648000 + 8653|VanadiumSteel|101||648648000 + 8658|ElectrotineAlloy|111||648648000 + 8659|BlueAlloy|111||648648000 + 8660|RedAlloy|111||648648000 + 8661|Invar|101||648648000 + 8662|Constantan|101||648648000 + 8663|Nichrome|101||648648000 + 8664|Kanthal|101||648648000 + 8665|Magnalium|111||648648000 + 8666|Ultimet|101||648648000 + 8667|TinAlloy|111||648648000 + 8668|BatteryAlloy|111||648648000 + 8669|SolderingAlloy|111||648648000 + 8672|Ironwood|111||648648000 + 8673|Steeleaf|101||648648000 + 8674|Knightmetal|101||648648000 + 8675|FierySteel|101||648648000 + 8679|Thaumium|101||648648000 + 8682|Osmiridium|101||648648000 + 8684|Trinaquadalloy|101||648648000 + 8685|ChromiumDioxide|101||648648000 + 8686|VanadiumGallium|101||648648000 + 8687|YttriumBariumCuprate|101||648648000 + 8689|NiobiumTitanium|101||648648000 + 8697|FlamascusSteel|101||648648000 + 8698|Fireleaf|101||648648000 + 8700|AluminiumBrass|111||648648000 + 8702|Alumite|101||648648000 + 8704|VibraniumSteel|101||648648000 + 8705|VibraniumSilver|101||648648000 + 8706|Vibramantium|101||648648000 + 8708|Signalum|111||648648000 + 8709|Lumium|111||648648000 + 8710|Enderium|101||648648000 + 8717|Cyanite|101||648648000 + 8720|Manasteel|101||648648000 + 8721|Terrasteel|101||648648000 + 8722|ElvenElementium|101||648648000 + 8726|VibrantAlloy|101||648648000 + 8727|ConductiveIron|101||648648000 + 8729|EnderiumBase|101||648648000 + 8730|ElectricalSteel|101||648648000 + 8732|Soularium|101||648648000 + 8733|RedstoneAlloy|101||648648000 + 8735|GaiaSpirit|101||648648000 + 8737|NikolineAlloy|101||648648000 + 8744|AncientDebris|101||648648000 + 8745|Netherite|101||648648000 + 8746|NetherizedDiamond|101||648648000 + 8747|Efrine|101||648648000 + 8751|Duranium|101||648648000 + 8752|Tritanium|101||648648000 + 8756|Duralumin|101||648648000 + 8784|Adamantine|101||648648000 + 8790|Trinitanium|101||648648000 + 8793|TitaniumIridium|101||648648000 + 8796|HSSG|101||648648000 + 8797|HSSE|101||648648000 + 8798|HSSS|101||648648000 + 8799|CrystalMatrix|101||648648000 + 8800|CosmicNeutronium|101||648648000 + 8802|TantalumHafniumCarbide|101||648648000 + 8803|CastIron|101||648648000 + 9000|Pumice|110||648648000 + 9001|Diatomite|000||648648000 + 9003|BasalticMineralSand|000||648648000 + 9004|GraniticMineralSand|000||648648000 + 9005|GarnetSand|000||648648000 + 9006|QuartzSand|000||648648000 + 9007|UraniumTetrafluoride|000||648648000 + 9008|UraniumHexafluoride|000||648648000 + 9009|Uranium238Tetrafluoride|000||648648000 + 9010|Uranium238Hexafluoride|000||648648000 + 9011|Uranium235Tetrafluoride|000||648648000 + 9012|Uranium235Hexafluoride|000||648648000 + 9100|RareEarth|000||648648000 + 9101|Almandine|000||648648000 + 9102|Andradite|000||648648000 + 9103|Asbestos|110||648648000 + 9104|Hematite|000||648648000 + 9105|Bauxite|000||648648000 + 9106|BrownLimonite|000||648648000 + 9107|Calcite|000||648648000 + 9108|Cassiterite|000||648648000 + 9109|Realgar|000||648648000 + 9110|Celestine|000||648648000 + 9111|Chalcopyrite|000||648648000 + 9113|Chromite|000||648648000 + 9114|Cinnabar|000||648648000 + 9115|Cobaltite|000||648648000 + 9116|Cooperite|000||648648000 + 9117|Galena|000||648648000 + 9118|Garnierite|000||648648000 + 9119|Grossular|000||648648000 + 9120|Ilmenite|000||648648000 + 9122|Magnetite|000||648648000 + 9123|Molybdenite|000||648648000 + 9124|Powellite|000||648648000 + 9125|Pyrite|000||648648000 + 9126|Pyrolusite|000||648648000 + 9127|Pyrope|000||648648000 + 9128|Scheelite|000||648648000 + 9129|Spessartine|000||648648000 + 9130|Sphalerite|000||648648000 + 9131|Stibnite|000||648648000 + 9132|Tetrahedrite|000||648648000 + 9133|Tungstate|000||648648000 + 9134|Uraninite|000||648648000 + 9135|Uvarovite|000||648648000 + 9136|Wulfenite|000||648648000 + 9137|YellowLimonite|000||648648000 + 9138|Perlite|000||648648000 + 9139|Borax|000||648648000 + 9140|PotassiumFeldspar|000||648648000 + 9141|Biotite|000||648648000 + 9143|VanadiumMagnetite|000||648648000 + 9144|Bastnasite|000||648648000 + 9145|Pentlandite|000||648648000 + 9146|Spodumene|000||648648000 + 9147|Pollucite|000||648648000 + 9148|Tantalite|000||648648000 + 9149|Lepidolite|000||648648000 + 9150|Glauconite|000||648648000 + 9152|Vermiculite|000||648648000 + 9153|Bentonite|000||648648000 + 9154|Palygorskite|000||648648000 + 9155|Pitchblende|000||648648000 + 9156|Malachite|000||648648000 + 9157|Mirabilite|000||648648000 + 9158|Mica|000||648648000 + 9159|Trona|000||648648000 + 9160|Barite|000||648648000 + 9161|Gypsum|000||648648000 + 9162|Alunite|000||648648000 + 9164|Wollastonite|000||648648000 + 9165|Zeolite|000||648648000 + 9166|Kyanite|000||648648000 + 9167|Kaolinite|000||648648000 + 9169|Talc|000||648648000 + 9171|Greenschist|110||648648000 + 9174|Graphite|000||648648000 + 9175|Graphene|000||648648000 + 9177|Komatiite|110||648648000 + 9180|Quartzite|110||648648000 + 9184|Blueschist|110||648648000 + 9185|Bluestone|110||648648000 + 9186|Chert|110||648648000 + 9187|Dacite|110||648648000 + 9188|Andesite|110||648648000 + 9189|Limestone|110||648648000 + 9190|Shale|110||648648000 + 9192|Rutile|000||648648000 + 9193|Stolzite|000||648648000 + 9194|Ferberite|000||648648000 + 9195|Huebnerite|000||648648000 + 9196|Russellite|000||648648000 + 9197|Pinalite|000||648648000 + 9198|DiduraniumTrioxide|000||648648000 + 9199|DuraniumHexafluoride|000||648648000 + 9200|DuraniumHexachloride|000||648648000 + 9201|DuraniumHexabromide|000||648648000 + 9202|DuraniumHexaiodide|000||648648000 + 9203|DuraniumHexaastatide|000||648648000 + 9204|TritaniumDioxide|000||648648000 + 9205|TritaniumHexafluoride|000||648648000 + 9206|TritaniumHexachloride|000||648648000 + 9207|TritaniumHexabromide|000||648648000 + 9208|TritaniumHexaiodide|000||648648000 + 9209|TritaniumHexaastatide|000||648648000 + 9210|Bromargyrite|000||648648000 + 9211|Smithsonite|000||648648000 + 9212|Sperrylite|000||648648000 + 9213|Kesterite|000||648648000 + 9214|Stannite|000||648648000 + 9215|Fluorite|000||648648000 + 9216|Arsenopyrite|000||648648000 + 9217|Wolframite|000||648648000 + 9218|Kimberlite|110||648648000 + 9219|Prismarine|110||648648000 + 9220|PrismarineDark|110||648648000 + 9221|Bischofite|000||648648000 + 9222|Slate|110||648648000 + 9223|Blackstone|110||648648000 + 9243|ClayBrick|000||648648000 + 9246|Columbite|000||648648000 + 9247|Coltan|000||648648000 + 9248|Deepslate|110||648648000 + 9261|TitanRock|110||648648000 + 9271|Quicklime|000||648648000 + 9300|Oak|000||648648000 + 9301|Birch|000||648648000 + 9302|Spruce|000||648648000 + 9303|Junglewood|000||648648000 + 9304|Acacia|000||648648000 + 9305|DarkOak|000||648648000 + 9306|Crimsonwood|000||648648000 + 9307|Warpedwood|000||648648000 + 9308|WoodCompressed|000||648648000 + 9309|WoodDead|000||648648000 + 9310|WoodRotten|000||648648000 + 9311|WoodMossy|000||648648000 + 9312|WoodFrozen|000||648648000 + 9313|Maple|000||648648000 + 9314|Willow|000||648648000 + 9315|BlueMahoe|000||648648000 + 9316|Hazel|000||648648000 + 9317|Cinnamonwood|000||648648000 + 9318|Coconutwood|000||648648000 + 9319|Rainbowood|000||648648000 + 9344|Cherrywood|000||648648000 + 9372|Mangrove|000||648648000 + 9409|BlueSpruce|000||648648000 + 9700|MeatRaw|110|MeatCooked|648648000 + 9701|MeatCooked|110||648648000 + 9702|Wheat|000||648648000 + 9703|Sugar|000||648648000 + 9705|Rye|000||648648000 + 9709|Potato|000||648648000 + 9710|MeatRotten|110||648648000 + 9711|FishCooked|110||648648000 + 9712|FishRaw|110|FishCooked|648648000 + 9713|FishRotten|110||648648000 + 9779|SoylentGreen|110||648648000 + 9780|Cheese|110||648648000 + 9781|Chili|000||648648000 + 9782|Cocoa|000||648648000 + 9783|Chocolate|110||648648000 + 9784|Coffee|000||648648000 + 9785|Cinnamon|000||648648000 + 9790|Milk|000||648648000 + 9791|Honey|000||648648000 + 9792|Tea|000||648648000 + 9793|Honeydew|000||648648000 + 9794|Mint|000||648648000 + 9796|Hazelnut|000||648648000 + 9800|Water|000||648648000 + 9801|Snow|000||648648000 + 9802|Ice|000||648648000 + 9803|FreshWater|000||648648000 + 9804|Saltwater|000||648648000 + 9805|HolyWater|000||648648000 + 9806|SeaWater|000||648648000 + 9808|WaterDistilled|000||648648000 + 9809|HydrogenPeroxide|000||648648000 + 9810|Lava|000||648648000 + 9811|SemiheavyWater|000||648648000 + 9812|HeavyWater|000||648648000 + 9813|TritiatedWater|000||648648000 + 9814|Steam|000||648648000 + 9815|SaltedWater|000||648648000 + 9820|NitroCarbon|000||648648000 + 9821|Glyceryl|000||648648000 + 9822|SodiumPersulfate|000||648648000 + 9823|SodiumSulfide|000||648648000 + 9824|SulfuricAcid|000||648648000 + 9825|NitricAcid|000||648648000 + 9826|HydrochloricAcid|000||648648000 + 9827|AquaRegia|000||648648000 + 9828|Glycerol|000||648648000 + 9829|HydrogenFluoride|000||648648000 + 9830|Air|000||648648000 + 9831|NitrogenDioxide|000||648648000 + 9832|Methane|000||648648000 + 9833|MethaneIce|000||648648000 + 9834|SulfurDioxide|000||648648000 + 9835|SulfurTrioxide|000||648648000 + 9836|CarbonDioxide|000||648648000 + 9837|NitrogenMonoxide|000||648648000 + 9838|CarbonMonoxide|000||648648000 + 9839|HeliumNeon|000||648648000 + 9840|Biomass|000||648648000 + 9841|BioFuel|000||648648000 + 9842|Ethanol|000||648648000 + 9843|CarbonTrioxide|000||648648000 + 9844|DisulfuricAcid|000||648648000 + 9850|Oil|000||648648000 + 9851|OilSand|000||648648000 + 9852|CrudeOil|000||648648000 + 9853|OilShale|000||648648000 + 9860|Fuel|000||648648000 + 9861|NitroFuel|000||648648000 + 9862|Kerosine|000||648648000 + 9863|Diesel|000||648648000 + 9864|Petrol|000||648648000 + 9865|Propane|000||648648000 + 9866|Butane|000||648648000 + 9867|Propylene|000||648648000 + 9868|Ethylene|000||648648000 + 9870|Creosote|000||648648000 + 9871|FishOil|000||648648000 + 9872|SeedOil|000||648648000 + 9873|HempOil|000||648648000 + 9874|LinOil|000||648648000 + 9875|SunflowerOil|000||648648000 + 9876|NutOil|000||648648000 + 9877|OliveOil|000||648648000 + 9880|FryingOilHot|000||648648000 + 9881|Glue|000||648648000 + 9882|Lubricant|000||648648000 + 9883|ConstructionFoam|000||648648000 + 9886|Latex|000||648648000 + """; + + static { + for (String line : DATA.strip().split("\n")) { + String[] f = line.strip().split("\\|", -1); + ROWS.put( + Integer.parseInt(f[0]), + new Row( + f[1], + new Profile( + f[2].charAt(0) == '1', + f[2].charAt(1) == '1', + f[2].charAt(2) == '1', + f[3], + Long.parseLong(f[4])))); + } + } + + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + Row row = ROWS.get(declaration.id()); + if (row == null || !sameName(row.name(), declaration.name())) return declaration; + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + MaterialFactKeys.put( + rules, MaterialFactKeys.SOURCE_EXTRUSION, List.of(MaterialProcessRule.anyForm(row.profile()))); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); + } + + /** The source list spells e.g. {@code SpaceStone} where the port spells {@code Space Stone}. */ + private static boolean sameName(String source, String port) { + if (source.equals(port)) return true; + return source.replaceAll("[^A-Za-z0-9]", "").equalsIgnoreCase(port.replaceAll("[^A-Za-z0-9]", "")); + } +} diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceLensRoles.java b/core/src/main/java/gregtech/content/material/catalog/SourceLensMaterialFacts.java similarity index 76% rename from minecraft/src/main/java/gregtech/content/recipe/SourceLensRoles.java rename to core/src/main/java/gregtech/content/material/catalog/SourceLensMaterialFacts.java index e5512919a..d3424e72e 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceLensRoles.java +++ b/core/src/main/java/gregtech/content/material/catalog/SourceLensMaterialFacts.java @@ -1,19 +1,18 @@ -package gregtech.content.recipe; +package gregtech.content.material.catalog; // source-rows: the per-row MT line numbers are transcription labels. -import gregtech.api.material.GTMaterial; -import gregtech.content.data.MaterialPrefix; -import gregtech.content.registry.GTItems; -import gregtech.engine.material.GTMaterialRegistry; -import java.util.ArrayList; +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.LinkedHashMap; import java.util.List; -import net.minecraft.world.item.ItemStack; /** Explicit MT.lens roles, including diamond/emerald/sapphire/garnet/jasper/tigereye/aventurine factories. * Source: GregTech6 3703e40308c8c030763fd6297dea8b210d2a77b1, MT.java. * Color is a crafting role, never inferred from RGB. IDs and canonical names guard native identities. */ -public final class SourceLensRoles { +public final class SourceLensMaterialFacts { public enum Color { WHITE, RED, @@ -86,28 +85,28 @@ private record Role(int id, String name, Color color) {} new Role(8450, "BlueAventurine", Color.BLUE) /* MT:1421 */, new Role(8451, "RedAventurine", Color.RED) /* MT:1422 */); - private SourceLensRoles() {} + private SourceLensMaterialFacts() {} - public static Color color(GTMaterial material) { - if (material == null || !material.isValid() || gregtech.engine.addon.AddonMaterials.owns(material)) return null; - for (Role role : ROLES) - if (material.getId() == role.id - && material.getName().replace(" ", "").equals(role.name) - && GTMaterialRegistry.get(role.id) == material - && GTMaterialRegistry.get(role.name) == material) return role.color; - return null; - } - - /** Only actual registered native lens holders; recipe matching retains normal form/tag equivalence. */ - public static List lenses(Color color) { - var result = new ArrayList(); + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { for (Role role : ROLES) { - if (role.color != color) continue; - var material = GTMaterialRegistry.get(role.id); - if (color(material) != color) continue; - var lens = GTItems.getStack(MaterialPrefix.lens, material, 1); - if (!lens.isEmpty()) result.add(lens); + if (role.id != declaration.id()) continue; + if (!materialNameMatches(role.name, declaration.name())) continue; + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + MaterialFactKeys.put( + rules, MaterialFactKeys.SOURCE_LENS_ROLE, List.of(MaterialProcessRule.anyForm(role.color))); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); } - return List.copyOf(result); + return declaration; + } + + private static boolean materialNameMatches(String source, String port) { + return source.equals(port); } } diff --git a/core/src/main/java/gregtech/content/recipe/SourceOreMacerationFacts.java b/core/src/main/java/gregtech/content/material/catalog/SourceMacerationMaterialFacts.java similarity index 82% rename from core/src/main/java/gregtech/content/recipe/SourceOreMacerationFacts.java rename to core/src/main/java/gregtech/content/material/catalog/SourceMacerationMaterialFacts.java index e58483218..7cad09eb2 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceOreMacerationFacts.java +++ b/core/src/main/java/gregtech/content/material/catalog/SourceMacerationMaterialFacts.java @@ -1,12 +1,16 @@ -package gregtech.content.recipe; - -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; +package gregtech.content.material.catalog; +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.LinkedHashMap; +import java.util.List; import java.util.Set; /** * Producer-local MORTAR facts for 997 exact default input identities. Original GT6 is pinned at - * 3703e40308c8c030763fd6297dea8b210d2a77b1. SourceRecyclingFacts supplies ONLY the canonical identity + * 3703e40308c8c030763fd6297dea8b210d2a77b1. SourceRecyclingMaterialFacts supplies ONLY the canonical identity * and declaration location; its thermal flags, smelting targets and native fingerprints are not gates. * *

Both positive and negative sets were closed over MT factories/declarations. Element metal and @@ -22,10 +26,10 @@ * not proof of a native item's ownership, registration, generation eligibility or output availability. * External/addon overrides must be handled by the native caller before using these facts. */ -public final class SourceOreMacerationFacts { - private SourceOreMacerationFacts() {} +public final class SourceMacerationMaterialFacts { + private SourceMacerationMaterialFacts() {} - // 589 source positives: factory closure, original element condition, or explicit declaration. + // 588 source positives: factory closure, original element condition, or explicit declaration. private static final Set MORTAR_YES = Set.of( 30, 31, 40, 60, 110, 120, 130, 150, 160, 190, 200, 260, 270, 278, 280, 290, 300, 310, 320, 330, 370, 380, 470, 480, 490, 500, 510, 520, 550, 560, 570, 580, 630, 700, 780, 790, 800, 810, 820, 830, 840, 850, 870, @@ -86,10 +90,23 @@ private SourceOreMacerationFacts() {} 9133, 9134, 9135, 9140, 9141, 9164, 9169, 9183, 9192, 9193, 9194, 9195, 9196, 9197, 9198, 9199, 9200, 9201, 9202, 9203, 9204, 9205, 9206, 9207, 9208, 9209, 9217, 9820, 9824, 9825, 9827, 9844, 9851, 9852, 9853, 9883); - public static Decision mortar(int id, String canonicalName) { - if (SourceRecyclingFacts.find(id, canonicalName) == null) return Decision.UNKNOWN; - if (MORTAR_YES.contains(id)) return Decision.YES; - if (MORTAR_NO.contains(id)) return Decision.NO; - return Decision.UNKNOWN; + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + if (SourceRecyclingMaterialFacts.find(declaration.id(), declaration.name()) == null) return declaration; + var decision = MORTAR_YES.contains(declaration.id()) + ? MaterialFactKeys.Decision.YES + : MORTAR_NO.contains(declaration.id()) + ? MaterialFactKeys.Decision.NO + : MaterialFactKeys.Decision.UNKNOWN; + if (decision == MaterialFactKeys.Decision.UNKNOWN) return declaration; + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + MaterialFactKeys.put(rules, MaterialFactKeys.SOURCE_MACERATION, List.of(MaterialProcessRule.anyForm(decision))); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); } } diff --git a/core/src/main/java/gregtech/content/material/catalog/SourceOreCrushingMaterialFacts.java b/core/src/main/java/gregtech/content/material/catalog/SourceOreCrushingMaterialFacts.java new file mode 100644 index 000000000..bde99a792 --- /dev/null +++ b/core/src/main/java/gregtech/content/material/catalog/SourceOreCrushingMaterialFacts.java @@ -0,0 +1,66 @@ +package gregtech.content.material.catalog; + +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.LinkedHashMap; +import java.util.List; + +/** Material-specific source Crusher/Hammer facts; host rocks are owned by {@code OreHostFacts}. */ +public final class SourceOreCrushingMaterialFacts { + private SourceOreCrushingMaterialFacts() {} + + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + var hexorium = hexorium(declaration.id(), declaration.name()); + var reviewed = SourceRecyclingMaterialFacts.find(declaration.id(), declaration.name()); + if (reviewed == null && hexorium == MaterialFactKeys.HexoriumKind.NONE) return declaration; + var fact = new MaterialFactKeys.OreCrushingFact( + pulverizing(declaration.id(), declaration.name(), hexorium), hexorium); + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + MaterialFactKeys.put(rules, MaterialFactKeys.SOURCE_ORE_CRUSHING, List.of(MaterialProcessRule.anyForm(fact))); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); + } + + private static MaterialFactKeys.Decision pulverizing(int id, String name, MaterialFactKeys.HexoriumKind hexorium) { + if (hexorium != MaterialFactKeys.HexoriumKind.NONE) return MaterialFactKeys.Decision.NO; + return id == 800 && name.equals("Mercury") + || id == 8333 && name.equals("Redstone") + || id == 9114 && name.equals("Cinnabar") + ? MaterialFactKeys.Decision.YES + : MaterialFactKeys.Decision.NO; + } + + private static MaterialFactKeys.HexoriumKind hexorium(int id, String name) { + return switch (id) { + case 9224 -> + name.equals("HexoriumBlack") + ? MaterialFactKeys.HexoriumKind.BLACK_WHITE + : MaterialFactKeys.HexoriumKind.NONE; + case 9239 -> + name.equals("HexoriumWhite") + ? MaterialFactKeys.HexoriumKind.BLACK_WHITE + : MaterialFactKeys.HexoriumKind.NONE; + case 9225 -> + name.equals("HexoriumRed") + ? MaterialFactKeys.HexoriumKind.RED_GREEN_BLUE + : MaterialFactKeys.HexoriumKind.NONE; + case 9226 -> + name.equals("HexoriumGreen") + ? MaterialFactKeys.HexoriumKind.RED_GREEN_BLUE + : MaterialFactKeys.HexoriumKind.NONE; + case 9228 -> + name.equals("HexoriumBlue") + ? MaterialFactKeys.HexoriumKind.RED_GREEN_BLUE + : MaterialFactKeys.HexoriumKind.NONE; + default -> MaterialFactKeys.HexoriumKind.NONE; + }; + } +} diff --git a/core/src/main/java/gregtech/content/recipe/SourceRecyclingFacts.java b/core/src/main/java/gregtech/content/material/catalog/SourceRecyclingMaterialFacts.java similarity index 95% rename from core/src/main/java/gregtech/content/recipe/SourceRecyclingFacts.java rename to core/src/main/java/gregtech/content/material/catalog/SourceRecyclingMaterialFacts.java index 0477a39be..9d6009919 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceRecyclingFacts.java +++ b/core/src/main/java/gregtech/content/material/catalog/SourceRecyclingMaterialFacts.java @@ -1,13 +1,14 @@ -package gregtech.content.recipe; +package gregtech.content.material.catalog; import static gregtech.api.material.GTValues.U; +import static gregtech.content.material.MaterialFactKeys.Decision; +import static gregtech.content.material.MaterialFactKeys.Identity; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.*; /** * Finite facts for the existing dust-or-ingot 1U thermal recycling producer, not global material metadata. @@ -23,14 +24,8 @@ * loop at 657-662. Source density is not inferred here: the planner consumes valid runtime density, * target melting and actual fluid temperature without claiming imported-stat parity. */ -public final class SourceRecyclingFacts { - private SourceRecyclingFacts() {} - - public enum Decision { - YES, - NO, - UNKNOWN - } +public final class SourceRecyclingMaterialFacts { + private SourceRecyclingMaterialFacts() {} public enum PhaseKind { DEFAULT_BINDING, @@ -44,15 +39,6 @@ public enum Accessor { GAS } - public record Identity(int id, String name) { - public Identity { - Objects.requireNonNull(name); - } - - public boolean matches(int materialId, String canonicalName) { - return id == materialId && name.equals(canonicalName); - } - } /** The source path is provenance, not a promise of the same modern native registry spelling. */ public record Binding( String sourceRegistryPath, @@ -97,6 +83,7 @@ public record Facts( long targetUnitsPerU, Phase phase, PortDefaults portDefaults, + boolean inputEligible, int sourceLine) { public Facts { Objects.requireNonNull(identity); @@ -105,6 +92,7 @@ public record Facts( Objects.requireNonNull(furnace); Objects.requireNonNull(target); Objects.requireNonNull(phase); + Objects.requireNonNull(portDefaults); if (targetUnitsPerU < 0 || sourceLine <= 0) throw new IllegalArgumentException("Invalid source fact"); } } @@ -143,34 +131,47 @@ private record Seed(Identity identity, int flags, int targetId, long amount, int private static final Set OPTIONAL_EXTERNAL = Set.of( 120, 130, 220, 260, 270, 280, 290, 300, 320, 470, 500, 780, 790, 820, 8318, 8333, 8341, 8600, 8610, 8630, 8661, 8700, 8702, 8708, 8709, 8710, 8752); + private static final Map SOURCE_MOLTEN_FLUIDS = Map.ofEntries( + Map.entry(62, "Carbon14"), + Map.entry(1250, "TritaniumElemental"), + Map.entry(1260, "Trinium"), + Map.entry(1450, "DuraniumElemental"), + Map.entry(1740, "Naquadah"), + Map.entry(1741, "NaquadahEnriched"), + Map.entry(1742, "Naquadria"), + Map.entry(8020, "PotassiumCarbonate"), + Map.entry(8026, "TungstenTrioxide"), + Map.entry(8030, "FerrousChloride"), + Map.entry(8034, "LithiumPerchlorate"), + Map.entry(8266, "Asphalt"), + Map.entry(8500, "Stone"), + Map.entry(9120, "Ilmenite"), + Map.entry(9192, "Rutile")); private static final Map BY_ID = createFacts(); - private static final List ALL = List.copyOf(BY_ID.values()); - // These two output-only identities have no default 1U input, but their own target metadata - // still participates in the Melter target-to-Calcite gate. Reviewed port defaults, not source flags. - private static final Map TARGET_ONLY_DEFAULTS = Map.of( - 9800, new PortDefaults(false, new Identity(9800, "Water"), U, false), - 9810, new PortDefaults(false, new Identity(9810, "Lava"), U, false)); /** Null means unsupported identity, never an implicit source-negative decision. */ - public static Facts find(int id, String canonicalName) { + static Facts find(int id, String canonicalName) { Facts value = BY_ID.get(id); return value != null && value.identity().matches(id, canonicalName) ? value : null; } - public static PortDefaults defaults(int id, String canonicalName) { - Facts facts = find(id, canonicalName); - return facts == null ? null : facts.portDefaults(); - } - /** Includes the two reviewed target-only profiles; this does not grant input-form eligibility. */ - public static PortDefaults contextDefaults(int id, String canonicalName) { - Facts facts = find(id, canonicalName); - return facts == null - ? null - : facts.portDefaults() != null ? facts.portDefaults() : TARGET_ONLY_DEFAULTS.get(id); - } - - public static List all() { - return ALL; + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + Facts facts = find(declaration.id(), declaration.name()); + if (facts == null) return declaration; + var info = declaration.info(); + var rules = new java.util.LinkedHashMap<>(info.processes().rules()); + MaterialFactKeys.put(rules, MaterialFactKeys.SOURCE_RECYCLING, List.of(MaterialProcessRule.anyForm(facts))); + if (declaration.name().equals(SOURCE_MOLTEN_FLUIDS.get(declaration.id()))) { + MaterialFactKeys.put( + rules, MaterialFactKeys.SOURCE_MOLTEN_FLUID, List.of(MaterialProcessRule.anyForm(Boolean.TRUE))); + } + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); } private static Decision decision(int flags, int bit) { @@ -199,8 +200,12 @@ private static Map createFacts() { binding, optional); boolean melting = decision(seed.flags(), M) == Decision.YES; - PortDefaults port = null; - if (id != 9800 && id != 9810) { + boolean inputEligible = id != 9800 && id != 9810; + PortDefaults port; + if (!inputEligible) { + // Output-only identities still carry target metadata for Melter context queries. + port = new PortDefaults(false, seed.identity(), U, false); + } else { boolean nativeMelting = PORT_EXTRA_MELTING.contains(id) || (melting && !PORT_NO_MELTING.contains(id)); boolean self = PORT_SELF_TARGET.contains(id); port = new PortDefaults( @@ -220,6 +225,7 @@ private static Map createFacts() { seed.amount(), phase, port, + inputEligible, seed.sourceLine())); } for (int id : bindings.keySet()) diff --git a/core/src/main/java/gregtech/content/recipe/SourceOreWashingData.java b/core/src/main/java/gregtech/content/material/catalog/SourceWashingMaterialFacts.java similarity index 83% rename from core/src/main/java/gregtech/content/recipe/SourceOreWashingData.java rename to core/src/main/java/gregtech/content/material/catalog/SourceWashingMaterialFacts.java index 0da7da726..b81fdd123 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceOreWashingData.java +++ b/core/src/main/java/gregtech/content/material/catalog/SourceWashingMaterialFacts.java @@ -1,20 +1,25 @@ -package gregtech.content.recipe; +package gregtech.content.material.catalog; +import gregtech.api.addon.material.MaterialProcessRule; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.LinkedHashMap; import java.util.List; import java.util.Set; /** * Bounded, exact-identity washing facts from original GT6 MT at * 3703e40308c8c030763fd6297dea8b210d2a77b1 (W: 607771f74acb0fe647f7e9412676e72094799545). - * Includes every source positive (20 Mercury, 12 Persulfate, 29 Firestone; 59 identities), - * including the nine inherited refractmetal Firestone tags at MT. The 109 explicit - * negatives are source-declared candidates of the 159 reviewed positive-candidate/tag cases, - * not a blanket default for SupplementalMaterials, addons, or arbitrary matching names. + * Includes every source positive tag edge (20 Mercury, 12 Persulfate, 29 Firestone; 54 + * identities). The current 142 exact identity rows also retain reviewed negatives and + * multi-tag declarations; they are not a blanket default for SupplementalMaterials, addons, + * or arbitrary matching names. * IDs AND canonical names must agree; callers must separately verify native provenance * and must not use these facts as defaults for unreviewed or replaced material identities. */ -public final class SourceOreWashingData { - private SourceOreWashingData() {} +public final class SourceWashingMaterialFacts { + private SourceWashingMaterialFacts() {} public enum Tag { MERCURY, @@ -22,12 +27,6 @@ public enum Tag { FIRESTONE } - public enum Decision { - YES, - NO, - UNKNOWN - } - public record Binding(int materialId, String materialName, Set tags, int sourceLine) { public Binding { tags = Set.copyOf(tags); @@ -184,24 +183,24 @@ private static Binding row(int id, String name, int line, Tag... tags) { row(9214, "Stannite", 3721), row(9216, "Arsenopyrite", 3715)); - public static List bindings() { - return BINDINGS; - } - - public static Binding binding(int id, String canonicalName) { + private static Binding binding(int id, String canonicalName) { for (Binding binding : BINDINGS) if (binding.materialId() == id && binding.materialName().equals(canonicalName)) return binding; return null; } - /** Null means unreviewed, not a known empty source tag set. */ - public static Set expectedTags(int id, String canonicalName) { - Binding binding = binding(id, canonicalName); - return binding == null ? null : binding.tags(); - } - public static Decision decision(int id, String canonicalName, Tag tag) { - Binding binding = binding(id, canonicalName); - if (binding == null || tag == null) return Decision.UNKNOWN; - return binding.tags().contains(tag) ? Decision.YES : Decision.NO; + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + Binding binding = binding(declaration.id(), declaration.name()); + if (binding == null) return declaration; + var info = declaration.info(); + var rules = new LinkedHashMap<>(info.processes().rules()); + MaterialFactKeys.put(rules, MaterialFactKeys.SOURCE_WASHING, List.of(MaterialProcessRule.anyForm(binding))); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(rules))); } } diff --git a/core/src/main/java/gregtech/content/recipe/FurnaceSmeltingRules.java b/core/src/main/java/gregtech/content/recipe/FurnaceSmeltingRules.java index 7f3c2f993..e44b16852 100644 --- a/core/src/main/java/gregtech/content/recipe/FurnaceSmeltingRules.java +++ b/core/src/main/java/gregtech/content/recipe/FurnaceSmeltingRules.java @@ -1,10 +1,12 @@ /* Gregorius Techneticies / GregTech-6 Team source rules, LGPL-3.0-or-later. */ package gregtech.content.recipe; -import gregtech.api.material.*; +import gregtech.api.material.GTMaterial; +import gregtech.api.material.GTValues; +import gregtech.api.material.MaterialProperty; import gregtech.content.data.MaterialPrefix; import gregtech.content.data.generated.MaterialWorkability; -import gregtech.engine.material.*; +import gregtech.content.material.MaterialFactKeys; import java.math.BigInteger; import java.util.List; @@ -38,7 +40,7 @@ public long amount() { public static boolean allows(GTMaterial material) { if (material == null || !material.isValid()) return false; var decision = OreSourcePolicy.furnaceDecision(material); - return decision == SourceRecyclingFacts.Decision.UNKNOWN + return decision == MaterialFactKeys.Decision.UNKNOWN ? legacyAllows(material) : reviewedAllows(decision, material.resolve().has(MaterialProperty.HIDDEN)); } @@ -51,8 +53,8 @@ public static boolean legacyAllows(GTMaterial material) { } /** Shared routing guard for known source decisions. UNKNOWN callers choose their own old fallback; * the source FURNACE fact itself is not rewritten to pretend HIDDEN means source UNUSED. */ - public static boolean reviewedAllows(SourceRecyclingFacts.Decision decision, boolean hidden) { - return decision == SourceRecyclingFacts.Decision.YES && !hidden; + public static boolean reviewedAllows(MaterialFactKeys.Decision decision, boolean hidden) { + return decision == MaterialFactKeys.Decision.YES && !hidden; } /** Target solidifying amount is U, not the source material's smelting amount again. */ public static long amount(long formAmount, long smeltingPerUnit) { diff --git a/core/src/main/java/gregtech/content/recipe/GenerifyingRules.java b/core/src/main/java/gregtech/content/recipe/GenerifyingRules.java index 7918ca205..9fdc82441 100644 --- a/core/src/main/java/gregtech/content/recipe/GenerifyingRules.java +++ b/core/src/main/java/gregtech/content/recipe/GenerifyingRules.java @@ -1,51 +1,12 @@ package gregtech.content.recipe; import gregtech.api.material.GTValues; -import java.util.HashMap; -import java.util.Map; import java.util.Set; -/** - * GT6's generifier rule: every material whose {@code mTargetGenerifying} differs from itself becomes - * one {@code RecipeMapHandlerMaterial} on {@code RM.Generifier}, and that handler expands over every - * prefix the condition {@code And(SIMPLIFIABLE, ingotHot.NOT)} accepts. Each row converts one item of - * a form in the source material into one item of the same form in the target material; the duration - * is the form's material weight in ticks, the EU cost is zero, and nothing converts back. - * - *

The material targets are {@code MT.java}'s {@code setGenerifying} calls plus the - * {@code ANY.*.mToThis} loops that follow them, keyed by GT6 material id so the table does not depend - * on display names. {@code ANY} groups that point at a plain material other than their own name - * (ashes, gems, woods, wax, rubber, plastics, phosphorus, clay, silicon) are already folded into the - * targets, because the loops overwrite the explicit rows they contain.

- */ +/** Form applicability and cost for the generifier recipe family. */ public final class GenerifyingRules { private GenerifyingRules() {} - /** {@code MT.java} {@code setGenerifying} rows and {@code ANY.*.mToThis} loops, as source/target ids. */ - private static final int[] TARGET_IDS = { - 8196, 8218, 8197, 8218, 8201, 8200, 8222, 8221, 8224, 8221, 8236, 8235, 8238, 8235, 8239, 8235, 8267, 8221, - 8276, 8215, 8278, 8300, 8289, 8221, 8290, 8221, 8296, 8221, 8297, 8221, 8302, 8304, 8305, 8304, 8307, 8306, - 8314, 8304, 8315, 8304, 8323, 8301, 8324, 8301, 8328, 8304, 8346, 8445, 8347, 8445, 8348, 8347, 8375, 8333, - 8376, 8332, 8377, 8300, 8378, 8334, 8379, 8301, 8380, 260, 8383, 8304, 8384, 8301, 8385, 8301, 8386, 8301, 8387, - 8301, 8393, 8445, 8395, 8445, 8396, 8445, 8397, 8445, 8399, 8445, 8418, 8221, 8423, 8300, 8424, 8300, 8425, - 8309, 8426, 8309, 8427, 8309, 8428, 8309, 8429, 8309, 8431, 8430, 8432, 8430, 8433, 8430, 8434, 8430, 8435, - 8430, 8436, 9215, 8437, 9215, 8438, 9215, 8439, 9215, 8440, 9215, 8441, 9215, 8442, 9215, 8443, 9215, 8444, - 9215, 8455, 8215, 8458, 8208, 8459, 8208, 8460, 8208, 8464, 8300, 8465, 8300, 8467, 8300, 8468, 8300, 8501, - 8500, 8503, 8502, 8505, 8500, 8506, 8500, 8507, 8500, 8508, 8500, 8511, 8500, 8516, 8500, 8518, 8500, 8521, - 8500, 8528, 8500, 8599, 8500, 8640, 290, 8643, 260, 8645, 260, 8646, 8630, 8647, 600, 8652, 740, 8674, 8630, - 8675, 8630, 8679, 260, 8697, 8634, 8698, 8673, 8720, 260, 8803, 260, 9000, 8500, 9153, 8215, 9154, 8215, 9167, - 8215, 9170, 8500, 9171, 8500, 9176, 8500, 9177, 8500, 9179, 8500, 9180, 8500, 9184, 8500, 9185, 8500, 9186, - 8500, 9187, 8500, 9188, 8500, 9189, 8500, 9190, 8500, 9218, 8500, 9222, 8500, 9223, 8500, 9248, 8500, 9261, - 8500, 9300, 8221, 9301, 8221, 9302, 8221, 9303, 8221, 9304, 8221, 9305, 8221, 9306, 8221, 9307, 8221, 9308, - 8221, 9309, 8221, 9310, 8221, 9311, 8221, 9312, 8221, 9313, 8221, 9314, 8221, 9315, 8221, 9316, 8221, 9317, - 8221, 9318, 8221, 9319, 8221, 9344, 8221, 9372, 8221, 9409, 8221, 9853, 9190, - }; - - /** - * GT6 {@code OP.java} prefixes carrying {@code TD.Prefix.SIMPLIFIABLE}, under the port's prefix - * name ({@code OP.casingSmall} is {@code itemCasing} and {@code OP.boule} is {@code bouleGt}). - * {@code OP.ingotHot} carries no SIMPLIFIABLE tag, which is how hot ingots stay out of the rule. - */ private static final Set SIMPLIFIABLE = Set.of( "arrowGtPlastic", "arrowGtWood", @@ -149,26 +110,10 @@ private GenerifyingRules() {} "wireGt15", "wireGt16"); - private static final Map TARGETS; - - static { - Map targets = new HashMap<>(TARGET_IDS.length / 2); - for (int i = 0; i < TARGET_IDS.length; i += 2) targets.put(TARGET_IDS[i], TARGET_IDS[i + 1]); - TARGETS = Map.copyOf(targets); - } - - /** The target material id, or {@code materialId} itself when the source has no conversion. */ - public static int target(int materialId) { - Integer target = TARGETS.get(materialId); - return target == null ? materialId : target; - } - - /** Whether the source applies the material conversion to this form at all. */ public static boolean simplifiable(String prefixName) { return SIMPLIFIABLE.contains(prefixName); } - /** {@code RecipeMapHandlerMaterial.getCosts}: the form's material weight in ticks, at least one. */ public static long duration(long formWeight) { return Math.max(1, (formWeight + GTValues.U - 1) / GTValues.U); } diff --git a/core/src/main/java/gregtech/content/recipe/OreSourcePolicy.java b/core/src/main/java/gregtech/content/recipe/OreSourcePolicy.java index 0e1d89343..742c1cd50 100644 --- a/core/src/main/java/gregtech/content/recipe/OreSourcePolicy.java +++ b/core/src/main/java/gregtech/content/recipe/OreSourcePolicy.java @@ -2,6 +2,8 @@ import gregtech.api.material.GTMaterial; import gregtech.api.material.MaterialProperty; +import gregtech.content.material.MaterialFactKeys; +import gregtech.content.material.catalog.SourceRecyclingMaterialFacts; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.GTMaterialRegistry; import java.util.ArrayList; @@ -18,23 +20,27 @@ private OreSourcePolicy() {} /** Pure observations used to test default/override boundaries without mutating the registry. * Native callers must obtain ownership observations from the actual registry, not matching names. */ public record FurnaceContext( - SourceRecyclingFacts.Identity material, + MaterialFactKeys.Identity material, boolean coreMaterial, boolean addonMaterial, boolean melting, - SourceRecyclingFacts.Identity target, + MaterialFactKeys.Identity target, boolean coreTarget, boolean addonTarget, long targetUnitsPerU) {} - public static SourceRecyclingFacts.Decision furnaceDecision(GTMaterial material) { + public static MaterialFactKeys.Decision furnaceDecision(GTMaterial material) { var facts = reviewedFurnaceFacts(material); - return facts == null ? SourceRecyclingFacts.Decision.UNKNOWN : facts.furnace(); + if (facts != null) + return facts.furnace() == MaterialFactKeys.Decision.YES + ? MaterialFactKeys.Decision.YES + : MaterialFactKeys.Decision.NO; + return reviewedDecision(material, MaterialFactKeys.SOURCE_FURNACE); } /** Null is unsupported context, not a reviewed source prohibition. Hidden/form availability * remain separate caller guards; HIDDEN is not claimed equivalent to the source UNUSED tag. */ - public static SourceRecyclingFacts.Facts reviewedFurnaceFacts(GTMaterial material) { + public static SourceRecyclingMaterialFacts.Facts reviewedFurnaceFacts(GTMaterial material) { if (material == null || !material.isValid()) return null; var resolved = material.resolve(); if (!resolved.isValid()) return null; @@ -43,17 +49,17 @@ public static SourceRecyclingFacts.Facts reviewedFurnaceFacts(GTMaterial materia target = target.resolve(); if (!target.isValid()) return null; return reviewedFurnaceContext(new FurnaceContext( - new SourceRecyclingFacts.Identity(resolved.getId(), resolved.getName()), + new MaterialFactKeys.Identity(resolved.getId(), resolved.getName()), GTMaterialRegistry.isCoreMaterial(resolved), AddonMaterials.owns(resolved), resolved.has(MaterialProperty.MELTING), - new SourceRecyclingFacts.Identity(target.getId(), target.getName()), + new MaterialFactKeys.Identity(target.getId(), target.getName()), GTMaterialRegistry.isCoreMaterial(target), AddonMaterials.owns(target), resolved.getTargetSmeltingAmount())); } - public static SourceRecyclingFacts.Facts reviewedFurnaceContext(FurnaceContext context) { + public static SourceRecyclingMaterialFacts.Facts reviewedFurnaceContext(FurnaceContext context) { if (context == null || context.material() == null || context.target() == null @@ -62,8 +68,11 @@ public static SourceRecyclingFacts.Facts reviewedFurnaceContext(FurnaceContext c || !context.coreTarget() || context.addonTarget()) return null; var identity = context.material(); - var facts = SourceRecyclingFacts.find(identity.id(), identity.name()); - var defaults = SourceRecyclingFacts.contextDefaults(identity.id(), identity.name()); + var material = GTMaterialRegistry.get(identity.id()); + var facts = material.isValid() && material.getName().equals(identity.name()) + ? MaterialFactKeys.sourceRecycling(material).orElse(null) + : null; + var defaults = facts == null ? null : facts.portDefaults(); return facts != null && defaults != null && defaults.matches( @@ -79,23 +88,20 @@ public static boolean furnaceInput(GTMaterial material) { if (material == null || !material.isValid()) return false; var resolved = material.resolve(); var decision = furnaceDecision(resolved); - if (decision != SourceRecyclingFacts.Decision.UNKNOWN) + if (decision != MaterialFactKeys.Decision.UNKNOWN) return FurnaceSmeltingRules.reviewedAllows(decision, resolved.has(MaterialProperty.HIDDEN)); // Preserve this caller's old bounded profile/MELTING compatibility behavior only for UNKNOWN. - return ReviewedOreSourceProfile.decision(resolved, ReviewedOreSourceProfile.Rule.FURNACE) - .orLegacy(resolved.has(MaterialProperty.MELTING)); + return resolved.has(MaterialProperty.MELTING); } /** Reviewed native inputs belong to the later source furnace listener, not legacy dust-first producers. */ public static boolean usesReviewedFurnaceListener(GTMaterial material) { if (material == null || !material.isValid()) return false; var resolved = material.resolve(); var decision = furnaceDecision(resolved); - if (decision != SourceRecyclingFacts.Decision.UNKNOWN) + if (decision != MaterialFactKeys.Decision.UNKNOWN) return FurnaceSmeltingRules.reviewedAllows(decision, resolved.has(MaterialProperty.HIDDEN)); // Do not reserve unknown inputs unless their pre-existing reviewed listener path already did. - return ReviewedOreSourceProfile.decision(material, ReviewedOreSourceProfile.Rule.FURNACE) - == ReviewedOreSourceProfile.Decision.YES - && FurnaceSmeltingRules.allows(material); + return false; } /** Loader_Recipes_Ores389-393: only opposite magnetic class, declaration order unchanged. */ public static List magneticCandidates(GTMaterial material) { @@ -108,6 +114,11 @@ public static List magneticCandidates(GTMaterial material) { /** Direct paired-source magnetic positives; omitted/addon identities retain legacy flags. */ private static boolean magneticClass(GTMaterial material) { var m = material.resolve(); - return ReviewedMagneticMaterials.sourcePositive(m) || m.has(MaterialProperty.MAGNETIC); + return m.has(MaterialProperty.MAGNETIC); + } + + private static MaterialFactKeys.Decision reviewedDecision( + GTMaterial material, gregtech.api.addon.material.MaterialProcessKey key) { + return MaterialFactKeys.value(material, key).orElse(MaterialFactKeys.Decision.UNKNOWN); } } diff --git a/core/src/main/java/gregtech/content/recipe/OriginalMaterialFluidUnits.java b/core/src/main/java/gregtech/content/recipe/OriginalMaterialFluidUnits.java deleted file mode 100644 index d8feeb7bd..000000000 --- a/core/src/main/java/gregtech/content/recipe/OriginalMaterialFluidUnits.java +++ /dev/null @@ -1,104 +0,0 @@ -package gregtech.content.recipe; - -import gregtech.api.material.GTValues; -import gregtech.engine.recipe.UnitConversion; - -/** - * Explicit source phase bindings for audited chemistry and fixed Centrifuge rows. - * Original CS.U=648648000; FL.createMolten uses144mB/U, createGas1000mB/U. - * Physical temperature, texture, and current legacy fluid names do not determine this dimension. - */ -public final class OriginalMaterialFluidUnits { - public static final long SOURCE_UNIT = GTValues.U; - - public record Binding( - String materialName, - int materialId, - String phase, - String fluidField, - String registryName, - long referenceSourceUnits, - long referenceMillibuckets) {} - - private static final Binding[] BINDINGS = { - new Binding("Cryolite", 8009, "liquid", "GenLiquid_Cryolite", "cryolite", SOURCE_UNIT, 144), - new Binding( - "AluminiumFluoride", - 8010, - "liquid", - "GenLiquid_AluminiumFluoride", - "aluminiumfluoride", - SOURCE_UNIT, - 144), - new Binding( - "LithiumChloride", 8029, "liquid", "GenLiquid_LithiumChloride", "lithiumchloride", SOURCE_UNIT, 144), - new Binding( - "LithiumChlorate", 8033, "liquid", "GenLiquid_LithiumChlorate", "lithiumchlorate", SOURCE_UNIT, 144), - new Binding("CarbonDioxide", 9836, "gas", "CarbonDioxide", "carbondioxide", SOURCE_UNIT, 1000), - new Binding("Fluorine", 90, "gas", "GenGas_Fluorine", "fluorine", SOURCE_UNIT, 1000), - new Binding("Chocolate", 9783, "liquid", "GenMolten_Chocolate", "molten.chocolate", SOURCE_UNIT, 144), - new Binding("Deuterium", 11, "gas", "Deuterium", "deuterium", SOURCE_UNIT, 1000), - new Binding("FishOil", 9871, "liquid", "Oil_Fish", "fishoil", SOURCE_UNIT, 1000), - new Binding("HeavyWater", 9812, "liquid", "GenGas_HeavyWater", "heavywater", SOURCE_UNIT, 1000), - new Binding("Helium", 20, "gas", "Helium", "helium", SOURCE_UNIT, 1000), - new Binding("Helium3", 21, "gas", "GenGas_Helium3", "helium3", SOURCE_UNIT, 1000), - new Binding("Hydrogen", 10, "gas", "Hydrogen", "hydrogen", SOURCE_UNIT, 1000), - new Binding("Mercury", 800, "liquid", "GenLiquid_Mercury", "mercury", SOURCE_UNIT, 144), - new Binding("NitrogenDioxide", 9831, "gas", "GenGas_NitrogenDioxide", "nitrogendioxide", SOURCE_UNIT, 1000), - new Binding("SemiheavyWater", 9811, "liquid", "GenGas_SemiheavyWater", "semiheavywater", SOURCE_UNIT, 1000), - new Binding("TritiatedWater", 9813, "liquid", "GenGas_TritiatedWater", "tritiatedwater", SOURCE_UNIT, 1000), - new Binding( - "Uranium235Hexafluoride", - 9012, - "gas", - "GenGas_Uranium235Hexafluoride", - "uranium235hexafluoride", - SOURCE_UNIT, - 1000), - new Binding( - "Uranium238Hexafluoride", - 9010, - "gas", - "GenGas_Uranium238Hexafluoride", - "uranium238hexafluoride", - SOURCE_UNIT, - 1000), - new Binding( - "UraniumHexafluoride", - 9008, - "gas", - "GenGas_UraniumHexafluoride", - "uraniumhexafluoride", - SOURCE_UNIT, - 1000), - }; - - private OriginalMaterialFluidUnits() {} - - /** Unknown or conflicting source identities are deliberately unsupported, not guessed. */ - public static Binding binding(String canonicalName, int materialId, String phase) { - for (Binding binding : BINDINGS) { - if (binding.materialName().equals(canonicalName) - && binding.materialId() == materialId - && binding.phase().equals(phase)) return binding; - } - return null; - } - - /** Name/phase lookup for callers that do not carry the numeric material id. */ - public static Binding binding(String canonicalName, String phase) { - for (Binding binding : BINDINGS) { - if (binding.materialName().equals(canonicalName) && binding.phase().equals(phase)) return binding; - } - return null; - } - - /** - * Original UT.Code.units ratio and final rounding, without signed multiplication overflow. - * Returns -1 for invalid inputs or results outside native FluidStack int capacity; zero stays - * zero, never coerced to1. This is quantity arithmetic, not zero-volume catalyst semantics. - */ - public static int millibuckets(long sourceAmount, long sourceUnit, long referenceMillibuckets, boolean roundUp) { - return UnitConversion.fluidAmount(sourceUnit, referenceMillibuckets, sourceAmount, roundUp); - } -} diff --git a/core/src/main/java/gregtech/content/recipe/ReviewedMagneticMaterials.java b/core/src/main/java/gregtech/content/recipe/ReviewedMagneticMaterials.java deleted file mode 100644 index 6d5a45d13..000000000 --- a/core/src/main/java/gregtech/content/recipe/ReviewedMagneticMaterials.java +++ /dev/null @@ -1,77 +0,0 @@ -package gregtech.content.recipe; - -import gregtech.api.material.GTMaterial; -import gregtech.engine.addon.AddonMaterials; -import gregtech.engine.material.GTMaterialRegistry; - -/** Paired MT direct magnetic-tag positives only; omission is UNKNOWN, never a negative. - * ID+canonical name and core ownership bind source facts; no global material flags mutate. - * Original MT SHA12936831b1b5f419dc783c5f32f3cc07a329734ca6c5c11757d52e1be27904b2; - * paired w SHA9530c229de3483ab7be300c49ce1e08e44bcabfe9bdebd7844becefbd4782728. - */ -public final class ReviewedMagneticMaterials { - private ReviewedMagneticMaterials() {} - - private static final java.util.Map POSITIVE = java.util.Map.ofEntries( - java.util.Map.entry(250, "Manganese"), - java.util.Map.entry(260, "Iron"), - java.util.Map.entry(270, "Cobalt"), - java.util.Map.entry(278, "Cobalt60"), - java.util.Map.entry(280, "Nickel"), - java.util.Map.entry(600, "Neodymium"), - java.util.Map.entry(670, "Holmium"), - java.util.Map.entry(830, "Bismuth"), - java.util.Map.entry(2220, "Adamantium"), - java.util.Map.entry(8030, "FerrousChloride"), - java.util.Map.entry(8234, "VanadiumPentoxide"), - java.util.Map.entry(8247, "Basalz"), - java.util.Map.entry(8630, "Steel"), - java.util.Map.entry(8634, "DamascusSteel"), - java.util.Map.entry(8635, "Tungstensteel"), - java.util.Map.entry(8643, "WroughtIron"), - java.util.Map.entry(8645, "IronMagnetic"), - java.util.Map.entry(8646, "SteelMagnetic"), - java.util.Map.entry(8647, "NeodymiumMagnetic"), - java.util.Map.entry(8653, "VanadiumSteel"), - java.util.Map.entry(8661, "Invar"), - java.util.Map.entry(8662, "Constantan"), - java.util.Map.entry(8672, "Ironwood"), - java.util.Map.entry(8673, "Steeleaf"), - java.util.Map.entry(8674, "Knightmetal"), - java.util.Map.entry(8675, "FierySteel"), - java.util.Map.entry(8679, "Thaumium"), - java.util.Map.entry(8685, "ChromiumDioxide"), - java.util.Map.entry(8697, "FlamascusSteel"), - java.util.Map.entry(8698, "Fireleaf"), - java.util.Map.entry(8704, "VibraniumSteel"), - java.util.Map.entry(8706, "Vibramantium"), - java.util.Map.entry(8727, "ConductiveIron"), - java.util.Map.entry(8730, "ElectricalSteel"), - java.util.Map.entry(8744, "AncientDebris"), - java.util.Map.entry(8745, "Netherite"), - java.util.Map.entry(8746, "NetherizedDiamond"), - java.util.Map.entry(8747, "Efrine"), - java.util.Map.entry(8784, "Adamantine"), - java.util.Map.entry(8803, "CastIron"), - java.util.Map.entry(9003, "BasalticMineralSand"), - java.util.Map.entry(9004, "GraniticMineralSand"), - java.util.Map.entry(9104, "Hematite"), - java.util.Map.entry(9106, "BrownLimonite"), - java.util.Map.entry(9115, "Cobaltite"), - java.util.Map.entry(9118, "Garnierite"), - java.util.Map.entry(9120, "Ilmenite"), - java.util.Map.entry(9122, "Magnetite"), - java.util.Map.entry(9125, "Pyrite"), - java.util.Map.entry(9126, "Pyrolusite"), - java.util.Map.entry(9137, "YellowLimonite"), - java.util.Map.entry(9143, "VanadiumMagnetite"), - java.util.Map.entry(9145, "Pentlandite")); - - public static boolean sourcePositive(GTMaterial material) { - if (material == null || !material.isValid()) return false; - var m = material.resolve(); - return GTMaterialRegistry.isCoreMaterial(m) - && !AddonMaterials.owns(m) - && m.getName().equals(POSITIVE.get(m.getId())); - } -} diff --git a/core/src/main/java/gregtech/content/recipe/ReviewedOreGeneratedFluids.java b/core/src/main/java/gregtech/content/recipe/ReviewedOreGeneratedFluids.java deleted file mode 100644 index 02c9caa56..000000000 --- a/core/src/main/java/gregtech/content/recipe/ReviewedOreGeneratedFluids.java +++ /dev/null @@ -1,72 +0,0 @@ -package gregtech.content.recipe; - -import gregtech.api.material.*; -import gregtech.content.data.FluidCatalog; -import gregtech.engine.addon.AddonMaterials; -import gregtech.engine.material.GTMaterialRegistry; - -/** Source-bound generated Mercury only. Never treats equal external definitions as factory-owned. */ -public final class ReviewedOreGeneratedFluids { - private ReviewedOreGeneratedFluids() {} - - public static boolean mercury(FluidCatalog.FluidEntry entry) { - String field = "GenLiquid_Mercury"; - if (entry == null - || !FluidCatalog.canonicalField(field).equals(field) - || !FluidCatalog.isGeneratedGasLiquidDefinition(field, entry)) return false; - var material = GTMaterialRegistry.get("Mercury"); - if (material == null || !material.isValid()) return false; - material = material.resolve(); - if (material.getId() != 800 - || !material.getName().equals("Mercury") - || !GTMaterialRegistry.isCoreMaterial(material) - || AddonMaterials.owns(material)) return false; - return entry.registryName().equals("mercury") - && "Mercury".equals(entry.materialKey()) - && entry.textureMode() == FluidCatalog.FluidTextureMode.DEDICATED - && entry.tintArgb() == 0 - && entry.tintTexture() - && !entry.glint() - && !entry.gas() - && entry.density() == 0 - && entry.viscosity() == 0 - && entry.luminosity() == 0 - && entry.temperature() == 300 - && entry.flags() == FluidCatalog.FluidFlags.LIQUID; - } - /** Two source-reviewed ordinary-dust targets; absent/unowned/mutated identities defer. */ - public static boolean wholeDustMetal(gregtech.api.material.GTMaterial material, FluidCatalog.FluidEntry entry) { - if (material == null || entry == null) return false; - material = material.resolve(); - if (!GTMaterialRegistry.isCoreMaterial(material) || AddonMaterials.owns(material)) return false; - int temperature; - float density; - if (material.getId() == 220 && material.getName().equals("Titanium")) { - temperature = 1941; - density = 4.54F; - } else if (material.getId() == 260 && material.getName().equals("Iron")) { - temperature = 1811; - density = 7.874F; - } else return false; - String field = "GenMolten_" + material.getName(); - return FluidCatalog.isGeneratedMoltenDefinition(field, entry) - && material.getTargetSmeltingMaterial() != null - && material.getTargetSmeltingMaterial().resolve() == material - && material.getTargetSmeltingAmount() == gregtech.api.material.GTValues.U - && material.getMeltingPoint() == temperature - && material.getDensity() == density - && material.has(gregtech.api.material.MaterialProperty.MELTING) - && !material.has(gregtech.api.material.MaterialProperty.ANTIMATTER) - && entry.registryName().equals("molten." + material.getName().toLowerCase(java.util.Locale.ROOT)) - && material.getName().equals(entry.materialKey()) - && entry.textureMode() == FluidCatalog.FluidTextureMode.GENERIC_MOLTEN - && entry.tintTexture() - && !entry.glint() - && !entry.gas() - && entry.density() == 0 - && entry.viscosity() == 0 - && entry.luminosity() == 10 - && entry.temperature() == temperature - && entry.flags() == FluidCatalog.FluidFlags.LIQUID; - } -} diff --git a/core/src/main/java/gregtech/content/recipe/ReviewedSiftingGemForms.java b/core/src/main/java/gregtech/content/recipe/ReviewedSiftingGemForms.java deleted file mode 100644 index 802e80b68..000000000 --- a/core/src/main/java/gregtech/content/recipe/ReviewedSiftingGemForms.java +++ /dev/null @@ -1,36 +0,0 @@ -package gregtech.content.recipe; - -import gregtech.api.material.GTMaterial; -import gregtech.content.data.MaterialPrefix; -import gregtech.engine.addon.AddonMaterials; -import gregtech.engine.material.GTMaterialRegistry; -import java.util.Set; - -/** Bounded per-form source generation facts, not a ban on actual external registrations. - * Original OP174-178 / W178-182 require CRYSTAL for upper grades; Ice MT1013 / W1020 - * has TRANSPARENT, not CRYSTAL. OP613-615 / W617-619 force only common/flawed/chipped. - * Existing IDs remain registered. The native resolver checks supported startup external overrides before this table. - * A later crafting-grade tag alias alone is not a supported Sifting output binding. - * All omitted identities/forms remain UNKNOWN; the earlier material-wide profile is unchanged. - */ -public final class ReviewedSiftingGemForms { - private ReviewedSiftingGemForms() {} - - private record Entry(int id, String name, Set absentPrefixes) {} - - private static final Entry[] ENTRIES = { - new Entry(9802, "Ice", Set.of("gemLegendary", "gemExquisite", "gemFlawless")) - }; - - public static ReviewedOreSourceProfile.Decision decision(GTMaterial material, MaterialPrefix prefix) { - if (material == null || prefix == null) return ReviewedOreSourceProfile.Decision.UNKNOWN; - material = material.resolve(); - if (!material.isValid() || !GTMaterialRegistry.isCoreMaterial(material) || AddonMaterials.owns(material)) - return ReviewedOreSourceProfile.Decision.UNKNOWN; - for (var row : ENTRIES) - if (row.id == material.getId() - && row.name.equals(material.getName()) - && row.absentPrefixes.contains(prefix.getName())) return ReviewedOreSourceProfile.Decision.NO; - return ReviewedOreSourceProfile.Decision.UNKNOWN; - } -} diff --git a/core/src/main/java/gregtech/content/recipe/SourceExtrusionRules.java b/core/src/main/java/gregtech/content/recipe/SourceExtrusionRules.java index bd20ad5e9..3a41fe418 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceExtrusionRules.java +++ b/core/src/main/java/gregtech/content/recipe/SourceExtrusionRules.java @@ -2,806 +2,38 @@ import gregtech.api.material.GTMaterial; import gregtech.api.material.GTValues; +import gregtech.api.material.MaterialProperty; +import gregtech.content.material.MaterialFactKeys; +import gregtech.content.material.catalog.SourceExtrusionMaterialFacts; import gregtech.content.recipe.generated.GTMaterialFields; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.GTMaterialRegistry; -import java.util.HashMap; -import java.util.Map; -/** Native GT6 MT factory/direct extrusion flags and forging targets, pinned to 3703e403. - * Generated from GT6 {@code MT.java} at 3703e403; absence is not inferred from the port's broad METAL flag. - * Profiles are bound to exact native identities; addons are not assigned original identities by name. - */ +/** Native extrusion recipe behavior backed by the material's source profile. */ public final class SourceExtrusionRules { private SourceExtrusionRules() {} - public record Profile(boolean extrudable, boolean simple, boolean smithable, String target, long forgingAmount) {} - - private record Row(String name, Profile profile) {} - - private static final Map ROWS = new HashMap<>(); - private static final String DATA = """ - 0|Empty|000||648648000 - 1|Photon|000||648648000 - 2|Neutrino|000||648648000 - 3|Neutron|000||648648000 - 4|Proton|000||648648000 - 5|Electron|000||648648000 - 10|Hydrogen|000||648648000 - 11|Deuterium|000||648648000 - 12|Tritium|000||648648000 - 20|Helium|000||648648000 - 21|Helium3|000||648648000 - 30|Lithium|111||648648000 - 31|Lithium6|111||648648000 - 40|Beryllium|101||648648000 - 41|Beryllium7|101||648648000 - 42|Beryllium8|101||648648000 - 50|Boron|101||648648000 - 51|Boron11|101||648648000 - 60|Carbon|000||648648000 - 61|Carbon13|000||648648000 - 62|Carbon14|000||648648000 - 70|Nitrogen|000||648648000 - 80|Oxygen|000||648648000 - 90|Fluorine|000||648648000 - 100|Neon|000||648648000 - 110|Sodium|111||648648000 - 120|Magnesium|111||648648000 - 130|Aluminium|111||648648000 - 140|Silicon|101||648648000 - 150|Phosphor|000||648648000 - 160|Sulfur|000||648648000 - 170|Chlorine|000||648648000 - 180|Argon|000||648648000 - 190|Potassium|111||648648000 - 200|Calcium|111||648648000 - 210|Scandium|101||648648000 - 220|Titanium|101||648648000 - 230|Vanadium|101||648648000 - 240|Chromium|101||648648000 - 250|Manganese|101||648648000 - 260|Iron|101||648648000 - 270|Cobalt|101||648648000 - 278|Cobalt60|101||648648000 - 280|Nickel|101||648648000 - 290|Copper|111||648648000 - 300|Zinc|111||648648000 - 310|Gallium|111||648648000 - 320|Germanium|111||648648000 - 330|Arsenic|111||648648000 - 340|Selenium|000||648648000 - 350|Bromine|000||648648000 - 360|Krypton|000||648648000 - 370|Rubidium|111||648648000 - 380|Strontium|111||648648000 - 390|Yttrium|101||648648000 - 400|Zirconium|101||648648000 - 410|Niobium|101||648648000 - 420|Molybdenum|101||648648000 - 430|Technetium|101||648648000 - 440|Ruthenium|101||648648000 - 450|Rhodium|101||648648000 - 460|Palladium|101||648648000 - 470|Silver|101||648648000 - 480|Cadmium|111||648648000 - 490|Indium|111||648648000 - 500|Tin|111||648648000 - 510|Antimony|111||648648000 - 520|Tellurium|111||648648000 - 530|Iodine|000||648648000 - 540|Xenon|000||648648000 - 550|Caesium|111||648648000 - 560|Barium|111||648648000 - 570|Lanthanium|111||648648000 - 580|Cerium|111||648648000 - 590|Praseodymium|101||648648000 - 600|Neodymium|101||648648000 - 610|Promethium|101||648648000 - 620|Samarium|101||648648000 - 630|Europium|111||648648000 - 640|Gadolinium|101||648648000 - 650|Terbium|101||648648000 - 660|Dysprosium|101||648648000 - 670|Holmium|101||648648000 - 680|Erbium|101||648648000 - 690|Thulium|101||648648000 - 700|Ytterbium|111||648648000 - 710|Lutetium|101||648648000 - 720|Hafnium|101||648648000 - 730|Tantalum|101||648648000 - 740|Tungsten|101||648648000 - 750|Rhenium|101||648648000 - 760|OsmiumElemental|101||648648000 - 770|Iridium|101||648648000 - 780|Platinum|101||648648000 - 790|Gold|101||648648000 - 791|Gold198|101||648648000 - 800|Mercury|111||648648000 - 810|Thallium|111||648648000 - 820|Lead|111||648648000 - 830|Bismuth|111||648648000 - 840|Polonium|111||648648000 - 850|Astatine|111||648648000 - 860|Radon|000||648648000 - 870|Francium|111||648648000 - 880|Radium|111||648648000 - 890|Actinium|101||648648000 - 900|Thorium|101||648648000 - 910|Protactinium|101||648648000 - 920|Uranium|101||648648000 - 921|Uranium235|101||648648000 - 922|Uranium233|101||648648000 - 930|Neptunium|111||648648000 - 940|Plutonium|111||648648000 - 942|Plutonium240|111||648648000 - 943|Plutonium241|111||648648000 - 945|Plutonium243|111||648648000 - 946|Plutonium238|111||648648000 - 947|Plutonium239|111||648648000 - 950|Americium|101||648648000 - 951|Americium241|101||648648000 - 952|Americium242|101||648648000 - 960|Curium|101||648648000 - 970|Berkelium|101||648648000 - 980|Californium|111||648648000 - 990|Einsteinium|111||648648000 - 1000|Fermium|111||648648000 - 1010|Mendelevium|111||648648000 - 1020|Nobelium|111||648648000 - 1030|Lawrencium|101||648648000 - 1040|Rutherfordium|101||648648000 - 1050|Dubnium|111||648648000 - 1060|Seaborgium|111||648648000 - 1070|Bohrium|111||648648000 - 1080|Hassium|111||648648000 - 1090|Meitnerium|000||648648000 - 1100|Darmstadtium|000||648648000 - 1110|Roentgenium|000||648648000 - 1120|Copernicium|111||648648000 - 1130|Nihonium|000||648648000 - 1140|Flerovium|111||648648000 - 1148|Flerovium298|111||648648000 - 1150|Moscovium|000||648648000 - 1160|Livermorium|000||648648000 - 1170|Farnsium|000||648648000 - 1180|Oganesson|000||648648000 - 1250|TritaniumElemental|101||648648000 - 1260|Trinium|101||648648000 - 1450|DuraniumElemental|111||648648000 - 1520|Vibranium|000||648648000 - 1740|Naquadah|101||648648000 - 1741|NaquadahEnriched|101||648648000 - 1742|Naquadria|101||648648000 - 2220|Adamantium|101||648648000 - 3720|Gravitonium|000||648648000 - 4000|Magic|000||648648000 - 8000|SiliconDioxide|000||648648000 - 8001|Glass|110||648648000 - 8002|Flint|000||648648000 - 8003|Carborundum|101||648648000 - 8006|Datolite|000||648648000 - 8007|HydrogenBorate|000||648648000 - 8008|Alumina|000||648648000 - 8009|Cryolite|000||648648000 - 8010|AluminiumFluoride|000||648648000 - 8011|HexafluorosilicicAcid|000||648648000 - 8012|SodiumAluminate|000||648648000 - 8013|SodiumCarbonate|000||648648000 - 8014|AluminiumHydroxide|000||648648000 - 8015|PotassiumHydroxide|000||648648000 - 8016|MagnesiumCarbonate|000||648648000 - 8017|FerricChloride|000||648648000 - 8018|MagnesiumChloride|000||648648000 - 8019|SodiumNitrate|000||648648000 - 8020|PotassiumCarbonate|000||648648000 - 8021|PotassiumSulfite|000||648648000 - 8022|PotassiumPersulfate|000||648648000 - 8023|PotassiumAluminate|000||648648000 - 8024|HydrosulfuricAcid|000||648648000 - 8025|Ammonia|000||648648000 - 8026|TungstenTrioxide|000||648648000 - 8027|TungsticAcid|000||648648000 - 8028|CalciumChloride|000||648648000 - 8029|LithiumChloride|000||648648000 - 8030|FerrousChloride|000||648648000 - 8031|ManganeseChloride|000||648648000 - 8032|LithiumHydroxide|000||648648000 - 8033|LithiumChlorate|000||648648000 - 8034|LithiumPerchlorate|000||648648000 - 8035|FerricOxyhydroxide|000||648648000 - 8036|PotassiumFluoride|000||648648000 - 8037|SodiumFluoride|000||648648000 - 8038|PotassiumHeptafluorotantalate|000||648648000 - 8039|SodiumHydrogencarbonate|000||648648000 - 8100|Sand|000||648648000 - 8101|Soulsand|000||648648000 - 8102|SluiceSand|000||648648000 - 8103|PlatinumGroupSludge|000||648648000 - 8104|RedSand|000||648648000 - 8196|Teflon|110||648648000 - 8197|PVC|110||648648000 - 8200|Ashes|000||648648000 - 8201|DarkAshes|000||648648000 - 8203|Sylvite|000||648648000 - 8204|Salt|000||648648000 - 8205|PotassiumNitrate|000||648648000 - 8206|Niter|000||648648000 - 8207|Phosphate|000||648648000 - 8208|Phosphorus|000||648648000 - 8209|Apatite|000||648648000 - 8210|Blizz|000||648648000 - 8211|Blaze|000||648648000 - 8214|Obsidian|000||648648000 - 8215|Clay|000||648648000 - 8216|Paper|000||648648000 - 8217|Rubber|110||648648000 - 8218|Plastic|110||648648000 - 8219|Bone|000||648648000 - 8220|Gunpowder|000||648648000 - 8221|Wood|000||648648000 - 8222|WoodTreated|000||648648000 - 8223|LiveRoot|000||648648000 - 8224|WoodRubber|000||648648000 - 8225|Ceramic|000||648648000 - 8226|Phosphorite|000||648648000 - 8229|CobaltHexahydrate|000||648648000 - 8230|SodiumBisulfate|000||648648000 - 8231|SodiumPyrosulfate|000||648648000 - 8232|PotassiumBisulfate|000||648648000 - 8233|PotassiumPyrosulfate|000||648648000 - 8234|VanadiumPentoxide|000||648648000 - 8235|Wax|110||648648000 - 8236|WaxBee|110||648648000 - 8238|WaxParaffin|110||648648000 - 8239|WaxPlant|110||648648000 - 8241|Leather|000||648648000 - 8242|IodineSalt|000||648648000 - 8247|Basalz|000||648648000 - 8248|Blitz|000||648648000 - 8249|Dynamite|000||648648000 - 8250|DyeBlack|000||648648000 - 8251|DyeRed|000||648648000 - 8252|DyeGreen|000||648648000 - 8253|DyeBrown|000||648648000 - 8254|DyeBlue|000||648648000 - 8255|DyePurple|000||648648000 - 8256|DyeCyan|000||648648000 - 8257|DyeLightGray|000||648648000 - 8258|DyeGray|000||648648000 - 8259|DyePink|000||648648000 - 8260|DyeLime|000||648648000 - 8261|DyeYellow|000||648648000 - 8262|DyeLightBlue|000||648648000 - 8263|DyeMagenta|000||648648000 - 8264|DyeOrange|000||648648000 - 8265|DyeWhite|000||648648000 - 8266|Asphalt|110||648648000 - 8267|WoodPolished|000||648648000 - 8268|SodiumHydroxide|000||648648000 - 8269|SodiumSulfite|000||648648000 - 8270|SodiumSulfate|000||648648000 - 8271|PotassiumSulfate|000||648648000 - 8272|PotassiumSulfide|000||648648000 - 8273|Porcelain|000||648648000 - 8274|CalciumSulfate|000||648648000 - 8275|Bark|000||648648000 - 8276|ClayBrown|000||648648000 - 8277|PetrifiedWood|000||648648000 - 8278|ManaDiamond|000||648648000 - 8289|Livingwood|000||648648000 - 8290|Dreamwood|000||648648000 - 8296|Greatwood|000||648648000 - 8297|Silverwood|000||648648000 - 8298|EnergiumRed|000||648648000 - 8299|EnergiumCyan|000||648648000 - 8300|Diamond|000||648648000 - 8301|Emerald|000||648648000 - 8302|Ruby|000||648648000 - 8303|BalasRuby|000||648648000 - 8304|Sapphire|000||648648000 - 8305|GreenSapphire|000||648648000 - 8306|Topaz|000||648648000 - 8307|BlueTopaz|000||648648000 - 8308|Tanzanite|000||648648000 - 8309|RedJasper|000||648648000 - 8310|Amber|000||648648000 - 8311|Peridot|000||648648000 - 8312|Opal|000||648648000 - 8313|Amethyst|000||648648000 - 8314|OrangeSapphire|000||648648000 - 8315|YellowSapphire|000||648648000 - 8318|EnderPearl|000||648648000 - 8319|EnderEye|000||648648000 - 8320|NetherStar|000||648648000 - 8321|Jade|000||648648000 - 8322|Craponite|000||648648000 - 8323|Aquamarine|000||648648000 - 8324|Morganite|000||648648000 - 8325|Dioptase|000||648648000 - 8326|Spinel|000||648648000 - 8328|BlueSapphire|000||648648000 - 8330|Lazurite|000||648648000 - 8331|Sodalite|000||648648000 - 8332|Lapis|000||648648000 - 8333|Redstone|000||648648000 - 8334|Coal|000||648648000 - 8335|HydratedCoal|000||648648000 - 8336|Charcoal|000||648648000 - 8337|Lignite|000||648648000 - 8338|Monazite|000||648648000 - 8340|Nikolite|000||648648000 - 8341|Glowstone|000||648648000 - 8342|Firestone|000||648648000 - 8346|NetherQuartz|000||648648000 - 8347|CertusQuartz|000||648648000 - 8348|ChargedCertusQuartz|000||648648000 - 8349|CoalCoke|000||648648000 - 8360|Peat|000||648648000 - 8365|LigniteCoke|000||648648000 - 8383|PurpleSapphire|000||648648000 - 8384|Heliodor|000||648648000 - 8385|Goshenite|000||648648000 - 8386|Bixbite|000||648648000 - 8387|Maxixe|000||648648000 - 8389|Fluix|000||648648000 - 8390|PetroleumCoke|000||648648000 - 8393|SunnyQuartz|000||648648000 - 8395|RedQuartz|000||648648000 - 8396|BlazeQuartz|000||648648000 - 8397|SmokeyQuartz|000||648648000 - 8399|ElvenQuartz|000||648648000 - 8400|ChloroauricAcid|000||648648000 - 8401|ChloroplatinicAcid|000||648648000 - 8402|StannicChloride|000||648648000 - 8403|BlackVitriol|000||648648000 - 8404|BlueVitriol|000||648648000 - 8405|GreenVitriol|000||648648000 - 8406|RedVitriol|000||648648000 - 8407|PinkVitriol|000||648648000 - 8408|CyanVitriol|000||648648000 - 8409|WhiteVitriol|000||648648000 - 8410|GrayVitriol|000||648648000 - 8412|VitriolOfClay|000||648648000 - 8413|TitaniumTetrachloride|000||648648000 - 8415|OnyxRed|000||648648000 - 8416|OnyxBlack|000||648648000 - 8417|Amazonite|000||648648000 - 8418|Bamboo|000||648648000 - 8419|Zircon|000||648648000 - 8420|Azurite|000||648648000 - 8421|Eudialyte|000||648648000 - 8423|DiamondIndustrial|000||648648000 - 8424|PinkDiamond|000||648648000 - 8425|OceanJasper|000||648648000 - 8426|RainforestJasper|000||648648000 - 8427|BlueJasper|000||648648000 - 8428|GreenJasper|000||648648000 - 8429|YellowJasper|000||648648000 - 8430|TigerEye|000||648648000 - 8431|CatsEye|000||648648000 - 8432|DragonEye|000||648648000 - 8433|HawksEye|000||648648000 - 8434|BlackEye|000||648648000 - 8435|TigerIron|000||648648000 - 8436|RedFluorite|000||648648000 - 8437|PinkFluorite|000||648648000 - 8438|BlueFluorite|000||648648000 - 8439|GreenFluorite|000||648648000 - 8440|BlackFluorite|000||648648000 - 8441|WhiteFluorite|000||648648000 - 8442|YellowFluorite|000||648648000 - 8443|OrangeFluorite|000||648648000 - 8444|MagentaFluorite|000||648648000 - 8445|MilkyQuartz|000||648648000 - 8446|BrownAventurine|000||648648000 - 8447|YellowAventurine|000||648648000 - 8448|GreenAventurine|000||648648000 - 8449|BlackAventurine|000||648648000 - 8450|BlueAventurine|000||648648000 - 8451|RedAventurine|000||648648000 - 8455|ClayRed|000||648648000 - 8458|BluePhosphorus|000||648648000 - 8459|RedPhosphorus|000||648648000 - 8460|WhitePhosphorus|000||648648000 - 8461|NiobiumPentoxide|000||648648000 - 8462|TantalumPentoxide|000||648648000 - 8464|BlueDiamond|000||648648000 - 8465|GreenDiamond|000||648648000 - 8467|RedDiamond|000||648648000 - 8468|YellowDiamond|000||648648000 - 8470|Carminite|000||648648000 - 8471|Breeze|000||648648000 - 8500|Stone|110||648648000 - 8501|Concrete|110||648648000 - 8502|Netherrack|110||648648000 - 8503|NetherBrick|110||648648000 - 8504|Endstone|110||648648000 - 8505|Basalt|110||648648000 - 8506|Marble|110||648648000 - 8507|GraniteRed|110||648648000 - 8508|GraniteBlack|110||648648000 - 8511|Diorite|110||648648000 - 8516|MarsSand|110||648648000 - 8518|Granite|110||648648000 - 8521|Livingrock|110||648648000 - 8528|SkyStone|110||648648000 - 8599|Bedrock|000||648648000 - 8600|Electrum|101||648648000 - 8601|SterlingSilver|101||648648000 - 8602|RoseGold|101||648648000 - 8605|CdInAgAlloy|101||648648000 - 8610|Bronze|111||648648000 - 8611|BlackBronze|101||648648000 - 8612|BismuthBronze|111||648648000 - 8614|ArsenicCopper|111||648648000 - 8615|ArsenicBronze|111||648648000 - 8620|Brass|111||648648000 - 8621|CobaltBrass|111||648648000 - 8622|AluminiumAlloy|101||648648000 - 8630|Steel|101||648648000 - 8631|BlackSteel|101||648648000 - 8632|BlueSteel|101||648648000 - 8633|RedSteel|101||648648000 - 8634|DamascusSteel|101||648648000 - 8635|Tungstensteel|101||648648000 - 8636|StainlessSteel|101||648648000 - 8638|TungstenCarbide|101||648648000 - 8640|AnnealedCopper|111||648648000 - 8643|WroughtIron|101||648648000 - 8645|IronMagnetic|101|Fe|648648000 - 8646|SteelMagnetic|101|Steel|648648000 - 8647|NeodymiumMagnetic|101|Nd|648648000 - 8651|SteelGalvanized|101|Steel|648648000 - 8652|TungstenSintered|101||648648000 - 8653|VanadiumSteel|101||648648000 - 8658|ElectrotineAlloy|111||648648000 - 8659|BlueAlloy|111||648648000 - 8660|RedAlloy|111||648648000 - 8661|Invar|101||648648000 - 8662|Constantan|101||648648000 - 8663|Nichrome|101||648648000 - 8664|Kanthal|101||648648000 - 8665|Magnalium|111||648648000 - 8666|Ultimet|101||648648000 - 8667|TinAlloy|111||648648000 - 8668|BatteryAlloy|111||648648000 - 8669|SolderingAlloy|111||648648000 - 8672|Ironwood|111||648648000 - 8673|Steeleaf|101||648648000 - 8674|Knightmetal|101||648648000 - 8675|FierySteel|101||648648000 - 8679|Thaumium|101||648648000 - 8682|Osmiridium|101||648648000 - 8684|Trinaquadalloy|101||648648000 - 8685|ChromiumDioxide|101||648648000 - 8686|VanadiumGallium|101||648648000 - 8687|YttriumBariumCuprate|101||648648000 - 8689|NiobiumTitanium|101||648648000 - 8697|FlamascusSteel|101||648648000 - 8698|Fireleaf|101||648648000 - 8700|AluminiumBrass|111||648648000 - 8702|Alumite|101||648648000 - 8704|VibraniumSteel|101||648648000 - 8705|VibraniumSilver|101||648648000 - 8706|Vibramantium|101||648648000 - 8708|Signalum|111||648648000 - 8709|Lumium|111||648648000 - 8710|Enderium|101||648648000 - 8717|Cyanite|101||648648000 - 8720|Manasteel|101||648648000 - 8721|Terrasteel|101||648648000 - 8722|ElvenElementium|101||648648000 - 8726|VibrantAlloy|101||648648000 - 8727|ConductiveIron|101||648648000 - 8729|EnderiumBase|101||648648000 - 8730|ElectricalSteel|101||648648000 - 8732|Soularium|101||648648000 - 8733|RedstoneAlloy|101||648648000 - 8735|GaiaSpirit|101||648648000 - 8737|NikolineAlloy|101||648648000 - 8744|AncientDebris|101||648648000 - 8745|Netherite|101||648648000 - 8746|NetherizedDiamond|101||648648000 - 8747|Efrine|101||648648000 - 8751|Duranium|101||648648000 - 8752|Tritanium|101||648648000 - 8756|Duralumin|101||648648000 - 8784|Adamantine|101||648648000 - 8790|Trinitanium|101||648648000 - 8793|TitaniumIridium|101||648648000 - 8796|HSSG|101||648648000 - 8797|HSSE|101||648648000 - 8798|HSSS|101||648648000 - 8799|CrystalMatrix|101||648648000 - 8800|CosmicNeutronium|101||648648000 - 8802|TantalumHafniumCarbide|101||648648000 - 8803|CastIron|101||648648000 - 9000|Pumice|110||648648000 - 9001|Diatomite|000||648648000 - 9003|BasalticMineralSand|000||648648000 - 9004|GraniticMineralSand|000||648648000 - 9005|GarnetSand|000||648648000 - 9006|QuartzSand|000||648648000 - 9007|UraniumTetrafluoride|000||648648000 - 9008|UraniumHexafluoride|000||648648000 - 9009|Uranium238Tetrafluoride|000||648648000 - 9010|Uranium238Hexafluoride|000||648648000 - 9011|Uranium235Tetrafluoride|000||648648000 - 9012|Uranium235Hexafluoride|000||648648000 - 9100|RareEarth|000||648648000 - 9101|Almandine|000||648648000 - 9102|Andradite|000||648648000 - 9103|Asbestos|110||648648000 - 9104|Hematite|000||648648000 - 9105|Bauxite|000||648648000 - 9106|BrownLimonite|000||648648000 - 9107|Calcite|000||648648000 - 9108|Cassiterite|000||648648000 - 9109|Realgar|000||648648000 - 9110|Celestine|000||648648000 - 9111|Chalcopyrite|000||648648000 - 9113|Chromite|000||648648000 - 9114|Cinnabar|000||648648000 - 9115|Cobaltite|000||648648000 - 9116|Cooperite|000||648648000 - 9117|Galena|000||648648000 - 9118|Garnierite|000||648648000 - 9119|Grossular|000||648648000 - 9120|Ilmenite|000||648648000 - 9122|Magnetite|000||648648000 - 9123|Molybdenite|000||648648000 - 9124|Powellite|000||648648000 - 9125|Pyrite|000||648648000 - 9126|Pyrolusite|000||648648000 - 9127|Pyrope|000||648648000 - 9128|Scheelite|000||648648000 - 9129|Spessartine|000||648648000 - 9130|Sphalerite|000||648648000 - 9131|Stibnite|000||648648000 - 9132|Tetrahedrite|000||648648000 - 9133|Tungstate|000||648648000 - 9134|Uraninite|000||648648000 - 9135|Uvarovite|000||648648000 - 9136|Wulfenite|000||648648000 - 9137|YellowLimonite|000||648648000 - 9138|Perlite|000||648648000 - 9139|Borax|000||648648000 - 9140|PotassiumFeldspar|000||648648000 - 9141|Biotite|000||648648000 - 9143|VanadiumMagnetite|000||648648000 - 9144|Bastnasite|000||648648000 - 9145|Pentlandite|000||648648000 - 9146|Spodumene|000||648648000 - 9147|Pollucite|000||648648000 - 9148|Tantalite|000||648648000 - 9149|Lepidolite|000||648648000 - 9150|Glauconite|000||648648000 - 9152|Vermiculite|000||648648000 - 9153|Bentonite|000||648648000 - 9154|Palygorskite|000||648648000 - 9155|Pitchblende|000||648648000 - 9156|Malachite|000||648648000 - 9157|Mirabilite|000||648648000 - 9158|Mica|000||648648000 - 9159|Trona|000||648648000 - 9160|Barite|000||648648000 - 9161|Gypsum|000||648648000 - 9162|Alunite|000||648648000 - 9164|Wollastonite|000||648648000 - 9165|Zeolite|000||648648000 - 9166|Kyanite|000||648648000 - 9167|Kaolinite|000||648648000 - 9169|Talc|000||648648000 - 9171|Greenschist|110||648648000 - 9174|Graphite|000||648648000 - 9175|Graphene|000||648648000 - 9177|Komatiite|110||648648000 - 9180|Quartzite|110||648648000 - 9184|Blueschist|110||648648000 - 9185|Bluestone|110||648648000 - 9186|Chert|110||648648000 - 9187|Dacite|110||648648000 - 9188|Andesite|110||648648000 - 9189|Limestone|110||648648000 - 9190|Shale|110||648648000 - 9192|Rutile|000||648648000 - 9193|Stolzite|000||648648000 - 9194|Ferberite|000||648648000 - 9195|Huebnerite|000||648648000 - 9196|Russellite|000||648648000 - 9197|Pinalite|000||648648000 - 9198|DiduraniumTrioxide|000||648648000 - 9199|DuraniumHexafluoride|000||648648000 - 9200|DuraniumHexachloride|000||648648000 - 9201|DuraniumHexabromide|000||648648000 - 9202|DuraniumHexaiodide|000||648648000 - 9203|DuraniumHexaastatide|000||648648000 - 9204|TritaniumDioxide|000||648648000 - 9205|TritaniumHexafluoride|000||648648000 - 9206|TritaniumHexachloride|000||648648000 - 9207|TritaniumHexabromide|000||648648000 - 9208|TritaniumHexaiodide|000||648648000 - 9209|TritaniumHexaastatide|000||648648000 - 9210|Bromargyrite|000||648648000 - 9211|Smithsonite|000||648648000 - 9212|Sperrylite|000||648648000 - 9213|Kesterite|000||648648000 - 9214|Stannite|000||648648000 - 9215|Fluorite|000||648648000 - 9216|Arsenopyrite|000||648648000 - 9217|Wolframite|000||648648000 - 9218|Kimberlite|110||648648000 - 9219|Prismarine|110||648648000 - 9220|PrismarineDark|110||648648000 - 9221|Bischofite|000||648648000 - 9222|Slate|110||648648000 - 9223|Blackstone|110||648648000 - 9243|ClayBrick|000||648648000 - 9246|Columbite|000||648648000 - 9247|Coltan|000||648648000 - 9248|Deepslate|110||648648000 - 9261|TitanRock|110||648648000 - 9271|Quicklime|000||648648000 - 9300|Oak|000||648648000 - 9301|Birch|000||648648000 - 9302|Spruce|000||648648000 - 9303|Junglewood|000||648648000 - 9304|Acacia|000||648648000 - 9305|DarkOak|000||648648000 - 9306|Crimsonwood|000||648648000 - 9307|Warpedwood|000||648648000 - 9308|WoodCompressed|000||648648000 - 9309|WoodDead|000||648648000 - 9310|WoodRotten|000||648648000 - 9311|WoodMossy|000||648648000 - 9312|WoodFrozen|000||648648000 - 9313|Maple|000||648648000 - 9314|Willow|000||648648000 - 9315|BlueMahoe|000||648648000 - 9316|Hazel|000||648648000 - 9317|Cinnamonwood|000||648648000 - 9318|Coconutwood|000||648648000 - 9319|Rainbowood|000||648648000 - 9344|Cherrywood|000||648648000 - 9372|Mangrove|000||648648000 - 9409|BlueSpruce|000||648648000 - 9700|MeatRaw|110|MeatCooked|648648000 - 9701|MeatCooked|110||648648000 - 9702|Wheat|000||648648000 - 9703|Sugar|000||648648000 - 9705|Rye|000||648648000 - 9709|Potato|000||648648000 - 9710|MeatRotten|110||648648000 - 9711|FishCooked|110||648648000 - 9712|FishRaw|110|FishCooked|648648000 - 9713|FishRotten|110||648648000 - 9779|SoylentGreen|110||648648000 - 9780|Cheese|110||648648000 - 9781|Chili|000||648648000 - 9782|Cocoa|000||648648000 - 9783|Chocolate|110||648648000 - 9784|Coffee|000||648648000 - 9785|Cinnamon|000||648648000 - 9790|Milk|000||648648000 - 9791|Honey|000||648648000 - 9792|Tea|000||648648000 - 9793|Honeydew|000||648648000 - 9794|Mint|000||648648000 - 9796|Hazelnut|000||648648000 - 9800|Water|000||648648000 - 9801|Snow|000||648648000 - 9802|Ice|000||648648000 - 9803|FreshWater|000||648648000 - 9804|Saltwater|000||648648000 - 9805|HolyWater|000||648648000 - 9806|SeaWater|000||648648000 - 9808|WaterDistilled|000||648648000 - 9809|HydrogenPeroxide|000||648648000 - 9810|Lava|000||648648000 - 9811|SemiheavyWater|000||648648000 - 9812|HeavyWater|000||648648000 - 9813|TritiatedWater|000||648648000 - 9814|Steam|000||648648000 - 9815|SaltedWater|000||648648000 - 9820|NitroCarbon|000||648648000 - 9821|Glyceryl|000||648648000 - 9822|SodiumPersulfate|000||648648000 - 9823|SodiumSulfide|000||648648000 - 9824|SulfuricAcid|000||648648000 - 9825|NitricAcid|000||648648000 - 9826|HydrochloricAcid|000||648648000 - 9827|AquaRegia|000||648648000 - 9828|Glycerol|000||648648000 - 9829|HydrogenFluoride|000||648648000 - 9830|Air|000||648648000 - 9831|NitrogenDioxide|000||648648000 - 9832|Methane|000||648648000 - 9833|MethaneIce|000||648648000 - 9834|SulfurDioxide|000||648648000 - 9835|SulfurTrioxide|000||648648000 - 9836|CarbonDioxide|000||648648000 - 9837|NitrogenMonoxide|000||648648000 - 9838|CarbonMonoxide|000||648648000 - 9839|HeliumNeon|000||648648000 - 9840|Biomass|000||648648000 - 9841|BioFuel|000||648648000 - 9842|Ethanol|000||648648000 - 9843|CarbonTrioxide|000||648648000 - 9844|DisulfuricAcid|000||648648000 - 9850|Oil|000||648648000 - 9851|OilSand|000||648648000 - 9852|CrudeOil|000||648648000 - 9853|OilShale|000||648648000 - 9860|Fuel|000||648648000 - 9861|NitroFuel|000||648648000 - 9862|Kerosine|000||648648000 - 9863|Diesel|000||648648000 - 9864|Petrol|000||648648000 - 9865|Propane|000||648648000 - 9866|Butane|000||648648000 - 9867|Propylene|000||648648000 - 9868|Ethylene|000||648648000 - 9870|Creosote|000||648648000 - 9871|FishOil|000||648648000 - 9872|SeedOil|000||648648000 - 9873|HempOil|000||648648000 - 9874|LinOil|000||648648000 - 9875|SunflowerOil|000||648648000 - 9876|NutOil|000||648648000 - 9877|OliveOil|000||648648000 - 9880|FryingOilHot|000||648648000 - 9881|Glue|000||648648000 - 9882|Lubricant|000||648648000 - 9883|ConstructionFoam|000||648648000 - 9886|Latex|000||648648000 - """; - - static { - for (String line : DATA.strip().split("\n")) { - String[] f = line.strip().split("\\|", -1); - ROWS.put( - Integer.parseInt(f[0]), - new Row( - f[1], - new Profile( - f[2].charAt(0) == '1', - f[2].charAt(1) == '1', - f[2].charAt(2) == '1', - f[3], - Long.parseLong(f[4])))); - } - } - - public static Profile profile(GTMaterial material) { + public static SourceExtrusionMaterialFacts.Profile profile(GTMaterial material) { if (material == null || !material.isValid() || material.resolve() != material || AddonMaterials.owns(material)) return null; - Row row = ROWS.get(material.getId()); - return row != null - && sameName(row.name(), material.getName()) - && GTMaterialRegistry.get(material.getId()) == material - && GTMaterialRegistry.get(material.getName()) == material - ? row.profile() - : null; - } - /** The source list spells e.g. {@code SpaceStone} where the port spells {@code Space Stone}. */ - private static boolean sameName(String source, String port) { - if (source.equals(port)) return true; - return source.replaceAll("[^A-Za-z0-9]", "").equalsIgnoreCase(port.replaceAll("[^A-Za-z0-9]", "")); + if (GTMaterialRegistry.get(material.getId()) != material + || GTMaterialRegistry.get(material.getName()) != material) return null; + return MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_EXTRUSION) + .orElse(null); } - /** Source SMITHABLE where the profile exists; unknown/addon materials keep the port property. */ + public static boolean smithable(GTMaterial material) { - Profile profile = profile(material); - return profile != null ? profile.smithable() : material.has(gregtech.api.material.MaterialProperty.SMITHABLE); + var profile = profile(material); + return profile != null ? profile.smithable() : material.has(MaterialProperty.SMITHABLE); } - public static GTMaterial target(GTMaterial material, Profile profile) { + public static GTMaterial target(GTMaterial material, SourceExtrusionMaterialFacts.Profile profile) { if (profile.target().isEmpty()) return material; String name = GTMaterialFields.materialOf(profile.target()); GTMaterial result = name == null ? null : GTMaterialRegistry.get(name); return result == null ? null : result.resolve(); } - /** Original ceil input / floor output ratio, and the two 64-stack output limit. */ + public static long[] amounts(long inputWeight, long outputWeight) { if (inputWeight <= 0 || outputWeight <= 0) return null; long input = outputWeight > inputWeight ? (outputWeight + inputWeight - 1) / inputWeight : 1; diff --git a/core/src/main/java/gregtech/content/recipe/SourceLensRoles.java b/core/src/main/java/gregtech/content/recipe/SourceLensRoles.java new file mode 100644 index 000000000..bed4f39a1 --- /dev/null +++ b/core/src/main/java/gregtech/content/recipe/SourceLensRoles.java @@ -0,0 +1,28 @@ +package gregtech.content.recipe; + +import gregtech.api.material.GTMaterial; +import gregtech.content.material.MaterialFactKeys; +import gregtech.content.material.catalog.SourceLensMaterialFacts; +import gregtech.engine.addon.AddonMaterials; +import java.util.ArrayList; +import java.util.List; + +/** Recipe-facing lookup over the material-owned lens role facts. */ +public final class SourceLensRoles { + private SourceLensRoles() {} + + public static SourceLensMaterialFacts.Color color(GTMaterial material) { + if (material == null || !material.isValid() || AddonMaterials.owns(material)) return null; + return MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_LENS_ROLE) + .orElse(null); + } + + public static List materials(SourceLensMaterialFacts.Color color) { + var result = new ArrayList(); + for (var material : gregtech.engine.material.GTMaterialRegistry.allMaterials()) { + var resolved = material.resolve(); + if (color(resolved) == color) result.add(resolved); + } + return List.copyOf(result); + } +} diff --git a/core/src/main/java/gregtech/content/recipe/SourceOilSandRules.java b/core/src/main/java/gregtech/content/recipe/SourceOilSandRules.java index 4488914fc..faee6b320 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceOilSandRules.java +++ b/core/src/main/java/gregtech/content/recipe/SourceOilSandRules.java @@ -1,14 +1,12 @@ package gregtech.content.recipe; import static gregtech.api.material.GTValues.U; -import static gregtech.content.recipe.SourceOreCrushingRules.Form; -import static gregtech.content.recipe.SourceOreCrushingRules.Resolver; -import static gregtech.content.recipe.SourceOreCrushingRules.Slot; -import static gregtech.content.recipe.SourceOreCrushingRules.Stack; +import static gregtech.content.material.MaterialFactKeys.Decision; +import static gregtech.content.material.MaterialFactKeys.Identity; +import static gregtech.content.recipe.SourceOreCrushingRules.*; import static gregtech.content.recipe.SourceOreWashingRules.Availability; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; -import static gregtech.content.recipe.SourceRecyclingFacts.Identity; +import gregtech.content.block.stone.OreHostFacts; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -90,7 +88,7 @@ public static HostProfile hostProfile(String nativeHostId) { }; // OP 115/117/118: 2U, DUST_ORE, and no byproduct assignment in the source init closure. if (sediment != null) return new HostProfile(sediment, WEIGHT_STANDARD, List.of()); - var host = SourceOreCrushingFacts.hostProfile(nativeHostId); + var host = OreHostFacts.hostProfile(nativeHostId); return host == null ? null : new HostProfile( @@ -108,7 +106,7 @@ public static Decision hostDecision(String nativeHostId) { /** False means unproved mode, not source NO. Sediment, Deepslate and Gneiss broken modes are * not inferred merely from their ordinary prefix definitions. */ public static boolean hasBrokenSourcePair(String nativeHostId) { - return SourceOreCrushingFacts.hasBrokenSourcePair(nativeHostId); + return OreHostFacts.hasBrokenSourcePair(nativeHostId); } public static Result plan(Request request, Resolver resolver) { diff --git a/core/src/main/java/gregtech/content/recipe/SourceOreCrushingFacts.java b/core/src/main/java/gregtech/content/recipe/SourceOreCrushingFacts.java deleted file mode 100644 index 27b058660..000000000 --- a/core/src/main/java/gregtech/content/recipe/SourceOreCrushingFacts.java +++ /dev/null @@ -1,177 +0,0 @@ -package gregtech.content.recipe; - -import static gregtech.api.material.GTValues.U; -import static gregtech.content.recipe.SourceOreCrushingRules.Hexorium; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; -import static gregtech.content.recipe.SourceRecyclingFacts.Identity; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Finite source facts for native ore Crusher/Hammer planning, not global material metadata. - * Pinned GT6 3703e40308c8c030763fd6297dea8b210d2a77b1: Crushing 50-140, MT 470/1540/3709, - * OP 653-714. Existing recycling facts supply only the 1,002 exact input identities, never their - * thermal flags/targets/default fingerprints. The five special Hexorium identities are separately - * proven by MT 203/1596-1611. Caller must independently prove native material, item and host/mode. - * - *

PULVERIZING_CINNABAR has exactly three explicit positive declarations in this scope and no - * factory implication. MT and the bounded main/API/ANY/item/ore/rock/wood initialization closure - * contain no further assignment or ALL_ORES tag-list application. Group re-registration and - * setAllToTheOutputOf do not copy processing tags. Unknown/addon overrides are not a source NO. - */ -public final class SourceOreCrushingFacts { - private SourceOreCrushingFacts() {} - - private static boolean reviewedInput(int id, String name) { - var fact = SourceRecyclingFacts.find(id, name); - return fact != null && fact.portDefaults() != null; // roster membership ONLY - } - - public static Decision pulverizingCinnabar(int id, String canonicalName) { - if (specialHexorium(id, canonicalName) != null) return Decision.NO; - if (!reviewedInput(id, canonicalName)) return Decision.UNKNOWN; - return id == 800 || id == 8333 || id == 9114 ? Decision.YES : Decision.NO; - } - /** Null is unreviewed identity, not the NONE classification of a proven ordinary material. */ - public static Hexorium hexorium(int id, String canonicalName) { - Hexorium special = specialHexorium(id, canonicalName); - return special != null ? special : reviewedInput(id, canonicalName) ? Hexorium.NONE : null; - } - - private static Hexorium specialHexorium(int id, String name) { - return switch (id) { - case 9224 -> "HexoriumBlack".equals(name) ? Hexorium.BLACK_WHITE : null; - case 9239 -> "HexoriumWhite".equals(name) ? Hexorium.BLACK_WHITE : null; - case 9225 -> "HexoriumRed".equals(name) ? Hexorium.RED_GREEN_BLUE : null; - case 9226 -> "HexoriumGreen".equals(name) ? Hexorium.RED_GREEN_BLUE : null; - case 9228 -> "HexoriumBlue".equals(name) ? Hexorium.RED_GREEN_BLUE : null; - default -> null; - }; - } - - /** Source prefix association only. A normal/broken native representation needs separate proof; - * this table is not an item matcher or a promise that a native holder currently exists. */ - public record HostProfile( - String sourcePrefix, Identity gangueMaterial, long gangueAmount, boolean hexoriumAdjusted) { - public HostProfile { - Objects.requireNonNull(sourcePrefix); - if (gangueAmount < 0) throw new IllegalArgumentException("Negative gangue amount"); - // Sandstone has an empty source byproduct list; only a positive amount needs an identity. - if (gangueAmount > 0) Objects.requireNonNull(gangueMaterial); - } - - public boolean hasGangue() { - return gangueAmount > 0; - } - } - - private static final Map HOSTS = createHosts(); - // Same OP prefix for normal/broken: Loader_Ores 56/58/59, Loader_Rocks 57-138. - private static final Set BROKEN_SOURCE_PAIRS = Set.of( - "oreVanillastone", - "oreNetherrack", - "oreEndstone", - "oreBlackgranite", - "oreRedgranite", - "oreBasalt", - "oreMarble", - "oreLimestone", - "oreVanillagranite", - "oreDiorite", - "oreAndesite", - "oreKomatiite", - "oreGreenschist", - "oreBlueschist", - "oreKimberlite", - "oreQuartzite", - "oreLightprismarine", - "oreDarkprismarine", - "oreSlate", - "oreShale"); - - public static HostProfile hostProfile(String nativeHostId) { - return nativeHostId == null ? null : HOSTS.get(nativeHostId); - } - - public static Decision hostDecision(String nativeHostId) { - if (hostProfile(nativeHostId) != null) return Decision.YES; - // GT6's crusher handler excludes every DUST_ORE prefix, so their hosts never get a - // crushing row of their own (the sifter and OilSand events handle them instead). - if ("bedrock".equals(nativeHostId) - || "sand".equals(nativeHostId) - || "red_sand".equals(nativeHostId) - || "gravel".equals(nativeHostId) - || "mud".equals(nativeHostId)) return Decision.NO; - return Decision.UNKNOWN; - } - /** False is lack of paired source evidence, not a new material/host prohibition. - * In particular, Deepslate and Gneiss have ordinary OP profiles but no reviewed broken pair. */ - public static boolean hasBrokenSourcePair(String nativeHostId) { - HostProfile profile = hostProfile(nativeHostId); - return profile != null && BROKEN_SOURCE_PAIRS.contains(profile.sourcePrefix()); - } - - private static Map createHosts() { - var result = new LinkedHashMap(); - host(result, "oreVanillastone", 8500, "Stone", false, "stone"); // OP659, MT1631 - host(result, "oreVanillagranite", 8518, "Granite", false, "granite", "stone_granite"); // OP658, MT3831 - host(result, "oreDiorite", 8511, "Diorite", false, "diorite", "stone_diorite"); // OP654, MT3833 - host(result, "oreAndesite", 9188, "Andesite", false, "andesite", "stone_andesite"); // OP653, MT3832 - host(result, "oreDeepslate", 9248, "Deepslate", true, "deepslate"); // OP660, MT3842 - host(result, "oreNetherrack", 8502, "Netherrack", true, "netherrack"); // OP707, MT1633 - host(result, "oreEndstone", 8504, "Endstone", false, "end_stone"); // OP709, MT1635 - host(result, "oreBlackgranite", 8508, "GraniteBlack", false, "stone_granite_black"); // OP657, MT3830 - host(result, "oreRedgranite", 8507, "GraniteRed", false, "stone_granite_red"); // OP656, MT3829 - host(result, "oreKomatiite", 9177, "Komatiite", true, "stone_komatiite"); // OP691, MT3816 - host(result, "oreBasalt", 8505, "Basalt", true, "stone_basalt"); // OP692, MT3819 - host(result, "oreMarble", 8506, "Marble", false, "stone_marble"); // OP693, MT3820 - host(result, "oreLimestone", 9189, "Limestone", false, "stone_limestone"); // OP694, MT3821 - host(result, "oreShale", 9190, "Shale", false, "stone_shale"); // OP696, MT3814 - host(result, "oreSlate", 9222, "Slate", false, "stone_slate"); // OP697, MT3841 - host(result, "oreGreenschist", 9171, "Greenschist", false, "stone_greenschist"); // OP698, MT3822 - host(result, "oreBlueschist", 9184, "Blueschist", false, "stone_blueschist"); // OP699, MT3823 - host(result, "oreLightprismarine", 9219, "Prismarine", false, "stone_prismarine_light"); // OP703, MT1639 - host(result, "oreDarkprismarine", 9220, "PrismarineDark", false, "stone_prismarine_dark"); // OP704, MT1640 - host(result, "oreKimberlite", 9218, "Kimberlite", false, "stone_kimberlite"); // OP705, MT3827 - host(result, "oreQuartzite", 9180, "Quartzite", false, "stone_quartzite"); // OP706, MT3828 - // OP.oreSandstone declares no byproducts, so this host contributes no gangue slot. - if (result.put("sandstone", new HostProfile("oreSandstone", null, 0, false)) != null) - throw new IllegalStateException("Duplicate source host sandstone"); - // Port-only hosts: these StoneTypes are GT6 worldgen *stone layers*, not ore-host blocks - // (GT6's WD.setOre does not place ores in them), so the reference dump has no rows for them. - // The port's block-state model does place ores in every StoneType, so each gets the same - // 4U self-gangue profile as the reviewed hosts; the prefix names are port-local, not GT6. - portHost(result, "gypsum", 9161, "Gypsum"); - portHost(result, "salt", 8204, "Salt"); - return Map.copyOf(result); - } - - private static void host( - Map result, - String prefix, - int materialId, - String canonicalName, - boolean adjusted, - String... nativeHostIds) { - var profile = new HostProfile(prefix, new Identity(materialId, canonicalName), 4 * U, adjusted); - for (String host : nativeHostIds) { - if (result.put(host, profile) != null) throw new IllegalStateException("Duplicate source host " + host); - } - } - - /** One port-only stone-layer host, keyed by its {@code StoneType.registryId()}. */ - private static void portHost(Map result, String stone, int materialId, String name) { - String host = "stone_" + stone; - if (result.put( - host, - new HostProfile( - "portOre" + Character.toUpperCase(stone.charAt(0)) + stone.substring(1), - new Identity(materialId, name), - 4 * U, - false)) - != null) throw new IllegalStateException("Duplicate source host " + host); - } -} diff --git a/core/src/main/java/gregtech/content/recipe/SourceOreCrushingRules.java b/core/src/main/java/gregtech/content/recipe/SourceOreCrushingRules.java index f96507bb8..7142bfde1 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceOreCrushingRules.java +++ b/core/src/main/java/gregtech/content/recipe/SourceOreCrushingRules.java @@ -1,10 +1,11 @@ package gregtech.content.recipe; import static gregtech.api.material.GTValues.U; +import static gregtech.content.material.MaterialFactKeys.Decision; +import static gregtech.content.material.MaterialFactKeys.Identity; import static gregtech.content.recipe.SourceOreWashingRules.Availability; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; -import static gregtech.content.recipe.SourceRecyclingFacts.Identity; +import gregtech.content.material.MaterialFactKeys.HexoriumKind; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -43,12 +44,6 @@ public enum Form { BLOCK_DUST } - public enum Hexorium { - NONE, - BLACK_WHITE, - RED_GREEN_BLUE - } - public enum Status { ROW, NO_ROW, @@ -77,7 +72,7 @@ public record Input( int processingMultiplier, int quality, Bonus bonus, - Hexorium hexorium) {} + HexoriumKind hexorium) {} /** Quality belongs to material, not crushingTarget. amount is the prefix's gangue amount. */ public record Gangue( Identity material, long amount, int quality, Identity crushingTarget, long crushingUnitsPerU) {} @@ -171,8 +166,9 @@ private static Result checkedPlan(Request r, Resolver resolver) { boolean crusher = r.machine() == Machine.CRUSHER; long oreMultiplier = in.oreMultiplier(); if (crusher && r.hexoriumAdjustedHost()) - oreMultiplier += - in.hexorium() == Hexorium.BLACK_WHITE ? 1 : in.hexorium() == Hexorium.RED_GREEN_BLUE ? -1 : 0; + oreMultiplier += in.hexorium() == HexoriumKind.BLACK_WHITE + ? 1 + : in.hexorium() == HexoriumKind.RED_GREEN_BLUE ? -1 : 0; if (oreMultiplier < 0) return result(Status.UNSUPPORTED, "negative adjusted multiplier"); long multiplier = Math.multiplyExact(oreMultiplier, in.processingMultiplier()); multiplier = Math.multiplyExact( diff --git a/core/src/main/java/gregtech/content/recipe/SourceOreShreddingRules.java b/core/src/main/java/gregtech/content/recipe/SourceOreShreddingRules.java index d6a78ad92..969cdefae 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceOreShreddingRules.java +++ b/core/src/main/java/gregtech/content/recipe/SourceOreShreddingRules.java @@ -1,7 +1,7 @@ package gregtech.content.recipe; +import static gregtech.content.material.MaterialFactKeys.Decision; import static gregtech.content.recipe.SourceOreWashingRules.Availability; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; import gregtech.api.material.GTValues; import gregtech.content.data.MaterialPrefix; diff --git a/core/src/main/java/gregtech/content/recipe/SourceOreWashingRules.java b/core/src/main/java/gregtech/content/recipe/SourceOreWashingRules.java index 19248d6dc..9cf788a32 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceOreWashingRules.java +++ b/core/src/main/java/gregtech/content/recipe/SourceOreWashingRules.java @@ -1,6 +1,7 @@ package gregtech.content.recipe; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -177,7 +178,7 @@ public record Selection(Availability availability, M material) {} * an unknown earlier candidate defers instead of silently changing first-match semantics. */ public static Selection selectByproduct( - M self, List ordered, Function tag, Function tiny) { + M self, List ordered, Function tag, Function tiny) { Objects.requireNonNull(self); Objects.requireNonNull(ordered); Objects.requireNonNull(tag); @@ -185,12 +186,12 @@ public static Selection selectByproduct( var candidates = new ArrayList(ordered); candidates.add(self); for (M candidate : candidates) { - SourceOreWashingData.Decision decision = tag.apply(candidate); - if (decision == SourceOreWashingData.Decision.NO) continue; + MaterialFactKeys.Decision decision = tag.apply(candidate); + if (decision == MaterialFactKeys.Decision.NO) continue; Availability available = tiny.apply(candidate); if (available == Availability.ABSENT) continue; if (decision == null - || decision == SourceOreWashingData.Decision.UNKNOWN + || decision == MaterialFactKeys.Decision.UNKNOWN || available == null || available == Availability.UNKNOWN) return new Selection<>(Availability.UNKNOWN, null); return new Selection<>(Availability.PRESENT, candidate); diff --git a/core/src/main/java/gregtech/content/recipe/SourcePurifiedAcidRules.java b/core/src/main/java/gregtech/content/recipe/SourcePurifiedAcidRules.java deleted file mode 100644 index 8c87f58b8..000000000 --- a/core/src/main/java/gregtech/content/recipe/SourcePurifiedAcidRules.java +++ /dev/null @@ -1,217 +0,0 @@ -package gregtech.content.recipe; - -import static gregtech.content.recipe.SourceOreWashingRules.Availability; -import static gregtech.content.recipe.SourcePurifiedAcidData.*; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; -import static gregtech.content.recipe.SourceRecyclingFacts.Identity; - -import gregtech.content.data.MaterialPrefix; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Purified-acid Bath algorithms from GT6 3703e40308c8c030763fd6297dea8b210d2a77b1, - * Loader_Recipes_Ores 108-159. Native identity/phase proof and registration are separate. - * No ordinary washing eligibility, target conversion or purified/refined dust fallback applies. - * Missing outputs retain source positions (Recipe 895); unknown context is not source absence. - */ -public final class SourcePurifiedAcidRules { - private SourcePurifiedAcidRules() {} - - public enum Shape { - WHOLE(MaterialPrefix.crushedPurified, 1), - TINY(MaterialPrefix.crushedPurifiedTiny, 9); - private final MaterialPrefix prefix; - private final int count; - - Shape(MaterialPrefix prefix, int count) { - this.prefix = prefix; - this.count = count; - } - - public MaterialPrefix prefix() { - return prefix; - } - - public int count() { - return count; - } - } - - public enum Status { - ROW, - NO_ROW, - UNSUPPORTED - } - - public record Item(MaterialPrefix prefix, Identity material, int count) {} - /** Null item preserves a known absent source output at its original chance position. */ - public record Slot(Item item, long chance) {} - - public record Candidate(Family family, Identity material, Shape shape) {} - - public record Result( - Status status, - Item input, - List outputs, - List fluidInputs, - List fluidOutputs, - String reason) { - public Result { - outputs = List.copyOf(outputs); - fluidInputs = List.copyOf(fluidInputs); - fluidOutputs = List.copyOf(fluidOutputs); - } - - public int ticks() { - return 256; - } - - public int power() { - return 0; - } - - public boolean optimize() { - return true; - } - } - - public interface Resolver { - /** Exact direct form and quantity, without purified/refined fallback or target conversion. */ - Availability item(MaterialPrefix prefix, Identity material, int count); - /** Source absence differs from unavailable native binding: these 18 source phases exist, - * so an unproved/replaced/missing native holder must be UNKNOWN, not silently discarded. */ - Availability fluid(Phase phase, long millibuckets); - } - /** Exact source order: family, literal member order, whole then tiny. Dynamic array follows. */ - public static List fixedCandidates() { - var result = new ArrayList(); - for (var family : families()) - for (var member : family.members()) - for (var shape : Shape.values()) result.add(new Candidate(family, member, shape)); - return List.copyOf(result); - } - - public static Decision fixedMembership(Family family, Identity material) { - if (family == null || !families().contains(family) || !reviewedIdentity(material)) return Decision.UNKNOWN; - return family.members().contains(material) ? Decision.YES : Decision.NO; - } - /** Direct list only: no identity/self shortcut, chemical decomposition or nested byproducts. - * Null/unresolved list entries cannot prove absence. Native provenance is still external. */ - public static Decision directManganeseMembership(List directByproducts) { - if (directByproducts == null) return Decision.UNKNOWN; - if (directByproducts.contains(MNO2)) return Decision.YES; - return directByproducts.stream().anyMatch(Objects::isNull) ? Decision.UNKNOWN : Decision.NO; - } - /** Only the dynamic loop uses this gate. A positive-default list is not permission evidence; - * a proven live core input newly acquiring direct MnO2 membership remains eligible. */ - public static Decision manganeseSelector(boolean validMaterial, boolean antimatter, Decision directContainsMno2) { - if (!validMaterial || antimatter) return Decision.NO; - return directContainsMno2 == null ? Decision.UNKNOWN : directContainsMno2; - } - - public static Result fixedPlan(Family family, Identity material, Shape shape, Resolver resolver) { - Decision member = fixedMembership(family, material); - if (member != Decision.YES) - return empty(member == Decision.NO ? Status.NO_ROW : Status.UNSUPPORTED, "fixed source membership"); - if (shape == null || resolver == null) return empty(Status.UNSUPPORTED, "missing shape/resolver"); - Identity tail = switch (family.tail()) { - case SELF -> material; - case PLATINUM_GROUP_SLUDGE -> PGS; - case GRAPHITE -> GRAPHITE; - }; - int count = family.tail() == Tail.PLATINUM_GROUP_SLUDGE ? 8 : 2; - var slots = new ArrayList(); - slots.add(new Slot(new Item(MaterialPrefix.crushedCentrifuged, material, 1), 10000)); - for (int i = 0; i < 5; i++) - slots.add(new Slot(new Item(MaterialPrefix.crushedCentrifugedTiny, tail, count), 5000)); - return resolve( - new Item(shape.prefix(), material, shape.count()), - slots, - family.fluidInput(), - family.fluidOutputs(), - resolver, - false); - } - - public static Result manganesePlan(Identity material, Shape shape, Decision sourceSelector, Resolver resolver) { - if (sourceSelector != Decision.YES) - return empty(sourceSelector == Decision.NO ? Status.NO_ROW : Status.UNSUPPORTED, "dynamic source selector"); - if (material == null || shape == null || resolver == null) - return empty(Status.UNSUPPORTED, "missing dynamic context"); - // OM.dust(MnCl2, 3U/2) is resolved below, not substituted with a fixed generated dust row. - var slots = List.of( - new Slot(new Item(MaterialPrefix.crushedCentrifuged, material, 1), 10000), new Slot(null, 10000)); - return resolve( - new Item(shape.prefix(), material, shape.count()), - slots, - new Fluid(Phase.HYDROCHLORICACID, 4000), - List.of(new Fluid(Phase.WATER, 3000), new Fluid(Phase.CHLORINE, 1000)), - resolver, - true); - } - - private static Result resolve( - Item input, - List desired, - Fluid fluidInput, - List desiredFluids, - Resolver resolver, - boolean manganese) { - Availability itemInput = Objects.requireNonNull(resolver.item(input.prefix(), input.material(), input.count())); - if (itemInput != Availability.PRESENT) - return empty( - itemInput == Availability.ABSENT ? Status.NO_ROW : Status.UNSUPPORTED, - "selected input shape unavailable"); - Availability acid = Objects.requireNonNull(resolver.fluid(fluidInput.phase(), fluidInput.millibuckets())); - if (acid != Availability.PRESENT) - return empty(acid == Availability.ABSENT ? Status.NO_ROW : Status.UNSUPPORTED, "input acid unavailable"); - var slots = new ArrayList(); - for (var desiredSlot : desired) { - Item item = desiredSlot.item(); - if (item == null) { - slots.add(desiredSlot); - continue; - } - Availability found = Objects.requireNonNull(resolver.item(item.prefix(), item.material(), item.count())); - if (found == Availability.UNKNOWN) return empty(Status.UNSUPPORTED, "unknown direct output form"); - slots.add(new Slot(found == Availability.PRESENT ? item : null, desiredSlot.chance())); - } - if (manganese) { - Choice dust = manganeseDust(resolver); - if (dust.availability() == Availability.UNKNOWN) - return empty(Status.UNSUPPORTED, "unknown MnCl2 dust form"); - slots.set(1, new Slot(dust.item(), 10000)); - } - var fluidOutputs = new ArrayList(); - for (var fluid : desiredFluids) { - Availability found = Objects.requireNonNull(resolver.fluid(fluid.phase(), fluid.millibuckets())); - if (found == Availability.UNKNOWN) return empty(Status.UNSUPPORTED, "unknown output phase binding"); - if (found == Availability.PRESENT) fluidOutputs.add(fluid); // source removes all null fluids - } - if (slots.stream().noneMatch(s -> s.item() != null) && fluidOutputs.isEmpty()) - return empty(Status.NO_ROW, "Bath needs at least one output"); - return new Result(Status.ROW, input, slots, List.of(fluidInput), fluidOutputs, "source purified-acid row"); - } - - private record Choice(Availability availability, Item item) {} - - private static Choice manganeseDust(Resolver resolver) { - // OM 460-466: 1.5U is below 72U and not whole-divisible. Prefer small6, then floor - // to tiny13; the final 108 div72 stack is source bindStack-clamped to 64. - for (var item : List.of( - new Item(MaterialPrefix.dustSmall, MNCL2, 6), - new Item(MaterialPrefix.dustTiny, MNCL2, 13), - new Item(MaterialPrefix.dustDiv72, MNCL2, 64))) { - Availability found = Objects.requireNonNull(resolver.item(item.prefix(), item.material(), item.count())); - if (found == Availability.UNKNOWN) return new Choice(found, null); - if (found == Availability.PRESENT) return new Choice(found, item); - } - return new Choice(Availability.ABSENT, null); - } - - private static Result empty(Status status, String reason) { - return new Result(status, null, List.of(), List.of(), List.of(), reason); - } -} diff --git a/core/src/main/java/gregtech/content/recipe/SourceRollingWireRules.java b/core/src/main/java/gregtech/content/recipe/SourceRollingWireRules.java index 2c00a1f51..9e4c2ff5e 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceRollingWireRules.java +++ b/core/src/main/java/gregtech/content/recipe/SourceRollingWireRules.java @@ -4,6 +4,7 @@ import gregtech.api.material.GTValues; import gregtech.api.material.MaterialProperty; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.material.SourceLatheMaterialProfiles; import gregtech.engine.prefix.BlockMaterialPrefix; import java.math.BigInteger; @@ -125,12 +126,8 @@ public static Decision physicalWire( if (profile == null) return new Decision(legacyAllowed, legacyTicks, false); // Only these two actual native families have proven admission beyond the legacy policy. boolean provenAddition = sourceAdditionalFamily - && (material == gregtech.content.material.Materials.Netherite - && material.getId() == 8745 - && material.getName().equals("Netherite") - || material == gregtech.content.material.Materials.Naquadah - && material.getId() == 1740 - && material.getName().equals("Naquadah")); + && MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_ADDITIONAL_WIRE_FAMILY) + .orElse(false); return new Decision( (legacyAllowed || provenAddition) && profile.smithable() diff --git a/core/src/main/java/gregtech/content/recipe/SourceThermalInputRules.java b/core/src/main/java/gregtech/content/recipe/SourceThermalInputRules.java index 71d161e1a..625bea23e 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceThermalInputRules.java +++ b/core/src/main/java/gregtech/content/recipe/SourceThermalInputRules.java @@ -1,11 +1,6 @@ package gregtech.content.recipe; -import static gregtech.content.recipe.SourceThermalRecyclingRules.Decision; -import static gregtech.content.recipe.SourceThermalRecyclingRules.Facts; -import static gregtech.content.recipe.SourceThermalRecyclingRules.Phase; -import static gregtech.content.recipe.SourceThermalRecyclingRules.Plan; -import static gregtech.content.recipe.SourceThermalRecyclingRules.Stats; -import static gregtech.content.recipe.SourceThermalRecyclingRules.Truth; +import static gregtech.content.recipe.SourceThermalRecyclingRules.*; import gregtech.content.data.MaterialPrefix; import java.util.List; @@ -22,7 +17,7 @@ public final class SourceThermalInputRules { private SourceThermalInputRules() {} - private static final long U = OriginalMaterialFluidUnits.SOURCE_UNIT; + private static final long U = gregtech.content.material.catalog.MaterialFluidUnitFacts.SOURCE_UNIT; public enum InputProof { VERIFIED_SINGLE_COMPONENT, diff --git a/core/src/main/java/gregtech/content/recipe/SourceThermalRecyclingRules.java b/core/src/main/java/gregtech/content/recipe/SourceThermalRecyclingRules.java index 5f32beee9..b7956045e 100644 --- a/core/src/main/java/gregtech/content/recipe/SourceThermalRecyclingRules.java +++ b/core/src/main/java/gregtech/content/recipe/SourceThermalRecyclingRules.java @@ -14,7 +14,7 @@ private SourceThermalRecyclingRules() {} public static final int POWER = 16; public static final long ENVIRONMENT_TEMPERATURE = 293; - private static final long U = OriginalMaterialFluidUnits.SOURCE_UNIT; + private static final long U = gregtech.content.material.catalog.MaterialFluidUnitFacts.SOURCE_UNIT; public enum Truth { YES, diff --git a/core/src/main/java/gregtech/content/recipe/SourceWaxMaterials.java b/core/src/main/java/gregtech/content/recipe/SourceWaxMaterials.java deleted file mode 100644 index 796a3afb6..000000000 --- a/core/src/main/java/gregtech/content/recipe/SourceWaxMaterials.java +++ /dev/null @@ -1,34 +0,0 @@ -package gregtech.content.recipe; - -import gregtech.api.material.GTMaterial; -import gregtech.engine.addon.AddonMaterials; -import gregtech.engine.material.GTMaterialRegistry; -import java.util.ArrayList; -import java.util.List; - -/** Retained source wax identities used by mineral steam cracking. */ -public final class SourceWaxMaterials { - private SourceWaxMaterials() {} - - private record Identity(int id, String name) {} - - private static final List WAXES = List.of( - new Identity(8235, "Wax"), - new Identity(8236, "WaxBee"), - new Identity(8238, "WaxParaffin"), - new Identity(8239, "WaxPlant")); - - public static List materials() { - var result = new ArrayList(); - for (var identity : WAXES) { - var material = GTMaterialRegistry.get(identity.name()); - if (material != null - && material.isValid() - && !AddonMaterials.owns(material) - && GTMaterialRegistry.isCoreMaterial(material.resolve()) - && material.resolve().getId() == identity.id() - && material.resolve().getName().equals(identity.name())) result.add(material); - } - return List.copyOf(result); - } -} diff --git a/core/src/main/java/gregtech/content/recipe/SourcePurifiedAcidData.java b/core/src/main/java/gregtech/content/recipe/SpecialProcessData.java similarity index 51% rename from core/src/main/java/gregtech/content/recipe/SourcePurifiedAcidData.java rename to core/src/main/java/gregtech/content/recipe/SpecialProcessData.java index 74efa8ab4..67f830a3a 100644 --- a/core/src/main/java/gregtech/content/recipe/SourcePurifiedAcidData.java +++ b/core/src/main/java/gregtech/content/recipe/SpecialProcessData.java @@ -1,7 +1,6 @@ package gregtech.content.recipe; -import static gregtech.api.material.GTValues.U; -import static gregtech.content.recipe.SourceRecyclingFacts.Identity; +import static gregtech.content.material.MaterialFactKeys.Identity; import java.util.List; @@ -12,47 +11,38 @@ * Phase evidence: MT 1007/1020-1028/1047/1164/1169-1177/1188, * OreDictMaterial 313/1285/1294-1303, Loader_Fluids 657-662 and FL 1071-1080/1121-1125. */ -public final class SourcePurifiedAcidData { - private SourcePurifiedAcidData() {} +public final class SpecialProcessData { + private SpecialProcessData() {} public enum State { LIQUID, GAS } - /** All 18 bindings are 1000 mB/U. Source ambient fluid() calls resolve liquid at 293 K; - * HF/HCl/H/NO/Cl calls explicitly request gas. The native field/path is a binding assertion, - * not permission to resolve an arbitrary same-name external registry entry. */ + /** The phase selects a recipe material; binding and unit facts live in the material catalog. */ public enum Phase { - AQUAREGIA(id(9827, "AquaRegia"), State.LIQUID, "GenLiquid_AquaRegia", "gt6ce:aquaregia"), - BLUEVITRIOL(id(8404, "BlueVitriol"), State.LIQUID, "GenLiquid_BlueVitriol", "gt6ce:bluevitriol"), - CHLOROPLATINICACID( - id(8401, "ChloroplatinicAcid"), - State.LIQUID, - "GenLiquid_ChloroplatinicAcid", - "gt6ce:chloroplatinicacid"), - CHLORINE(id(170, "Chlorine"), State.GAS, "GenGas_Chlorine", "gt6ce:chlorine"), - CYANVITRIOL(id(8408, "CyanVitriol"), State.LIQUID, "GenLiquid_CyanVitriol", "gt6ce:cyanvitriol"), - GRAYVITRIOL(id(8410, "GrayVitriol"), State.LIQUID, "GenLiquid_GrayVitriol", "gt6ce:grayvitriol"), - GREENVITRIOL(id(8405, "GreenVitriol"), State.LIQUID, "GenLiquid_GreenVitriol", "gt6ce:greenvitriol"), - HYDROGEN(id(10, "Hydrogen"), State.GAS, "Hydrogen", "gt6ce:hydrogen"), - SULFURICACID(id(9824, "SulfuricAcid"), State.LIQUID, "GenLiquid_SulfuricAcid", "gt6ce:sulfuricacid"), - HYDROCHLORICACID(id(9826, "HydrochloricAcid"), State.GAS, "GenGas_HydrochloricAcid", "gt6ce:hydrochloricacid"), - HYDROGENFLUORIDE(id(9829, "HydrogenFluoride"), State.GAS, "GenGas_HydrogenFluoride", "gt6ce:hydrogenfluoride"), - NITROGENMONOXIDE(id(9837, "NitrogenMonoxide"), State.GAS, "GenGas_NitrogenMonoxide", "gt6ce:nitrogenmonoxide"), - PINKVITRIOL(id(8407, "PinkVitriol"), State.LIQUID, "GenLiquid_PinkVitriol", "gt6ce:pinkvitriol"), - REDVITRIOL(id(8406, "RedVitriol"), State.LIQUID, "GenLiquid_RedVitriol", "gt6ce:redvitriol"), - VITRIOLOFCLAY(id(8412, "VitriolOfClay"), State.LIQUID, "GenLiquid_VitriolOfClay", "gt6ce:vitriolofclay"), - WATER(id(9800, "Water"), State.LIQUID, "minecraft:water", "minecraft:water"), - WHITEVITRIOL(id(8409, "WhiteVitriol"), State.LIQUID, "GenLiquid_WhiteVitriol", "gt6ce:whitevitriol"); + AQUAREGIA(id(9827, "AquaRegia"), State.LIQUID), + BLUEVITRIOL(id(8404, "BlueVitriol"), State.LIQUID), + CHLOROPLATINICACID(id(8401, "ChloroplatinicAcid"), State.LIQUID), + CHLORINE(id(170, "Chlorine"), State.GAS), + CYANVITRIOL(id(8408, "CyanVitriol"), State.LIQUID), + GRAYVITRIOL(id(8410, "GrayVitriol"), State.LIQUID), + GREENVITRIOL(id(8405, "GreenVitriol"), State.LIQUID), + HYDROGEN(id(10, "Hydrogen"), State.GAS), + SULFURICACID(id(9824, "SulfuricAcid"), State.LIQUID), + HYDROCHLORICACID(id(9826, "HydrochloricAcid"), State.GAS), + HYDROGENFLUORIDE(id(9829, "HydrogenFluoride"), State.GAS), + NITROGENMONOXIDE(id(9837, "NitrogenMonoxide"), State.GAS), + PINKVITRIOL(id(8407, "PinkVitriol"), State.LIQUID), + REDVITRIOL(id(8406, "RedVitriol"), State.LIQUID), + VITRIOLOFCLAY(id(8412, "VitriolOfClay"), State.LIQUID), + WATER(id(9800, "Water"), State.LIQUID), + WHITEVITRIOL(id(8409, "WhiteVitriol"), State.LIQUID); private final Identity material; private final State state; - private final String nativeField, registryId; - Phase(Identity material, State state, String nativeField, String registryId) { + Phase(Identity material, State state) { this.material = material; this.state = state; - this.nativeField = nativeField; - this.registryId = registryId; } public Identity material() { @@ -62,22 +52,6 @@ public Identity material() { public State state() { return state; } - - public String nativeField() { - return nativeField; - } - - public String registryId() { - return registryId; - } - - public long millibucketsPerUnit() { - return 1000; - } - - public long materialUnit() { - return U; - } } public record Fluid(Phase phase, long millibuckets) {} @@ -95,12 +69,6 @@ public record Family( fluidOutputs = List.copyOf(fluidOutputs); } } - /** Audited default regression observations ONLY, not a live selector permission whitelist. */ - public record ManganeseDefault(Identity material, List byproducts, int sourceLine) { - public ManganeseDefault { - byproducts = List.copyOf(byproducts); - } - } public static final Identity MNO2 = id(9126, "Pyrolusite"), MNCL2 = id(8031, "ManganeseChloride"), @@ -230,102 +198,11 @@ public record ManganeseDefault(Identity material, List byproducts, int f(Phase.HYDROGENFLUORIDE, 500), List.of(), Tail.GRAPHITE)); - // MT .ores declarations supply these complete ordered lists. The original dynamic loop - // traverses MATERIAL_ARRAY in ID order (OreDictMaterial 326), after all fixed families. - private static final List MANGANESE_DEFAULTS = List.of( - new ManganeseDefault( - id(250, "Manganese"), - List.of(id(9126, "Pyrolusite"), id(9104, "Hematite"), id(9113, "Chromite")), - 3062), - new ManganeseDefault( - id(8016, "MagnesiumCarbonate"), List.of(id(9115, "Cobaltite"), id(9126, "Pyrolusite")), 3251), - new ManganeseDefault( - id(9104, "Hematite"), - List.of( - id(9120, "Ilmenite"), - id(9004, "GraniticMineralSand"), - id(9126, "Pyrolusite"), - id(8455, "ClayRed")), - 3033), - new ManganeseDefault( - id(9113, "Chromite"), - List.of( - id(9126, "Pyrolusite"), - id(9104, "Hematite"), - id(8016, "MagnesiumCarbonate"), - id(9210, "Bromargyrite")), - 3060), - new ManganeseDefault( - id(9120, "Ilmenite"), - List.of( - id(9192, "Rutile"), - id(9104, "Hematite"), - id(8016, "MagnesiumCarbonate"), - id(9126, "Pyrolusite")), - 3031), - new ManganeseDefault( - id(9128, "Scheelite"), - List.of(id(9126, "Pyrolusite"), id(9123, "Molybdenite"), id(9107, "Calcite")), - 3181), - new ManganeseDefault( - id(9133, "Tungstate"), - List.of(id(9126, "Pyrolusite"), id(470, "Silver"), id(8029, "LithiumChloride")), - 3180), - new ManganeseDefault( - id(9148, "Tantalite"), - List.of(id(9246, "Columbite"), id(9247, "Coltan"), id(9126, "Pyrolusite"), id(9120, "Ilmenite")), - 3065), - new ManganeseDefault( - id(9164, "Wollastonite"), - List.of(id(9104, "Hematite"), id(8016, "MagnesiumCarbonate"), id(9126, "Pyrolusite")), - 3153), - new ManganeseDefault( - id(9210, "Bromargyrite"), - List.of(id(9126, "Pyrolusite"), id(470, "Silver"), id(9113, "Chromite"), id(9211, "Smithsonite")), - 3061), - new ManganeseDefault( - id(9246, "Columbite"), - List.of(id(9148, "Tantalite"), id(9247, "Coltan"), id(9126, "Pyrolusite"), id(9120, "Ilmenite")), - 3064), - new ManganeseDefault( - id(9247, "Coltan"), - List.of(id(9246, "Columbite"), id(9148, "Tantalite"), id(9126, "Pyrolusite"), id(9120, "Ilmenite")), - 3066)); public static List families() { return FAMILIES; } - public static List manganeseDefaults() { - return MANGANESE_DEFAULTS; - } - - public static Family family(int sourceLine) { - return FAMILIES.stream() - .filter(f -> f.sourceLine() == sourceLine) - .findFirst() - .orElse(null); - } - - public static ManganeseDefault manganeseDefault(int id, String name) { - return MANGANESE_DEFAULTS.stream() - .filter(f -> f.material().matches(id, name)) - .findFirst() - .orElse(null); - } - /** Diagnostic/default-regression comparison only. False must not block a proven live core - * direct MnO2 membership; the source selector reads live byproducts rather than this table. */ - public static boolean matchesManganeseDefault(int id, String name, List liveByproducts) { - var d = manganeseDefault(id, name); - return d != null && d.byproducts().equals(liveByproducts); - } - - public static boolean reviewedIdentity(Identity material) { - if (material == null) return false; - return FAMILIES.stream().anyMatch(f -> f.members().contains(material)) - || MANGANESE_DEFAULTS.stream().anyMatch(d -> d.material().equals(material)); - } - private static Identity id(int id, String name) { return new Identity(id, name); } diff --git a/core/src/main/java/gregtech/content/recipe/SpecialProcessMaterialFacts.java b/core/src/main/java/gregtech/content/recipe/SpecialProcessMaterialFacts.java new file mode 100644 index 000000000..925d1a72f --- /dev/null +++ b/core/src/main/java/gregtech/content/recipe/SpecialProcessMaterialFacts.java @@ -0,0 +1,242 @@ +package gregtech.content.recipe; + +import static gregtech.content.recipe.SpecialProcessData.Phase; +import static gregtech.content.recipe.SpecialProcessData.Tail; + +import gregtech.api.addon.material.*; +import gregtech.engine.material.MaterialDefinition; +import gregtech.engine.material.MaterialInfoDefinition; +import java.util.*; + +/** Attaches built-in purified-acid methods as ordinary typed material process rules. */ +public final class SpecialProcessMaterialFacts { + private static final FormKey PURIFIED = form("crushedPurified"); + private static final FormKey PURIFIED_TINY = form("crushedPurifiedTiny"); + private static final FormKey CENTRIFUGED = form("crushedCentrifuged"); + private static final FormKey CENTRIFUGED_TINY = form("crushedCentrifugedTiny"); + private static final Map INPUT_COUNTS = Map.of(PURIFIED, 1, PURIFIED_TINY, 9); + + private SpecialProcessMaterialFacts() {} + + public static MaterialDefinition.Declaration apply(MaterialDefinition.Declaration declaration) { + var processes = new LinkedHashMap<>(declaration.info().processes().rules()); + attachReagents(declaration.name(), processes); + attachFixedTargets(declaration, processes); + attachStaticAquaRegiaTargets(declaration.name(), processes); + attachManganeseTarget(declaration, processes); + if (processes.equals(declaration.info().processes().rules())) return declaration; + var info = declaration.info(); + return new MaterialDefinition.Declaration( + declaration.material(), + new MaterialInfoDefinition( + info.tooling(), + info.composition(), + info.relations(), + new MaterialInfoDefinition.Processes(processes))); + } + + private static void attachReagents( + String name, Map, List>> processes) { + if (name.equals("SulfuricAcid")) reagent(processes, SpecialProcessMethods.SULFURIC_ACID_LEACHING, "liquid"); + if (name.equals("AquaRegia")) reagent(processes, SpecialProcessMethods.AQUA_REGIA_LEACHING, "liquid"); + if (name.equals("HydrogenFluoride")) + reagent(processes, SpecialProcessMethods.HYDROFLUORIC_ACID_LEACHING, "gas"); + if (name.equals("HydrochloricAcid")) + reagent(processes, SpecialProcessMethods.HYDROCHLORIC_ACID_MANGANESE_LEACHING, "gas"); + } + + private static void attachFixedTargets( + MaterialDefinition.Declaration declaration, + Map, List>> processes) { + for (var family : SpecialProcessData.families()) { + var member = family.members().stream() + .filter(identity -> identity.matches(declaration.material().id(), declaration.name())) + .findFirst() + .orElse(null); + if (member == null) continue; + var method = method(family.fluidInput().phase()); + if (method == null) continue; + processes + .computeIfAbsent(method, ignored -> new ArrayList<>()) + .add(new MaterialProcessRule<>( + INPUT_COUNTS.keySet(), fixedTarget(new MaterialKey(declaration.name()), family))); + } + } + + private static SpecialProcessValue.Target fixedTarget(MaterialKey target, SpecialProcessData.Family family) { + var itemOutputs = new ArrayList(); + itemOutputs.add(new SpecialProcessValue.ItemOutput( + target, List.of(new SpecialProcessValue.FormCount(CENTRIFUGED, 1)), 10_000)); + MaterialKey tail = switch (family.tail()) { + case SELF -> target; + case PLATINUM_GROUP_SLUDGE -> new MaterialKey(SpecialProcessData.PGS.name()); + case GRAPHITE -> new MaterialKey(SpecialProcessData.GRAPHITE.name()); + }; + int tailCount = family.tail() == Tail.PLATINUM_GROUP_SLUDGE ? 8 : 2; + for (int index = 0; index < 5; index++) + itemOutputs.add(new SpecialProcessValue.ItemOutput( + tail, List.of(new SpecialProcessValue.FormCount(CENTRIFUGED_TINY, tailCount)), 5_000)); + return new SpecialProcessValue.Target( + INPUT_COUNTS, + itemOutputs, + family.fluidOutputs().stream() + .map(SpecialProcessMaterialFacts::fluidOutput) + .toList(), + family.fluidInput().millibuckets(), + 256, + 0); + } + + private static void attachManganeseTarget( + MaterialDefinition.Declaration declaration, + Map, List>> processes) { + var material = declaration.material(); + if (material.properties().contains(gregtech.api.material.MaterialProperty.ANTIMATTER)) return; + boolean mnDioxideByproduct = declaration.info().processes().find(MaterialProcessKeys.ORE_PROCESSING).stream() + .map(MaterialProcessRule::value) + .anyMatch(rule -> rule.byproducts().stream() + .anyMatch(byproduct -> byproduct.name().equals("Pyrolusite"))); + if (!mnDioxideByproduct) return; + var target = new SpecialProcessValue.Target( + INPUT_COUNTS, + List.of( + new SpecialProcessValue.ItemOutput( + new MaterialKey(declaration.name()), + List.of(new SpecialProcessValue.FormCount(CENTRIFUGED, 1)), + 10_000), + new SpecialProcessValue.ItemOutput( + new MaterialKey(SpecialProcessData.MNCL2.name()), + List.of( + new SpecialProcessValue.FormCount(form("dustSmall"), 6), + new SpecialProcessValue.FormCount(form("dustTiny"), 13), + new SpecialProcessValue.FormCount(form("dustDiv72"), 64)), + 10_000)), + List.of( + new SpecialProcessValue.FluidOutput( + new MaterialKey("Water"), + List.of(new SpecialProcessValue.FormCount(form("liquid"), 1)), + 3_000), + new SpecialProcessValue.FluidOutput( + new MaterialKey("Chlorine"), + List.of(new SpecialProcessValue.FormCount(form("gas"), 1)), + 1_000)), + 4_000, + 256, + 0); + processes + .computeIfAbsent( + SpecialProcessMethods.HYDROCHLORIC_ACID_MANGANESE_LEACHING, ignored -> new ArrayList<>()) + .add(new MaterialProcessRule<>(INPUT_COUNTS.keySet(), target)); + } + + private static void attachStaticAquaRegiaTargets( + String name, Map, List>> processes) { + SpecialProcessValue.Target target = switch (name) { + case "Gold" -> + aquaRegiaTarget( + "Gold", + "Copper", + new SpecialProcessValue.FluidOutput( + new MaterialKey("ChloroauricAcid"), + List.of(new SpecialProcessValue.FormCount(form("liquid"), 1)), + 3_000), + new SpecialProcessValue.FluidOutput( + new MaterialKey("NitrogenMonoxide"), + List.of(new SpecialProcessValue.FormCount(form("gas"), 1)), + 1_000), + new SpecialProcessValue.FluidOutput( + new MaterialKey("Water"), + List.of(new SpecialProcessValue.FormCount(form("liquid"), 1)), + 3_000), + 6_500); + case "Copper" -> + aquaRegiaTarget( + "Copper", + "Cobalt", + new SpecialProcessValue.FluidOutput( + new MaterialKey("ChloroauricAcid"), + List.of(new SpecialProcessValue.FormCount(form("liquid"), 1)), + 3_000), + new SpecialProcessValue.FluidOutput( + new MaterialKey("NitrogenMonoxide"), + List.of(new SpecialProcessValue.FormCount(form("gas"), 1)), + 1_000), + new SpecialProcessValue.FluidOutput( + new MaterialKey("Water"), + List.of(new SpecialProcessValue.FormCount(form("liquid"), 1)), + 3_000), + 6_500); + case "Tin", "Cassiterite" -> + aquaRegiaTarget( + name, + "Zinc", + new SpecialProcessValue.FluidOutput( + new MaterialKey("StannicChloride"), + List.of(new SpecialProcessValue.FormCount(form("liquid"), 1)), + 2_500), + new SpecialProcessValue.FluidOutput( + new MaterialKey("HydrochloricAcid"), + List.of(new SpecialProcessValue.FormCount(form("gas"), 1)), + 4_000), + new SpecialProcessValue.FluidOutput( + new MaterialKey("NitrogenDioxide"), + List.of(new SpecialProcessValue.FormCount(form("gas"), 1)), + 3_000), + 13_000); + default -> null; + }; + if (target == null) return; + processes + .computeIfAbsent(SpecialProcessMethods.AQUA_REGIA_LEACHING, ignored -> new ArrayList<>()) + .add(new MaterialProcessRule<>(INPUT_COUNTS.keySet(), target)); + } + + private static SpecialProcessValue.Target aquaRegiaTarget( + String target, + String byproduct, + SpecialProcessValue.FluidOutput first, + SpecialProcessValue.FluidOutput second, + SpecialProcessValue.FluidOutput third, + int acid) { + var items = new ArrayList(); + items.add(new SpecialProcessValue.ItemOutput( + new MaterialKey(target), List.of(new SpecialProcessValue.FormCount(CENTRIFUGED, 1)), 10_000)); + for (int index = 0; index < 5; index++) + items.add(new SpecialProcessValue.ItemOutput( + new MaterialKey(byproduct), + List.of(new SpecialProcessValue.FormCount(CENTRIFUGED_TINY, 2)), + 5_000)); + return new SpecialProcessValue.Target(INPUT_COUNTS, items, List.of(first, second, third), acid, 256, 0); + } + + private static SpecialProcessValue.FluidOutput fluidOutput(SpecialProcessData.Fluid fluid) { + FormKey outputForm = form(fluid.phase().state() == SpecialProcessData.State.GAS ? "gas" : "liquid"); + return new SpecialProcessValue.FluidOutput( + new MaterialKey(fluid.phase().material().name()), + List.of(new SpecialProcessValue.FormCount(outputForm, 1)), + Math.toIntExact(fluid.millibuckets())); + } + + private static MaterialProcessKey method(Phase phase) { + return switch (phase) { + case SULFURICACID -> SpecialProcessMethods.SULFURIC_ACID_LEACHING; + case AQUAREGIA -> SpecialProcessMethods.AQUA_REGIA_LEACHING; + case HYDROGENFLUORIDE -> SpecialProcessMethods.HYDROFLUORIC_ACID_LEACHING; + case HYDROCHLORICACID -> SpecialProcessMethods.HYDROCHLORIC_ACID_MANGANESE_LEACHING; + default -> null; + }; + } + + private static void reagent( + Map, List>> processes, + MaterialProcessKey method, + String form) { + processes + .computeIfAbsent(method, ignored -> new ArrayList<>()) + .add(new MaterialProcessRule<>(Set.of(form(form)), new SpecialProcessValue.Reagent())); + } + + private static FormKey form(String name) { + return new FormKey(name); + } +} diff --git a/core/src/main/java/gregtech/content/recipe/SpecialProcessMethods.java b/core/src/main/java/gregtech/content/recipe/SpecialProcessMethods.java new file mode 100644 index 000000000..61ee4d361 --- /dev/null +++ b/core/src/main/java/gregtech/content/recipe/SpecialProcessMethods.java @@ -0,0 +1,44 @@ +package gregtech.content.recipe; + +import gregtech.api.addon.material.DataKey; +import gregtech.api.addon.material.MaterialProcessKey; +import gregtech.api.addon.material.SpecialProcessMethod; +import gregtech.api.addon.material.SpecialProcessValue; +import gregtech.engine.material.MaterialInfoRegistry; +import java.util.List; + +/** Built-in special process methods and their stable target/reagent process keys. */ +public final class SpecialProcessMethods { + public static final MaterialProcessKey SULFURIC_ACID_LEACHING = + process("sulfuric_acid_leaching"); + public static final MaterialProcessKey AQUA_REGIA_LEACHING = process("aqua_regia_leaching"); + public static final MaterialProcessKey HYDROFLUORIC_ACID_LEACHING = + process("hydrofluoric_acid_leaching"); + public static final MaterialProcessKey HYDROCHLORIC_ACID_MANGANESE_LEACHING = + process("hydrochloric_acid_manganese_leaching"); + + private static final List METHODS = List.of( + method(SULFURIC_ACID_LEACHING), + method(AQUA_REGIA_LEACHING), + method(HYDROFLUORIC_ACID_LEACHING), + method(HYDROCHLORIC_ACID_MANGANESE_LEACHING)); + + private SpecialProcessMethods() {} + + public static List methods() { + return METHODS; + } + + public static void install() { + for (var method : METHODS) MaterialInfoRegistry.installBuiltinSpecialProcess(method); + } + + private static SpecialProcessMethod method(MaterialProcessKey process) { + return new SpecialProcessMethod( + process, "gt.recipe.bath", "gt6ce." + process.id().path().replace('/', '.')); + } + + private static MaterialProcessKey process(String path) { + return MaterialProcessKey.multiple(new DataKey("gt6ce", "special_process/" + path), SpecialProcessValue.class); + } +} diff --git a/core/src/main/java/gregtech/engine/material/GTMaterialRegistry.java b/core/src/main/java/gregtech/engine/material/GTMaterialRegistry.java index 2595bdfc2..056d01ed5 100644 --- a/core/src/main/java/gregtech/engine/material/GTMaterialRegistry.java +++ b/core/src/main/java/gregtech/engine/material/GTMaterialRegistry.java @@ -228,6 +228,7 @@ public static synchronized void init() { definitionsOpen = false; } MaterialInfoRegistry.resolveAddonRegistrations(); + gregtech.content.recipe.SpecialProcessMethods.install(); MaterialInfoRegistry.closeRegistrations(); phase = RegistrationPhase.LINKS; MaterialLinker.validate(MaterialDefinitions.declarations(), BY_NAME::get); diff --git a/core/src/main/java/gregtech/engine/material/MaterialIconDefinitions.java b/core/src/main/java/gregtech/engine/material/MaterialIconDefinitions.java index be5423e99..afd217d31 100644 --- a/core/src/main/java/gregtech/engine/material/MaterialIconDefinitions.java +++ b/core/src/main/java/gregtech/engine/material/MaterialIconDefinitions.java @@ -1,6 +1,8 @@ package gregtech.engine.material; -import gregtech.api.material.*; +import gregtech.api.material.GTMaterial; +import gregtech.api.material.MaterialProperty; +import gregtech.api.material.MaterialTextureSet; import gregtech.content.data.MaterialPrefix; /** Shared original material icon selection and resource paths, without client classes. */ diff --git a/core/src/main/java/gregtech/engine/material/MaterialInfoRegistry.java b/core/src/main/java/gregtech/engine/material/MaterialInfoRegistry.java index c6e13b92a..19ee9857e 100644 --- a/core/src/main/java/gregtech/engine/material/MaterialInfoRegistry.java +++ b/core/src/main/java/gregtech/engine/material/MaterialInfoRegistry.java @@ -26,6 +26,8 @@ private MaterialInfoRegistry() {} private static final List ADDON_TAG_DECLARATIONS = new ArrayList<>(); private static final List ADDON_GROUPS = new ArrayList<>(); private static final List ADDON_PROCESSES = new ArrayList<>(); + private static final List ADDON_SPECIAL_PROCESSES = new ArrayList<>(); + private static final Map SPECIAL_PROCESSES = new LinkedHashMap<>(); private static boolean registrationsClosed; private static volatile Snapshot snapshot; @@ -50,6 +52,8 @@ public record GroupSubmission(String addonId, MaterialGroupDeclaration declarati public record ProcessSubmission( String addonId, MaterialKey material, MaterialProcessKey process, MaterialProcessRule rule) {} + public record SpecialProcessSubmission(String addonId, SpecialProcessMethod method) {} + private record ToolSubmission(String addonId, MaterialKey material, MaterialToolProfile profile) {} private record CompositionSubmission(String addonId, MaterialKey material, MaterialComposition composition) {} @@ -122,6 +126,7 @@ static void freeze() { mergeAddonProcesses(); normalizeLinkedFlags(); validateProcesses(); + validateSpecialProcesses(); validateLinkedToolRegistrations(); var published = new LinkedHashMap(); MATERIALS.forEach((key, info) -> published.put(key, info.freeze())); @@ -180,6 +185,42 @@ private static void validateProcesses() { })); } + private static void validateSpecialProcesses() { + for (var submission : ADDON_SPECIAL_PROCESSES) + installSpecialProcess(new SpecialProcessSubmission(submission.addonId(), submission.method())); + for (var entry : MATERIALS.entrySet()) { + for (var ruleEntry : entry.getValue().processes.entrySet()) { + var method = SPECIAL_PROCESSES.get(ruleEntry.getKey().id()); + boolean special = + ruleEntry.getValue().stream().anyMatch(rule -> rule.value() instanceof SpecialProcessValue); + if (!special) continue; + if (method == null || !method.process().equals(ruleEntry.getKey())) + throw new IllegalArgumentException("Missing special process method " + + ruleEntry.getKey().id()); + for (var rule : ruleEntry.getValue()) { + if (rule.value() instanceof SpecialProcessValue.Target target) { + if (!target.inputCounts().keySet().equals(rule.forms())) + throw new IllegalArgumentException( + "Special process target forms do not match rule forms for " + + entry.getKey().name() + " in " + + method.process().id()); + } else if (!(rule.value() instanceof SpecialProcessValue.Reagent)) { + throw new IllegalArgumentException("Invalid special process value for " + + entry.getKey().name()); + } + } + } + } + } + + private static void installSpecialProcess(SpecialProcessSubmission submission) { + var method = submission.method(); + requireNamespace(submission.addonId(), method.process().id()); + if (SPECIAL_PROCESSES.putIfAbsent(method.process().id(), method) != null) + throw new IllegalArgumentException( + "Duplicate special process method " + method.process().id()); + } + private static void normalizeLinkedFlags() { for (var entry : MATERIALS.entrySet()) { GTMaterial material = GTMaterialRegistry.get(entry.getKey().name()); @@ -309,6 +350,18 @@ static List groupSubmissions() { return List.copyOf(ADDON_GROUPS); } + public static List specialProcesses() { + return List.copyOf(SPECIAL_PROCESSES.values()); + } + + /** Installs a built-in method declaration before the special-process registry closes. */ + public static void installBuiltinSpecialProcess(SpecialProcessMethod method) { + if (snapshot != null) throw new IllegalStateException("Material auxiliary registrations are frozen"); + if (SPECIAL_PROCESSES.putIfAbsent(method.process().id(), method) != null) + throw new IllegalArgumentException( + "Duplicate special process method " + method.process().id()); + } + private static Set normalizeProcessForms( String source, MaterialProcessKey process, Set sourceForms) { if (sourceForms.isEmpty()) return sourceForms; @@ -334,7 +387,26 @@ private static Set normalizeProcessForms( static MaterialProcessRule normalizeProcessRule( String source, MaterialProcessKey process, MaterialProcessRule rule) { - return new MaterialProcessRule<>(normalizeProcessForms(source, process, rule.forms()), rule.value()); + var forms = normalizeProcessForms(source, process, rule.forms()); + if (rule.value() instanceof SpecialProcessValue.Target target) { + var counts = new LinkedHashMap(); + target.inputCounts().forEach((form, count) -> { + var normalized = normalizeProcessForms(source, process, Set.of(form)) + .iterator() + .next(); + if (counts.putIfAbsent(normalized, count) != null) + throw new IllegalArgumentException("Duplicate normalized special process input form " + normalized); + }); + var normalized = new SpecialProcessValue.Target( + counts, + target.itemOutputs(), + target.fluidOutputs(), + target.reagentAmount(), + target.duration(), + target.euPerTick()); + return new MaterialProcessRule<>(forms, normalized); + } + return new MaterialProcessRule<>(forms, rule.value()); } @Override @@ -622,6 +694,15 @@ public MaterialInfoTool.Registrar registerGroup(MaterialGroupDeclaration declara return this; } + @Override + public MaterialInfoTool.Registrar registerSpecialProcess(SpecialProcessMethod method) { + requireOpen(); + Objects.requireNonNull(method); + requireNamespace(addonId, method.process().id()); + ADDON_SPECIAL_PROCESSES.add(new SpecialProcessSubmission(addonId, method)); + return this; + } + @Override public MaterialInfoTool.Registrar registerProcess( MaterialKey material, MaterialProcessKey process, MaterialProcessRule rule) { diff --git a/core/src/main/java/gregtech/engine/material/MaterialItemDefinitions.java b/core/src/main/java/gregtech/engine/material/MaterialItemDefinitions.java index 6175148c5..4b568781d 100644 --- a/core/src/main/java/gregtech/engine/material/MaterialItemDefinitions.java +++ b/core/src/main/java/gregtech/engine/material/MaterialItemDefinitions.java @@ -1,16 +1,11 @@ package gregtech.engine.material; -import gregtech.api.material.*; +import gregtech.api.material.GTMaterial; import gregtech.content.data.MaterialPrefix; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.mod.GregTechIdentity; import gregtech.engine.prefix.PrefixRegistry; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * One authoritative item definition stream for both platforms, extracted from saltnya Loader_Items. diff --git a/core/src/main/java/gregtech/engine/material/MaterialPublication.java b/core/src/main/java/gregtech/engine/material/MaterialPublication.java index eab9b06bf..a51b57bef 100644 --- a/core/src/main/java/gregtech/engine/material/MaterialPublication.java +++ b/core/src/main/java/gregtech/engine/material/MaterialPublication.java @@ -31,20 +31,39 @@ public static synchronized Stamp materialDefinitionsPublished(long materialRevis return published; } + /** Allocates a generation stamp for a build that has not reached its final publication boundary. */ + public static synchronized Stamp candidatePlatformGeneration(long compositionRevision, long recipeRevision) { + Stamp previous = requirePlatformGeneration(compositionRevision, recipeRevision); + return new Stamp( + NEXT_REVISION.incrementAndGet(), previous.materialRevision(), compositionRevision, recipeRevision); + } + /** Publishes one complete platform generation after compositions and recipe rows are final. */ public static synchronized Stamp platformGenerationPublished(long compositionRevision, long recipeRevision) { + return commit(candidatePlatformGeneration(compositionRevision, recipeRevision)); + } + + /** Commits a candidate only after every derived publication built from it has succeeded. */ + public static synchronized Stamp commit(Stamp candidate) { + java.util.Objects.requireNonNull(candidate, "candidate"); Stamp previous = current; - if (previous.materialRevision() == 0) - throw new IllegalStateException("Material definitions must be published first"); - if (recipeRevision <= 0) throw new IllegalArgumentException("Recipe revision must be positive"); - Stamp published = new Stamp( - NEXT_REVISION.incrementAndGet(), previous.materialRevision(), compositionRevision, recipeRevision); - current = published; - return published; + if (candidate.materialRevision() != previous.materialRevision()) + throw new IllegalStateException("Published generation belongs to another material definition"); + if (candidate.revision() <= previous.revision()) return previous; + current = candidate; + return candidate; } /** The last fully successful publication; an in-progress or failed generation leaves it unchanged. */ public static Stamp current() { return current; } + + private static Stamp requirePlatformGeneration(long compositionRevision, long recipeRevision) { + Stamp previous = current; + if (previous.materialRevision() == 0) + throw new IllegalStateException("Material definitions must be published first"); + if (recipeRevision <= 0) throw new IllegalArgumentException("Recipe revision must be positive"); + return previous; + } } diff --git a/core/src/main/java/gregtech/engine/material/MaterialViews.java b/core/src/main/java/gregtech/engine/material/MaterialViews.java index c97815460..35afb5222 100644 --- a/core/src/main/java/gregtech/engine/material/MaterialViews.java +++ b/core/src/main/java/gregtech/engine/material/MaterialViews.java @@ -23,6 +23,7 @@ private record TagDeclarationSubmission(String addonId, MaterialTagDeclaration d private record GroupSubmission(String addonId, MaterialGroupDeclaration declaration) {} private static MaterialCatalogView published; + private static long contentRevision; private static volatile MaterialFormsView formBindings = new MaterialFormsView() { public Set find(MaterialKey material) { return Set.of(); @@ -36,6 +37,9 @@ static void publish() { var origins = new LinkedHashMap(); var directTagMembers = new LinkedHashMap>(); var tagFacts = new LinkedHashMap(); + var specialProcessMethods = new LinkedHashMap(); + for (var method : MaterialInfoRegistry.specialProcesses()) + specialProcessMethods.put(method.process().id(), method); for (GTMaterial material : GTMaterialRegistry.sortedMaterials()) { if (material.resolve() != material) continue; var definition = MaterialDefinitions.find(material.getName()); @@ -55,6 +59,22 @@ static void publish() { tagFacts.putIfAbsent(key, new TagFacts("gt6ce", Set.of())); } var key = new MaterialKey(material.getName()); + MaterialInfoRegistry.processesForPublication(key).rules().forEach((process, rules) -> { + var method = specialProcessMethods.get(process.id()); + if (method == null || !method.process().equals(process)) return; + for (var rule : rules) { + DataKey tag = rule.value() instanceof SpecialProcessValue.Target + ? method.targetTag() + : rule.value() instanceof SpecialProcessValue.Reagent ? method.reagentTag() : null; + if (tag == null) continue; + builder.tag(tag); + var owner = method.process().id().namespace(); + var previous = tagFacts.putIfAbsent(tag, new TagFacts(owner, Set.of())); + if (previous != null && !previous.owner().equals(owner)) + throw new IllegalArgumentException( + "Special process tag " + tag + " conflicts with owner " + previous.owner()); + } + }); builders.put(key, builder); properties.put(key, new LinkedHashMap<>()); for (var property : builder.build().keys()) types.put(property.id(), property.type()); @@ -384,6 +404,15 @@ public Optional group(MaterialGroupKey key) { return Optional.ofNullable(groups.get(java.util.Objects.requireNonNull(key))); } }; + var specialProcesses = new SpecialProcessesView() { + public List methods() { + return List.copyOf(specialProcessMethods.values()); + } + + public Optional find(DataKey id) { + return Optional.ofNullable(specialProcessMethods.get(java.util.Objects.requireNonNull(id))); + } + }; var indexed = Map.copyOf(materials); var ordered = List.copyOf(materials.values()); var aliases = new LinkedHashMap(); @@ -425,6 +454,10 @@ public MaterialFormsView formBindings() { public MaterialProcessesView processes() { return processView; } + + public SpecialProcessesView specialProcesses() { + return specialProcesses; + } }; } @@ -549,5 +582,10 @@ public Set find(MaterialKey material) { return immutable.getOrDefault(java.util.Objects.requireNonNull(material), Set.of()); } }; + contentRevision++; + } + + public static synchronized long contentRevision() { + return contentRevision; } } diff --git a/core/src/main/java/gregtech/engine/recipe/SourceRecyclingMath.java b/core/src/main/java/gregtech/engine/recipe/SourceRecyclingMath.java index 73a9d5fc0..4440a3b9f 100644 --- a/core/src/main/java/gregtech/engine/recipe/SourceRecyclingMath.java +++ b/core/src/main/java/gregtech/engine/recipe/SourceRecyclingMath.java @@ -81,7 +81,7 @@ public static Result singleFluid( || environmentTemperature < 0) throw new IllegalArgumentException("Unreviewed thermal arithmetic inputs"); long target = unitsDown(inputUnits, sourceUnit, targetPerUnit); - int mb = gregtech.content.recipe.OriginalMaterialFluidUnits.millibuckets( + int mb = gregtech.content.material.catalog.MaterialFluidUnitFacts.millibuckets( target, referenceFluidUnits, referenceMillibuckets, false); if (mb < 0) throw new ArithmeticException("Fluid amount exceeds native int capacity"); // Source uses input mass, not output mass, and keeps this exact double expression/order. diff --git a/core/src/main/java/gregtech/engine/recipe/chem/MaterialFluidBinding.java b/core/src/main/java/gregtech/engine/recipe/chem/MaterialFluidBinding.java index 3d19b3d92..04d7c76ef 100644 --- a/core/src/main/java/gregtech/engine/recipe/chem/MaterialFluidBinding.java +++ b/core/src/main/java/gregtech/engine/recipe/chem/MaterialFluidBinding.java @@ -1,7 +1,7 @@ package gregtech.engine.recipe.chem; import gregtech.content.data.FluidCatalog; -import gregtech.content.recipe.OriginalMaterialFluidUnits; +import gregtech.content.material.catalog.MaterialFluidUnitFacts; import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; @@ -20,7 +20,7 @@ public record MaterialFluidBinding( int referenceMillibuckets) { public int millibuckets(MaterialAmount amount, Rounding rounding) { - int value = OriginalMaterialFluidUnits.millibuckets( + int value = MaterialFluidUnitFacts.millibuckets( amount.units(), referenceUnits, referenceMillibuckets, rounding == Rounding.CEIL); if (value <= 0) throw new IllegalArgumentException("Fluid amount out of range: " + amount); return value; @@ -96,7 +96,7 @@ private static Map build() { FluidPhase phase = fluid.gas() ? FluidPhase.GAS : FluidPhase.LIQUID; int reference = reference(materialKey, field, fluid, phase); var binding = new MaterialFluidBinding( - materialKey, phase, field, fluid.registryName(), OriginalMaterialFluidUnits.SOURCE_UNIT, reference); + materialKey, phase, field, fluid.registryName(), MaterialFluidUnitFacts.SOURCE_UNIT, reference); var key = new Key(binding.material(), binding.phase()); var previous = out.putIfAbsent(key, binding); if (previous != null && previous.referenceMillibuckets() != reference) @@ -107,7 +107,8 @@ private static Map build() { } private static int reference(String material, String field, FluidCatalog.FluidEntry entry, FluidPhase phase) { - var explicit = OriginalMaterialFluidUnits.binding(material, phase.sourceName()); + var resolved = gregtech.engine.material.GTMaterialRegistry.get(material); + var explicit = resolved.isValid() ? MaterialFluidUnitFacts.binding(resolved, phase.sourceName()) : null; if (explicit != null) { long millibuckets = explicit.referenceMillibuckets(); if (millibuckets <= 0 || millibuckets > Integer.MAX_VALUE) @@ -117,8 +118,7 @@ private static int reference(String material, String field, FluidCatalog.FluidEn boolean molten = entry.textureMode() == FluidCatalog.FluidTextureMode.GENERIC_MOLTEN || FluidCatalog.isGeneratedMoltenDefinition(field, entry); if (molten) { - var resolved = gregtech.engine.material.GTMaterialRegistry.get(material); - return resolved != null && resolved.isValid() + return resolved.isValid() ? gregtech.engine.fluid.MoltenMaterialUnits.ratio(resolved).millibucketsPerUnit() : 144; } diff --git a/core/src/main/resources/assets/gt6ce/lang/en_us.json b/core/src/main/resources/assets/gt6ce/lang/en_us.json index 3904ba1b2..f7264e624 100644 --- a/core/src/main/resources/assets/gt6ce/lang/en_us.json +++ b/core/src/main/resources/assets/gt6ce/lang/en_us.json @@ -1,4 +1,8 @@ { + "gt6ce.special_process.sulfuric_acid_leaching": "Sulfuric Acid Leaching", + "gt6ce.special_process.aqua_regia_leaching": "Aqua Regia Leaching", + "gt6ce.special_process.hydrofluoric_acid_leaching": "Hydrofluoric Acid Leaching", + "gt6ce.special_process.hydrochloric_acid_manganese_leaching": "Hydrochloric Acid Manganese Leaching", "fluid_type.gt6ce.watergeothermal": "Hot Spring Water", "fluid.gt6ce.watergeothermal": "Hot Spring Water", "block.gt6ce.watergeothermal": "Geothermal Water", @@ -12657,8 +12661,6 @@ "tooltip.gt6ce.bush.set_output": "Right-click with a berry to set the output", "tooltip.gt6ce.chemical_battery.packet": "EU packet size: %s–%s", "tooltip.gt6ce.chemical_battery.place": "Sneak to place; stored charge is retained when picked up", - "tooltip.gt6ce.composition_descriptive": "Composition reference only; not enabled for bulk recovery", - "tooltip.gt6ce.composition_nonmaterial": "No recoverable bulk material (technical/entity item)", "tooltip.gt6ce.contained_materials": "Contained Materials:", "tooltip.gt6ce.crucible.acidproof": "Acid Proof!", "tooltip.gt6ce.crucible.contact_damage": "Causes Damage when touched while active!", @@ -13717,4 +13719,4 @@ "enchantment.gt6ce.gt_haste": "Efficiency", "enchantment.gt6ce.sharpness_multi": "Sharpness", "enchantment.gt6ce.smite_multi": "Smite" -} \ No newline at end of file +} diff --git a/core/src/main/resources/assets/gt6ce/lang/zh_cn.json b/core/src/main/resources/assets/gt6ce/lang/zh_cn.json index 842a560ef..404a035af 100644 --- a/core/src/main/resources/assets/gt6ce/lang/zh_cn.json +++ b/core/src/main/resources/assets/gt6ce/lang/zh_cn.json @@ -60,6 +60,10 @@ "gt.material.Sculk": "幽匿", "material.gt6ce.redstonealloy": "红石合金", "material.gt6ce.sculk": "幽匿", + "gt6ce.special_process.sulfuric_acid_leaching": "硫酸浸出", + "gt6ce.special_process.aqua_regia_leaching": "王水浸出", + "gt6ce.special_process.hydrofluoric_acid_leaching": "氢氟酸浸出", + "gt6ce.special_process.hydrochloric_acid_manganese_leaching": "盐酸锰矿浸出", "gt6ce.jei.category.mold_chisel": "模具凿刻", "gt6ce.jei.mold_chisel.note": "深灰色格子为凿除部分", "gt6ce.jei.mold_chisel.carved": "凿除这个格子", @@ -96359,8 +96363,6 @@ "tooltip.gt6ce.bush.set_output": "Right-click with a berry to set the output", "tooltip.gt6ce.chemical_battery.packet": "EU packet size: %s–%s", "tooltip.gt6ce.chemical_battery.place": "Sneak to place; stored charge is retained when picked up", - "tooltip.gt6ce.composition_descriptive": "Composition reference only; not enabled for bulk recovery", - "tooltip.gt6ce.composition_nonmaterial": "No recoverable bulk material (technical/entity item)", "tooltip.gt6ce.contained_materials": "含有材料:", "tooltip.gt6ce.crucible.acidproof": "Acid Proof!", "tooltip.gt6ce.crucible.contact_damage": "当它在运作的时候接触会受伤!", @@ -98008,4 +98010,4 @@ "enchantment.gt6ce.gt_haste": "效率", "enchantment.gt6ce.sharpness_multi": "锋利", "enchantment.gt6ce.smite_multi": "亡灵杀手" -} \ No newline at end of file +} diff --git a/core/src/test/java/gregtech/content/data/CoinRemovalTest.java b/core/src/test/java/gregtech/content/data/CoinRemovalTest.java index baa7bea6e..a341540e1 100644 --- a/core/src/test/java/gregtech/content/data/CoinRemovalTest.java +++ b/core/src/test/java/gregtech/content/data/CoinRemovalTest.java @@ -1,6 +1,7 @@ package gregtech.content.data; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import gregtech.api.material.GTValues; import gregtech.content.material.MaterialTestFixture; diff --git a/core/src/test/java/gregtech/content/material/MaterialBaselineSnapshot.java b/core/src/test/java/gregtech/content/material/MaterialBaselineSnapshot.java deleted file mode 100644 index 5a39fbb41..000000000 --- a/core/src/test/java/gregtech/content/material/MaterialBaselineSnapshot.java +++ /dev/null @@ -1,113 +0,0 @@ -package gregtech.content.material; - -import gregtech.api.material.GTMaterial; -import gregtech.api.material.MaterialComponent; -import gregtech.api.mod.ModData; -import gregtech.content.data.generated.MaterialForms; -import gregtech.engine.addon.AddonMaterials; -import gregtech.engine.material.GTMaterialRegistry; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -/** Test-only, stable projection; raw identity and resolved identity deliberately occupy separate columns. */ -public final class MaterialBaselineSnapshot { - private MaterialBaselineSnapshot() {} - - public static String identity(GTMaterial material) { - if (material == null) return "-"; - // Addon numeric ids depend on the installed contributor set. - return (AddonMaterials.owns(material) ? AddonMaterials.owner(material) : "core") + ":" + material.getName(); - } - - public static String components(List parts, boolean ordered) { - var stream = parts.stream().map(part -> identity(part.material().resolve()) + "=" + part.amount()); - return (ordered ? stream : stream.sorted()).collect(Collectors.joining(",")); - } - - public static List materials(Collection materials) { - return materials.stream() - .map(raw -> { - var m = raw.resolve(); - return String.join( - "\t", - identity(raw), - identity(m), - AddonMaterials.owns(raw) ? "dynamic" : Integer.toString(raw.getId()), - AddonMaterials.owns(m) ? "dynamic" : Integer.toString(m.getId()), - Boolean.toString(raw.isValid()), - Boolean.toString(m.isValid()), - m.getSourceModName(), - m.getProtons() + "/" + m.getElectrons() + "/" + m.getNeutrons() + "/" + m.getMass(), - m.getMeltingPoint() + "/" + m.getBoilingPoint() + "/" + Float.toString(m.getDensity()), - m.getProperties().stream().map(Enum::name).sorted().collect(Collectors.joining(",")), - m.getFurnaceBurnTime() + "/" + identity(m.getTargetBurningMaterial()) + "/" - + m.getTargetBurningAmount(), - identity(m.getTargetCrushingMaterial()) + "=" + m.getTargetCrushingAmount(), - identity(m.getTargetSmeltingMaterial()) + "=" + m.getTargetSmeltingAmount(), - identity(m.getTargetPulverMaterial()) + "=" + m.getTargetPulverAmount(), - m.getByProducts().stream() - .map(MaterialBaselineSnapshot::identity) - .collect(Collectors.joining(",")), - Long.toString(m.getCompositionDivider()), - components(m.getCompositionComponents(), true), - m.getAliasesToThis().stream() - .map(MaterialBaselineSnapshot::identity) - .sorted() - .collect(Collectors.joining(",")), - MaterialForms.of(m).stream().sorted().collect(Collectors.joining(","))); - }) - .sorted() - .toList(); - } - - public static List prefixes() { - return gregtech.engine.prefix.PrefixRegistry.all().stream() - .map(p -> p.getName() + "\t" + p.getMaterialWeight()) - .sorted() - .toList(); - } - - @SuppressWarnings("unchecked") - private static List aliases() throws Exception { - var field = GTMaterialRegistry.class.getDeclaredField("BY_NAME"); - field.setAccessible(true); - var names = (java.util.Map) field.get(null); - return names.entrySet().stream() - .map(entry -> entry.getKey() + "\t" + identity(entry.getValue().resolve())) - .sorted() - .toList(); - } - - /** Launched by JUnit in independent JVMs, without adding a production reset hook. */ - public static void main(String[] args) throws Exception { - ModData.bindPresence(id -> false); - if (args.length > 1) { - try (var loader = new java.net.URLClassLoader( - new java.net.URL[] {Path.of(args[1]).toUri().toURL()}, - MaterialBaselineSnapshot.class.getClassLoader())) { - AddonMaterials.collectContributors(loader); - } - } - GTMaterialRegistry.init(); - GTMaterialRegistry.postInit(); - Path output = Path.of(args[0]); - Files.createDirectories(output); - write(output.resolve("materials.tsv"), materials(GTMaterialRegistry.allMaterials())); - write(output.resolve("prefixes.tsv"), prefixes()); - write(output.resolve("aliases.tsv"), aliases()); - write( - output.resolve("references.tsv"), - MaterialReferenceAudit.collect().stream() - .map(MaterialReferenceAudit::describe) - .sorted() - .toList()); - } - - static void write(Path path, List rows) throws IOException { - Files.write(path, rows); - } -} diff --git a/core/src/test/java/gregtech/content/material/MaterialBaselineTest.java b/core/src/test/java/gregtech/content/material/MaterialBaselineTest.java deleted file mode 100644 index cc224b5e4..000000000 --- a/core/src/test/java/gregtech/content/material/MaterialBaselineTest.java +++ /dev/null @@ -1,301 +0,0 @@ -package gregtech.content.material; - -import static org.junit.jupiter.api.Assertions.*; - -import gregtech.api.material.GTMaterial; -import gregtech.api.material.GTValues; -import gregtech.api.material.MaterialComponent; -import gregtech.content.data.MaterialPrefix; -import gregtech.content.recipe.MaterialRecoveryRules; -import gregtech.engine.material.GTMaterialRegistry; -import gregtech.engine.material.ItemComposition; -import gregtech.engine.material.ItemCompositionSource; -import gregtech.engine.material.VanillaUnificationDefinitions; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -class MaterialBaselineTest { - @BeforeAll - static void init() { - MaterialTestFixture.ensureInitialized(); - } - - @Test - void cleanJvmSnapshotsAreRepeatableAndSpiIsIsolated() throws Exception { - Path output = MaterialReferenceAudit.root().resolve("work/material-system-refactor/core"); - runSnapshot(output.resolve("first"), null); - runSnapshot(output.resolve("second"), null); - for (String file : List.of("materials.tsv", "prefixes.tsv", "aliases.tsv", "references.tsv")) - assertEquals( - Files.readString(output.resolve("first/" + file)), - Files.readString(output.resolve("second/" + file)), - file); - Path spi = output.resolve("spi"); - Path service = spi.resolve("META-INF/services/gregtech.api.addon.material.AddonMaterialContributor"); - Files.createDirectories(service.getParent()); - Files.writeString(service, MaterialBaselineTestAddon.class.getName() + "\n"); - runSnapshot(output.resolve("addon"), spi); - var addon = Files.readAllLines(output.resolve("addon/materials.tsv")); - var base = Files.readAllLines(output.resolve("first/materials.tsv")); - assertTrue(base.stream().noneMatch(line -> line.contains("BaselineCompound"))); - String row = addon.stream() - .filter(line -> line.startsWith("material_baseline_test:BaselineCompound\t")) - .findFirst() - .orElseThrow(); - assertTrue(row.contains("\tdynamic\ttrue\ttrue\t"), row); - assertTrue(row.contains("CENTRIFUGE"), row); - assertTrue(row.contains("core:Iron=" + GTValues.U * 2 + ",core:Copper=" + GTValues.U), row); - assertEquals( - base, - addon.stream() - .filter(line -> !line.startsWith("material_baseline_test:")) - .toList()); - } - - private static void runSnapshot(Path output, Path spi) throws Exception { - Files.createDirectories(output); - var classpath = new ArrayList(); - for (Class type : List.of(MaterialBaselineSnapshot.class, GTMaterialRegistry.class, GTMaterial.class)) - classpath.add(Path.of(type.getProtectionDomain() - .getCodeSource() - .getLocation() - .toURI()) - .toString()); - classpath.add(Path.of(MaterialBaselineTest.class - .getResource("/gregtech/material-reference-history.tsv") - .toURI()) - .getParent() - .getParent() - .toString()); - var command = new ArrayList<>(List.of( - Path.of(System.getProperty("java.home"), "bin/java").toString(), - "-cp", - String.join(File.pathSeparator, classpath), - MaterialBaselineSnapshot.class.getName(), - output.toString())); - if (spi != null) command.add(spi.toString()); - var process = new ProcessBuilder(command) - .directory(MaterialReferenceAudit.root().toFile()) - .redirectErrorStream(true) - .redirectOutput(output.resolve("startup.log").toFile()) - .start(); - boolean finished = process.waitFor(45, TimeUnit.SECONDS); - if (!finished) process.destroyForcibly(); - assertTrue(finished, "snapshot JVM timed out: " + output); - assertEquals(0, process.exitValue(), () -> "snapshot JVM failed; see " + output.resolve("startup.log")); - } - - @Test - void componentNormalizationKeepsThePrimaryAndSemanticOrder() { - var iron = MaterialComponent.of(Materials.Iron, GTValues.U); - var copper = MaterialComponent.of(Materials.Copper, GTValues.U * 2); - assertEquals( - MaterialBaselineSnapshot.components(List.of(iron, copper), false), - MaterialBaselineSnapshot.components(List.of(copper, iron), false)); - assertNotEquals( - MaterialBaselineSnapshot.components(List.of(iron, copper), true), - MaterialBaselineSnapshot.components(List.of(copper, iron), true)); - var composition = - new ItemComposition(null, List.of(iron, copper), Materials.Iron, "normalization fixture", true); - assertSame(Materials.Iron, composition.material()); - assertThrows( - IllegalArgumentException.class, - () -> new ItemComposition( - null, List.of(MaterialComponent.of(Materials.Iron, -1)), "invalid fixture", true)); - var reversed = new ArrayList<>(GTMaterialRegistry.allMaterials()); - java.util.Collections.reverse(reversed); - assertEquals( - MaterialBaselineSnapshot.materials(GTMaterialRegistry.allMaterials()), - MaterialBaselineSnapshot.materials(reversed)); - for (var material : GTMaterialRegistry.allMaterials()) { - if (!material.resolve().isValid()) continue; - for (var part : material.getCompositionComponents()) { - assertTrue(part.material().resolve().isValid(), material.getName() + " component identity"); - assertTrue(part.amount() > 0, material.getName() + " component amount"); - } - if (material.hasComposition()) assertTrue(material.getCompositionDivider() > 0, material.getName()); - } - } - - @Test - void referencesAreClassifiedAndNewInvalidReferencesFailWithContext() throws Exception { - var rows = MaterialReferenceAudit.collect().stream() - .map(MaterialReferenceAudit::describe) - .sorted() - .toList(); - Path output = MaterialReferenceAudit.root().resolve("work/material-system-refactor/core"); - Files.createDirectories(output); - Files.write(output.resolve("reference-audit.tsv"), rows); - var failures = rows.stream() - .filter(row -> row.endsWith("\tDANGLING") || row.endsWith("\tID_NAME_MISMATCH")) - .toList(); - try (var stream = getClass().getResourceAsStream("/gregtech/material-reference-history.tsv")) { - assertNotNull(stream); - var seen = new java.util.HashSet(); - for (String line : new String(stream.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8) - .lines() - .toList()) { - if (line.isBlank() || line.startsWith("#")) continue; - var cells = line.split("\t", -1); - String key = String.join("\t", java.util.Arrays.copyOf(cells, 5)); - assertTrue(seen.add(key), "duplicate historical reference: " + key); - assertTrue(rows.contains(key + "\t" + cells[5]), "stale historical classification: " + line); - } - } - assertTrue( - failures.isEmpty(), - () -> "Invalid material references: " + failures + "; see " + output.resolve("reference-audit.tsv")); - var missing = new MaterialReferenceAudit.Reference( - "composition", "Iron", "component[0]", "BaselineMissingMaterial", 0); - var error = assertThrows(IllegalArgumentException.class, () -> MaterialReferenceAudit.requireValid(missing)); - assertTrue(error.getMessage().contains("composition\tIron\tcomponent[0]\tBaselineMissingMaterial")); - assertThrows( - IllegalArgumentException.class, - () -> MaterialReferenceAudit.requireValid(new MaterialReferenceAudit.Reference( - "decomposition", "Iron", "owner", "Copper", Materials.Iron.getId()))); - } - - @Test - void auditedParityExpectationsRemainSeparateFromObservedDifferences() { - // MT.Fe / MT.Cu and the explicit GT6CE Graphite decision are correctness expectations. - assertSame(GTMaterialRegistry.get("Fe"), GTMaterialRegistry.get(260)); - assertSame(GTMaterialRegistry.get("Cu"), GTMaterialRegistry.get(290)); - var graphite = GTMaterialRegistry.get("Graphite"); - assertEquals(GTValues.U, graphite.getTargetSmeltingAmount()); - assertSame(GTMaterialRegistry.get("C"), graphite.getTargetSmeltingMaterial()); - var plan = MaterialRecoveryRules.dustPlan(72 * GTValues.U); - assertTrue(plan.complete()); - assertEquals(72 * GTValues.U, plan.representedUnits()); - assertEquals(0, plan.remainderUnits()); - assertEquals(2, plan.stackCount()); - assertEquals( - List.of( - new MaterialRecoveryRules.DustPile(MaterialPrefix.dust, 64), - new MaterialRecoveryRules.DustPile(MaterialPrefix.dust, 8)), - plan.piles()); - var slot = MaterialRecoveryRules.dustSlotPlan(72 * GTValues.U); - assertFalse(slot.complete()); - assertEquals(64 * GTValues.U, slot.representedUnits()); - assertEquals(8 * GTValues.U, slot.remainderUnits()); - assertEquals(List.of(new MaterialRecoveryRules.DustPile(MaterialPrefix.dust, 64)), slot.piles()); - var eighth = MaterialRecoveryRules.dustSlotPlan(9 * GTValues.U72); - assertTrue(eighth.complete()); - assertEquals(9 * GTValues.U72, eighth.representedUnits()); - assertEquals(List.of(new MaterialRecoveryRules.DustPile(MaterialPrefix.dustDiv72, 9)), eighth.piles()); - - var composition = new ItemComposition( - null, - List.of(MaterialComponent.of(Materials.Gold, 72 * GTValues.U)), - Materials.Gold, - List.of(new ItemCompositionSource( - ItemCompositionSource.Kind.EXPLICIT, "recovery-test", "test", "", "")), - true); - var shredder = MaterialRecoveryRules.planShredder(composition, 4); - assertTrue(shredder.accepted()); - assertEquals(2, shredder.stackCount()); - assertEquals( - MaterialRecoveryRules.shredderWork(Materials.Gold), - MaterialRecoveryRules.planShredderDamaged( - new ItemComposition( - null, - List.of(MaterialComponent.of(Materials.Gold, GTValues.U)), - Materials.Gold, - List.of(new ItemCompositionSource( - ItemCompositionSource.Kind.EXPLICIT, - "damaged-dynamic-work", - "test", - "", - "")), - true), - 4, - false) - .duration()); - assertEquals( - MaterialRecoveryRules.staticShredderWork(Materials.Gold), - MaterialRecoveryRules.planShredderDamaged( - new ItemComposition( - null, - List.of(MaterialComponent.of(Materials.Gold, GTValues.U)), - Materials.Gold, - List.of(new ItemCompositionSource( - ItemCompositionSource.Kind.EXPLICIT, - "damaged-static-work", - "test", - "", - "")), - true), - 4, - true) - .duration()); - assertEquals( - MaterialRecoveryRules.ShredderRejection.OUTPUT_LIMIT, - MaterialRecoveryRules.planShredder(composition, 1).rejection()); - var subFraction = new ItemComposition( - null, - List.of(MaterialComponent.of(Materials.Gold, 1)), - Materials.Gold, - List.of(new ItemCompositionSource( - ItemCompositionSource.Kind.EXPLICIT, "recovery-remainder-test", "test", "", "")), - true); - assertEquals( - MaterialRecoveryRules.ShredderRejection.UNREPRESENTABLE_AMOUNT, - MaterialRecoveryRules.planShredder(subFraction, 4).rejection()); - var damagedFraction = new ItemComposition( - null, - List.of(MaterialComponent.of(Materials.Gold, GTValues.U * 24 / 25)), - Materials.Gold, - List.of(new ItemCompositionSource( - ItemCompositionSource.Kind.EXPLICIT, "damaged-remainder-test", "test", "", "")), - true); - assertEquals( - MaterialRecoveryRules.ShredderRejection.UNREPRESENTABLE_AMOUNT, - MaterialRecoveryRules.planShredder(damagedFraction, 4).rejection()); - var damagedPlan = MaterialRecoveryRules.planShredderDamaged(damagedFraction, 4, false); - assertTrue(damagedPlan.accepted()); - assertTrue(damagedPlan.outputs().get(0).dust().remainderUnits() > 0); - assertTrue(damagedPlan.skippedComponents().stream() - .anyMatch(component -> - component.reason() == MaterialRecoveryRules.ShredderRejection.UNREPRESENTABLE_AMOUNT)); - } - - @Test - void shredderProfilesKeepStaticAndDynamicMultipliersSeparate() { - assertEquals( - 256L * Math.max(1, Materials.NetherStar.getToolQuality() + 1), - MaterialRecoveryRules.staticShredderWork(Materials.NetherStar)); - assertEquals( - 16L * Math.max(1, Materials.Rubber.getToolQuality() + 1), - MaterialRecoveryRules.staticShredderWork(Materials.Rubber)); - assertEquals( - 64L * Math.max(1, Materials.Firestone.getToolQuality() + 1), - MaterialRecoveryRules.shredderWork(Materials.Firestone)); - assertEquals( - 2L * Math.max(1, Materials.Rubber.getToolQuality() + 1), - MaterialRecoveryRules.shredderWork(Materials.Rubber)); - assertEquals( - 2L * Math.max(1, Materials.MeatRotten.getToolQuality() + 1), - MaterialRecoveryRules.shredderWork(Materials.MeatRotten)); - } - - @Test - void recoveryOreClassificationKeepsRawItemsAndBlocksDistinct() { - assertSame( - VanillaUnificationDefinitions.OreInputKind.ORE, - VanillaUnificationDefinitions.oreInputKind("copper_ore")); - assertSame( - VanillaUnificationDefinitions.OreInputKind.RAW_METAL, - VanillaUnificationDefinitions.oreInputKind("raw_iron")); - assertSame( - VanillaUnificationDefinitions.OreInputKind.RAW_METAL_BLOCK, - VanillaUnificationDefinitions.oreInputKind("raw_iron_block")); - assertSame( - VanillaUnificationDefinitions.OreInputKind.OTHER, - VanillaUnificationDefinitions.oreInputKind("iron_ingot")); - } -} diff --git a/core/src/test/java/gregtech/content/material/MaterialBaselineTestAddon.java b/core/src/test/java/gregtech/content/material/MaterialBaselineTestAddon.java deleted file mode 100644 index 9f2781965..000000000 --- a/core/src/test/java/gregtech/content/material/MaterialBaselineTestAddon.java +++ /dev/null @@ -1,39 +0,0 @@ -package gregtech.content.material; - -import gregtech.api.addon.material.*; -import gregtech.api.material.GTValues; -import java.util.List; -import java.util.Set; - -/** Loaded only by the isolated SPI test, never by the ordinary material fixture or a release jar. */ -public final class MaterialBaselineTestAddon implements AddonMaterialContributor { - @Override - public String addonId() { - return "material_baseline_test"; - } - - @Override - public List materials() { - return List.of(MaterialDeclaration.builder("BaselineCompound").dust().build()); - } - - @Override - public void materialInfo(MaterialInfoTool.Registrar registrar) { - registrar.registerProcess( - new MaterialKey("BaselineCompound"), - MaterialProcessKeys.DECOMPOSITION, - MaterialProcessRule.anyForm(new MaterialDecompositionRule( - Set.of(MaterialDecompositionRule.Route.CENTRIFUGE), List.of(), false))); - } - - @Override - public List compositions() { - return List.of(new MaterialComposition( - "BaselineCompound", - 3, - List.of( - new MaterialComposition.Part("Iron", GTValues.U * 2), - new MaterialComposition.Part("Copper", GTValues.U)), - false)); - } -} diff --git a/core/src/test/java/gregtech/content/material/MaterialCatalogTest.java b/core/src/test/java/gregtech/content/material/MaterialCatalogTest.java index 94d70ddfe..284b5ada2 100644 --- a/core/src/test/java/gregtech/content/material/MaterialCatalogTest.java +++ b/core/src/test/java/gregtech/content/material/MaterialCatalogTest.java @@ -1,32 +1,169 @@ package gregtech.content.material; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertSame; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; +import gregtech.api.addon.material.GregTechMaterials; +import gregtech.api.addon.material.MaterialKey; import gregtech.content.fluid.FluidDefinitions; -import gregtech.content.recipe.SourceRecyclingFacts; -import gregtech.content.recipe.SourceWaxMaterials; import gregtech.content.storage.ItemBarrelCatalog; import gregtech.content.tool.AnvilVariantCatalog; import gregtech.engine.material.GTMaterialRegistry; import org.junit.jupiter.api.Test; class MaterialCatalogTest { + @Test + void reviewedRecipeFactsAreFullyProjectedIntoMaterialDeclarations() { + var declarations = MaterialDefinitions.declarations(); + assertEquals(198, processCount(declarations, MaterialFactKeys.SOURCE_FURNACE)); + assertEquals(2, processCount(declarations, MaterialFactKeys.SOURCE_GRADED_GEM)); + assertEquals(39, processCount(declarations, MaterialFactKeys.SOURCE_ORE_INPUT)); + assertEquals(1, processCount(declarations, MaterialFactKeys.SOURCE_SIFTING_EXCLUSIONS)); + assertEquals(9, processCount(declarations, MaterialFactKeys.SOURCE_CRUSHED_EXCLUSIONS)); + assertEquals(11, processCount(declarations, MaterialFactKeys.SOURCE_ORE_SHREDDER)); + assertEquals(670, processCount(declarations, MaterialFactKeys.SOURCE_MACERATION)); + assertEquals(142, processCount(declarations, MaterialFactKeys.SOURCE_WASHING)); + assertEquals(51, processCount(declarations, MaterialFactKeys.MATERIAL_FLUID_UNIT)); + assertEquals(134, processCount(declarations, MaterialFactKeys.GENERIFICATION_TARGET)); + assertEquals(733, processCount(declarations, MaterialFactKeys.SOURCE_EXTRUSION)); + // Four additional source lens roles belong to absent optional Hexorium materials. + assertEquals(53, processCount(declarations, MaterialFactKeys.SOURCE_LENS_ROLE)); + assertEquals(1, processCount(declarations, MaterialFactKeys.SOURCE_CINNABAR_FOLLOWON)); + assertEquals(3, processCount(declarations, MaterialFactKeys.SOURCE_GENERATED_FLUID)); + assertEquals(672, processCount(declarations, MaterialFactKeys.SOURCE_RECYCLING)); + assertEquals(15, processCount(declarations, MaterialFactKeys.SOURCE_MOLTEN_FLUID)); + assertEquals(672, processCount(declarations, MaterialFactKeys.SOURCE_ORE_CRUSHING)); + assertEquals(6, processCount(declarations, MaterialFactKeys.SOURCE_PURIFIED_CENTRIFUGE_PHASE)); + assertEquals(7, processCount(declarations, MaterialFactKeys.SOURCE_PURIFIED_CENTRIFUGE_NO_DEFAULT)); + assertEquals(2, processCount(declarations, MaterialFactKeys.SOURCE_ADDITIONAL_WIRE_FAMILY)); + assertEquals(1, processCount(declarations, MaterialFactKeys.COMPRESSOR_DUST_TO_GEM_PLATE)); + assertEquals(14, processCount(declarations, gregtech.content.recipe.SpecialProcessMethods.AQUA_REGIA_LEACHING)); + assertTrue(processCount( + declarations, + gregtech.content.recipe.SpecialProcessMethods.HYDROCHLORIC_ACID_MANGANESE_LEACHING) + > 1); + } + @Test void standaloneMaterialsAndDeviceCatalogsResolveWithoutLegacyMods() { MaterialTestFixture.ensureInitialized(); FluidDefinitions.prepare(); verifyCanonicalFluids(); verifyAlloyMeltingAndMoltenTemperature(); - // Building the thermal facts also verifies every phase binding and target has an identity. - assertTrue(!SourceRecyclingFacts.all().isEmpty()); - assertNotNull(SourceRecyclingFacts.find(260, "Iron")); - assertNotNull(SourceRecyclingFacts.find(790, "Gold")); - assertNull(SourceRecyclingFacts.find(1850, "Abyssalnite")); - assertNull(SourceRecyclingFacts.find(8703, "Manyullyn")); + var processes = GregTechMaterials.processes(); + // The material process payload verifies every source phase binding and target identity. + assertTrue(processes + .findSingle(new MaterialKey("Iron"), MaterialFactKeys.SOURCE_RECYCLING) + .isPresent()); + assertTrue(processes + .findSingle(new MaterialKey("Gold"), MaterialFactKeys.SOURCE_RECYCLING) + .isPresent()); + assertTrue(processes + .findSingle(new MaterialKey("Abyssalnite"), MaterialFactKeys.SOURCE_RECYCLING) + .isEmpty()); + assertTrue(processes + .findSingle(new MaterialKey("Manyullyn"), MaterialFactKeys.SOURCE_RECYCLING) + .isEmpty()); + assertFalse(processes + .findSingle(new MaterialKey("Water"), MaterialFactKeys.SOURCE_RECYCLING) + .orElseThrow() + .value() + .inputEligible()); + assertTrue(processes + .findSingle(new MaterialKey("Iron"), MaterialFactKeys.SOURCE_EXTRUSION) + .isPresent()); + var aquaRegia = processes + .findSingle(new MaterialKey("AquaRegia"), MaterialFactKeys.MATERIAL_FLUID_UNIT) + .orElseThrow() + .value(); + assertTrue(GregTechMaterials.catalog() + .specialProcesses() + .find(new gregtech.api.addon.material.DataKey("gt6ce", "special_process/aqua_regia_leaching")) + .isPresent()); + assertTrue( + processes + .find( + new MaterialKey("Gold"), + gregtech.content.recipe.SpecialProcessMethods.AQUA_REGIA_LEACHING) + .stream() + .anyMatch(rule -> + rule.value() instanceof gregtech.api.addon.material.SpecialProcessValue.Target)); + assertTrue( + processes + .find( + new MaterialKey("AquaRegia"), + gregtech.content.recipe.SpecialProcessMethods.AQUA_REGIA_LEACHING) + .stream() + .anyMatch(rule -> + rule.value() instanceof gregtech.api.addon.material.SpecialProcessValue.Reagent)); + assertTrue(aquaRegia.units().stream() + .anyMatch(unit -> unit.phase().equals("liquid") + && unit.fluidField().equals("GenLiquid_AquaRegia") + && unit.referenceMillibuckets() == 1000)); + for (var phase : gregtech.content.recipe.SpecialProcessData.Phase.values()) { + var units = processes + .findSingle(new MaterialKey(phase.material().name()), MaterialFactKeys.MATERIAL_FLUID_UNIT) + .orElseThrow(() -> new AssertionError("Missing acid fluid units: " + phase)) + .value() + .units(); + assertTrue( + units.stream() + .anyMatch(unit -> + unit.phase().equals(phase.state().name().toLowerCase(java.util.Locale.ROOT))), + phase.name()); + } + var titaniumFluid = processes + .findSingle(new MaterialKey("Titanium"), MaterialFactKeys.SOURCE_GENERATED_FLUID) + .orElseThrow() + .value() + .rules() + .stream() + .findFirst() + .orElseThrow(); + assertTrue(titaniumFluid.wholeDustMetal()); + assertEquals(4.54F, titaniumFluid.materialDensity()); + assertTrue(processes + .findSingle(new MaterialKey("Carbon14"), MaterialFactKeys.SOURCE_MOLTEN_FLUID) + .orElseThrow() + .value()); + var cinnabarRule = processes + .findSingle(new MaterialKey("Cinnabar"), MaterialFactKeys.SOURCE_CINNABAR_FOLLOWON) + .orElseThrow() + .value(); + assertEquals(9114, cinnabarRule.cinnabar().id()); + for (String byproduct : java.util.List.of("Redstone", "Sulfur", "Glowstone", "Selenium", "SluiceSand")) { + assertTrue(processes + .findSingle(new MaterialKey(byproduct), MaterialFactKeys.SOURCE_CINNABAR_FOLLOWON) + .isEmpty()); + } + assertTrue(GTMaterialRegistry.get("Iron").has(gregtech.api.material.MaterialProperty.MAGNETIC)); + assertEquals( + MaterialFactKeys.Decision.YES, + processes + .findSingle(new MaterialKey("Lithium6"), MaterialFactKeys.SOURCE_FURNACE) + .orElseThrow() + .value()); + assertEquals( + MaterialFactKeys.Decision.YES, + processes + .findSingle(new MaterialKey("HydratedCoal"), MaterialFactKeys.SOURCE_FURNACE) + .orElseThrow() + .value()); + assertTrue(processes + .findSingle(new MaterialKey("Netherite"), MaterialFactKeys.SOURCE_ADDITIONAL_WIRE_FAMILY) + .orElseThrow() + .value()); + assertTrue(processes + .findSingle(new MaterialKey("Naquadah"), MaterialFactKeys.SOURCE_ADDITIONAL_WIRE_FAMILY) + .orElseThrow() + .value()); + assertTrue(processes + .findSingle(new MaterialKey("Titanium"), MaterialFactKeys.SOURCE_ADDITIONAL_WIRE_FAMILY) + .isEmpty()); + assertTrue(processes + .findSingle(new MaterialKey("Ice"), MaterialFactKeys.SOURCE_SIFTING_EXCLUSIONS) + .orElseThrow() + .value() + .excludes("gemLegendary")); assertTrue(gregtech.content.energy.WireCatalog.specifications().stream() .anyMatch(wire -> wire.material() == Materials.Gold && wire.insulated() && wire.size() == 4)); for (int id : new int[] { @@ -45,7 +182,9 @@ void standaloneMaterialsAndDeviceCatalogsResolveWithoutLegacyMods() { assertEquals(8250 + i, dye.getId()); assertTrue(dye.getName().startsWith("Dye")); assertTrue(!GTMaterialRegistry.get(9500 + i).isValid()); - assertNotNull(SourceRecyclingFacts.find(dye.getId(), dye.getName())); + assertTrue(processes + .findSingle(new MaterialKey(dye.getName()), MaterialFactKeys.SOURCE_RECYCLING) + .isPresent()); } for (String retained : java.util.List.of( "Greatwood", @@ -62,13 +201,6 @@ void standaloneMaterialsAndDeviceCatalogsResolveWithoutLegacyMods() { for (int id : new int[] {1250, 8752, 9204, 9205, 9206, 9207, 9208, 9209}) assertTrue(GTMaterialRegistry.get(id).isValid(), "Restored Tritanium material " + id); assertSame(GTMaterialRegistry.get("Tn"), GTMaterialRegistry.get(1250), "Tn alias"); - var waxes = SourceWaxMaterials.materials(); - assertEquals( - java.util.List.of(8235, 8236, 8238, 8239), - waxes.stream().map(material -> material.getId()).toList()); - assertEquals( - java.util.List.of("Wax", "WaxBee", "WaxParaffin", "WaxPlant"), - waxes.stream().map(material -> material.getName()).toList()); for (String name : new String[] { "Iron", "Amethyst", @@ -201,4 +333,12 @@ void netherBedrockOresKeepOnlyTheRetainedMaterials() { assertTrue(!GTMaterialRegistry.get(8456).isValid()); assertTrue(!GTMaterialRegistry.get(8457).isValid()); } + + private static long processCount( + java.util.List declarations, + gregtech.api.addon.material.MaterialProcessKey key) { + return declarations.stream() + .filter(declaration -> !declaration.info().processes().find(key).isEmpty()) + .count(); + } } diff --git a/core/src/test/java/gregtech/content/material/MaterialReferenceAudit.java b/core/src/test/java/gregtech/content/material/MaterialReferenceAudit.java deleted file mode 100644 index 6a25a1e11..000000000 --- a/core/src/test/java/gregtech/content/material/MaterialReferenceAudit.java +++ /dev/null @@ -1,186 +0,0 @@ -package gregtech.content.material; - -import gregtech.api.addon.material.MaterialProcessKeys; -import gregtech.api.addon.material.MaterialTarget; -import gregtech.api.material.GTMaterial; -import gregtech.content.data.generated.MaterialForms; -import gregtech.engine.material.GTMaterialRegistry; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - -/** Audits the committed inputs as well as the live graph, so silently skipped rows remain visible. */ -final class MaterialReferenceAudit { - record Reference(String table, String owner, String field, String name, int id) {} - - enum Kind { - VALID, - ALIAS, - RETIRED, - DANGLING, - ID_NAME_MISMATCH - } - - private MaterialReferenceAudit() {} - - static Path root() { - Path here = Path.of("").toAbsolutePath(); - return Files.isDirectory(here.resolve("core")) ? here : here.getParent(); - } - - static String input(String name) throws Exception { - return Files.readString(root().resolve("core/src/main/java/gregtech/content/data/generated/" + name + ".java")); - } - - static List collect() throws Exception { - var refs = new ArrayList(); - // The retired import is test-only historical input, never fed to runtime link resolution. - try (var stream = - MaterialReferenceAudit.class.getResourceAsStream("/gregtech/material-import-references.tsv")) { - if (stream == null) throw new IllegalStateException("Missing historical import audit"); - for (String line : new String(stream.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8) - .lines() - .toList()) { - if (line.isBlank() || line.startsWith("#")) continue; - var cells = line.split("\t", -1); - if (cells.length != 6) throw new IllegalStateException("Invalid historical reference: " + line); - refs.add(new Reference(cells[0], cells[1], cells[2], cells[3], Integer.parseInt(cells[4]))); - } - } - for (var declaration : MaterialDefinitions.declarations()) { - var definition = declaration.material(); - var info = declaration.info(); - if (definition.id() > 0) - refs.add(new Reference("catalog", definition.name(), "owner", definition.name(), definition.id())); - int slot = 0; - for (var part : info.composition().parts()) - refs.add(new Reference("catalog", definition.name(), "component[" + slot++ + "]", part.material(), 0)); - var byproducts = info.processes().find(MaterialProcessKeys.ORE_PROCESSING); - if (!byproducts.isEmpty()) - for (var target : byproducts.get(0).value().byproducts()) - refs.add(new Reference("catalog", definition.name(), "byproduct", target.name(), 0)); - var fuel = info.processes().find(MaterialProcessKeys.FUEL); - for (var target : new MaterialTarget[] { - fuel.isEmpty() ? null : fuel.get(0).value().residue().orElse(null), - first(info, MaterialProcessKeys.CRUSHING), - first(info, MaterialProcessKeys.SMELTING), - first(info, MaterialProcessKeys.PULVERIZING) - }) - if (target != null) - refs.add(new Reference( - "catalog", - definition.name(), - "target", - target.material().name(), - 0)); - for (var target : processing(info).values()) - refs.add(new Reference( - "catalog", - definition.name(), - "processing", - target.material().name(), - 0)); - for (String target : info.relations().members()) - refs.add(new Reference("catalog", definition.name(), "member", target, 0)); - } - return refs; - } - - private static T first( - gregtech.engine.material.MaterialInfoDefinition info, - gregtech.api.addon.material.MaterialProcessKey key) { - var rules = info.processes().find(key); - return rules.isEmpty() ? null : rules.get(0).value(); - } - - private static Map processing(gregtech.engine.material.MaterialInfoDefinition info) { - var result = new HashMap(); - for (var entry : info.processes().rules().entrySet()) { - var kind = MaterialProcessKeys.legacyTargetName(entry.getKey()).orElse(null); - if (kind != null - && !entry.getValue().isEmpty() - && entry.getValue().get(0).value() instanceof MaterialTarget target) result.put(kind, target); - } - return result; - } - - static Map retired() throws Exception { - var result = new HashMap(); - String doc = Files.readString(root().resolve("docs/decisions/parity/material-removal.md")); - var names = Pattern.compile("`([^`]+)`\\((\\d+)").matcher(doc); - while (names.find()) { - result.put(names.group(1), names.group(2)); - result.put(names.group(2), names.group(1)); - result.put(MaterialForms.normalize(names.group(1)), names.group(2)); - } - return result; - } - - static Kind classify(Reference ref) throws Exception { - if (ref.table().equals("decomposition") && ref.id() <= 0) return Kind.ID_NAME_MISMATCH; - GTMaterial byName = GTMaterialRegistry.get(ref.name()); - GTMaterial byId = GTMaterialRegistry.get(ref.id()); - if (ref.id() > 0) { - if (byId.isValid()) { - if (!ref.name().isEmpty() && (!byName.isValid() || byName.resolve() != byId.resolve())) - return Kind.ID_NAME_MISMATCH; - return Kind.VALID; - } - if (ref.table().equals("catalog") && MaterialDefinitions.find(ref.name()) != null) return Kind.VALID; - if (byName.isValid()) return Kind.ID_NAME_MISMATCH; - var retired = retired(); - if (!retired.containsKey(Integer.toString(ref.id()))) return Kind.DANGLING; - return ref.name().isEmpty() || Integer.toString(ref.id()).equals(retired.get(ref.name())) - ? Kind.RETIRED - : Kind.ID_NAME_MISMATCH; - } - if (ref.table().equals("catalog") && MaterialDefinitions.find(ref.name()) != null) return Kind.VALID; - if (byName.isValid()) return byName.getName().equals(ref.name()) ? Kind.VALID : Kind.ALIAS; - if (ref.table().equals("forms")) { - for (var entry : GTMaterialRegistry.registeredNames().entrySet()) - if (MaterialForms.normalize(entry.getKey()).equals(ref.name()) - && entry.getValue().isValid()) return Kind.ALIAS; - long candidates = GTMaterialRegistry.allMaterials().stream() - .map(GTMaterial::resolve) - .distinct() - .filter(m -> MaterialForms.normalize(m.getName()).equals(ref.name())) - .count(); - if (candidates == 1) return Kind.ALIAS; - } - // Each historical exception is tied to one table/owner/field/target, with a reviewed source. - // It cannot admit a new occurrence of that name elsewhere. - try (var stream = - MaterialReferenceAudit.class.getResourceAsStream("/gregtech/material-reference-history.tsv")) { - if (stream == null) throw new IllegalStateException("Missing material reference history"); - String key = ref.table() + "\t" + ref.owner() + "\t" + ref.field() + "\t" + ref.name() + "\t" + ref.id(); - for (String line : new String(stream.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8) - .lines() - .toList()) { - if (line.startsWith("#") || line.isBlank()) continue; - String[] cells = line.split("\t", -1); - if (cells.length != 7 || !cells[5].equals("RETIRED") || cells[6].isBlank()) - throw new IllegalStateException("Invalid reference history: " + line); - if (line.startsWith(key + "\t")) return Kind.valueOf(cells[5]); - } - } - return retired().containsKey(ref.name()) ? Kind.RETIRED : Kind.DANGLING; - } - - static String describe(Reference ref) { - try { - return ref.table() + "\t" + ref.owner() + "\t" + ref.field() + "\t" + ref.name() + "\t" + ref.id() + "\t" - + classify(ref); - } catch (Exception failure) { - throw new IllegalStateException(failure); - } - } - - static void requireValid(Reference ref) throws Exception { - Kind kind = classify(ref); - if (kind == Kind.DANGLING || kind == Kind.ID_NAME_MISMATCH) throw new IllegalArgumentException(describe(ref)); - } -} diff --git a/core/src/test/java/gregtech/content/worldgen/StoneLayerScanTest.java b/core/src/test/java/gregtech/content/worldgen/StoneLayerScanTest.java index 0e6dc71ab..b959e879f 100644 --- a/core/src/test/java/gregtech/content/worldgen/StoneLayerScanTest.java +++ b/core/src/test/java/gregtech/content/worldgen/StoneLayerScanTest.java @@ -1,9 +1,6 @@ package gregtech.content.worldgen; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertSame; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gregtech/content/worldgen/SurfaceRockRulesTest.java b/core/src/test/java/gregtech/content/worldgen/SurfaceRockRulesTest.java index 8c932b092..feb41d3ca 100644 --- a/core/src/test/java/gregtech/content/worldgen/SurfaceRockRulesTest.java +++ b/core/src/test/java/gregtech/content/worldgen/SurfaceRockRulesTest.java @@ -1,9 +1,6 @@ package gregtech.content.worldgen; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; import java.util.function.UnaryOperator; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gregtech/engine/energy/BatteryBoxStateTest.java b/core/src/test/java/gregtech/engine/energy/BatteryBoxStateTest.java index 7b8538472..995f26ee5 100644 --- a/core/src/test/java/gregtech/engine/energy/BatteryBoxStateTest.java +++ b/core/src/test/java/gregtech/engine/energy/BatteryBoxStateTest.java @@ -1,6 +1,7 @@ package gregtech.engine.energy; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/gregtech/engine/material/MaterialLifecycleProbe.java b/core/src/test/java/gregtech/engine/material/MaterialLifecycleProbe.java deleted file mode 100644 index 369fc80f3..000000000 --- a/core/src/test/java/gregtech/engine/material/MaterialLifecycleProbe.java +++ /dev/null @@ -1,407 +0,0 @@ -package gregtech.engine.material; - -import gregtech.api.addon.material.*; -import gregtech.api.material.*; -import gregtech.api.mod.ModData; -import gregtech.content.material.MaterialDefinitions; -import gregtech.content.material.Materials; -import gregtech.engine.addon.AddonCoreServices; -import gregtech.engine.addon.AddonMaterials; -import java.util.List; - -/** Independent lifecycle fixture; intentionally has no dependency on the JUnit runtime. */ -public final class MaterialLifecycleProbe { - private MaterialLifecycleProbe() {} - - private static void check(boolean value) { - if (!value) throw new AssertionError("Lifecycle assertion failed"); - } - - private static RuntimeException rejects(Runnable operation) { - try { - operation.run(); - } catch (RuntimeException failure) { - return failure; - } - throw new AssertionError("Expected operation to fail"); - } - - public static void main(String[] args) throws Exception { - ModData.bindPresence(id -> false); - AddonCoreServices.bind(); - String scenario = args[0]; - check(!MaterialDefinitions.all().isEmpty()); - check(GTMaterialRegistry.allMaterials().size() == 2); - rejects(MaterialViews::catalog); - if (scenario.equals("early")) { - rejects(() -> GTMaterialRegistry.requireInstalled("Iron")); - rejects(() -> GTMaterialRegistry.createMaterial(260, "Iron", "Iron", 0)); - check(GTMaterialRegistry.allMaterials().size() == 2); - GTMaterialRegistry.init(); - check(GTMaterialRegistry.get("Iron").getId() == 260); - return; - } - if (scenario.equals("facade")) { - try { - Class.forName(Materials.class.getName()); - throw new AssertionError("Facade must require bootstrap"); - } catch (ExceptionInInitializerError expected) { - check(expected.getCause() instanceof IllegalStateException); - } - check(GTMaterialRegistry.allMaterials().size() == 2); - check(GTMaterialRegistry.registrationPhase() == GTMaterialRegistry.RegistrationPhase.DEFINITIONS); - return; - } - if (scenario.startsWith("metadata") - || scenario.startsWith("relation") - || scenario.startsWith("process") - || scenario.startsWith("info")) { - System.setProperty("material.metadata.scenario", scenario); - var spi = java.nio.file.Files.createTempDirectory("gt6ce-material-metadata-"); - var service = spi.resolve("META-INF/services/" + AddonMaterialContributor.class.getName()); - java.nio.file.Files.createDirectories(service.getParent()); - java.nio.file.Files.writeString(service, MaterialMetadataProbeContributor.class.getName()); - try (var loader = new java.net.URLClassLoader( - new java.net.URL[] {spi.toUri().toURL()}, MaterialLifecycleProbe.class.getClassLoader())) { - try { - AddonMaterials.collectContributors(loader); - } catch (IllegalStateException failure) { - if (scenario.equals("infoNamespaceFailure")) { - check(failure.getCause() instanceof IllegalArgumentException); - check(failure.getCause().getMessage().contains("cannot declare key")); - return; - } - if (scenario.equals("infoProcessSingleConflictFailure")) { - check(failure.getCause() instanceof IllegalArgumentException); - check(failure.getCause().getMessage().contains("already registered")); - return; - } - throw failure; - } - } - } - var shared = MaterialDefinition.builder(1, "SharedMaterial") - .density(2) - .dust() - .build(); - if (scenario.equals("merge") || scenario.equals("conflict")) { - AddonMaterials.submit("alpha_addon", List.of(shared), List.of(), () -> {}); - AddonMaterials.submit( - "beta_addon", - List.of( - scenario.equals("merge") - ? shared - : MaterialDefinition.builder(1, "SharedMaterial") - .density(3) - .dust() - .build()), - List.of(), - () -> {}); - } - if (scenario.equals("definitionFailure")) - AddonMaterials.submit( - "bad_addon", List.of(MaterialDefinition.builder(1, "Iron").build()), List.of(), () -> {}); - if (scenario.equals("linkFailure")) - AddonMaterials.submit( - "bad_addon", - List.of(), - List.of(), - () -> GTMaterialRegistry.registerAlias("Typo", "NoSuchMaterial")); - if (scenario.equals("normal")) - AddonMaterials.submit("legal_link", List.of(), List.of(), () -> { - check(Materials.Iron == GTMaterialRegistry.get(260)); - check(Materials.Coal.getFurnaceBurnTime() > 0); - check(Materials.Iron.has(MaterialProperty.NEVER_FURNACE)); - GTMaterialRegistry.registerAlias("LinkedIron", "Iron"); - rejects(MaterialViews::catalog); - rejects(() -> GTMaterialRegistry.createMaterial(9000, "Late", "Late", 0)); - }); - if (scenario.equals("aliasPublication")) - AddonMaterials.submit( - "alias_addon", - List.of( - MaterialDefinition.builder(1, "AliasSource").dust().build(), - MaterialDefinition.builder(1, "AliasTarget").dust().build()), - List.of(), - () -> GTMaterialRegistry.get("AliasSource").setRegistration(GTMaterialRegistry.get("AliasTarget"))); - if (scenario.endsWith("Failure") || scenario.equals("conflict")) { - var failure = rejects(GTMaterialRegistry::init); - check(GTMaterialRegistry.registrationPhase() == GTMaterialRegistry.RegistrationPhase.FAILED); - if (scenario.equals("conflict")) - check(failure.getMessage().contains("density") - && failure.getMessage().contains("alpha_addon") - && failure.getMessage().contains("beta_addon")); - if (scenario.equals("infoLegacyToolConflictFailure")) - check(failure.getMessage().contains("tool profile") - && failure.getMessage().contains("MetadataMaterial") - && failure.getMessage().contains("metadata_test")); - if (scenario.equals("processGroupMaterialFailure")) - check(failure.getMessage().contains("unknown material") - && failure.getMessage().contains("AnyIron")); - rejects(GTMaterialRegistry::init); - rejects(() -> GTMaterialRegistry.get("Iron")); - rejects(GTMaterialRegistry::allMaterials); - rejects(MaterialViews::catalog); - check(MaterialInfoTool.tool(new MaterialKey("Iron")).isEmpty()); - check(MaterialInfoTool.frozenTool(new MaterialKey("Iron")).isEmpty()); - check(MaterialInfoTool.composition(new MaterialKey("Iron")).isEmpty()); - check(MaterialInfoTool.currentTool(new MaterialKey("Iron")).isEmpty()); - check(MaterialInfoTool.currentComposition(new MaterialKey("Water")).isEmpty()); - check(MaterialInfoTool.currentProcess(new MaterialKey("Graphite"), MaterialProcessKeys.SMELTING) - .isEmpty()); - check(MaterialToolHelper.profile(new MaterialKey("Iron")).isEmpty()); - return; - } - GTMaterialRegistry.init(); - rejects(() -> Materials.Iron.setOreMultiplier(2)); - rejects(() -> Materials.Iron.setRegistration(Materials.Gold)); - var before = List.copyOf(GTMaterialRegistry.allMaterials()); - GTMaterialRegistry.init(); - GTMaterialRegistry.postInit(); - check(before.equals(List.copyOf(GTMaterialRegistry.allMaterials()))); - check(Materials.Trinium == GTMaterialRegistry.get(1260)); - check(GTMaterialRegistry.get("Ke") == Materials.Trinium); - check(GTMaterialRegistry.get("Tn") == GTMaterialRegistry.get("TritaniumElemental")); - check(GTMaterialRegistry.get("Gold") == GTMaterialRegistry.get(790)); - check(GTMaterialRegistry.get("Black") == GTMaterialRegistry.get(8250)); - check(GTMaterialRegistry.get("AntiElectron") == GTMaterialRegistry.get("Positron")); - check(GTMaterialRegistry.get("Iron") != GTMaterialRegistry.get("AntiIron")); - if (scenario.equals("aliasPublication")) { - var source = new MaterialKey("AliasSource"); - var target = new MaterialKey("AliasTarget"); - check(MaterialViews.catalog().resolve(source.name()).orElseThrow().equals(target)); - check(MaterialViews.catalog().find(source).isEmpty()); - check(MaterialViews.catalog().materials().stream() - .noneMatch(material -> material.key().equals(source))); - check(MaterialViews.catalog().find(target).isPresent()); - } - check(MaterialViews.catalog().find(new MaterialKey("AnyIron")).isEmpty()); - check(MaterialViews.catalog() - .find(new MaterialKey("Iron")) - .orElseThrow() - .property(MaterialProperties.MELTING_POINT) - .orElseThrow() - == Materials.Iron.getMeltingPoint()); - check(MaterialViews.catalog().find(new MaterialKey("UnknownMaterial")).isEmpty()); - rejects(() -> MaterialViews.catalog().materials().clear()); - rejects(() -> MaterialViews.catalog().forms().forms().clear()); - if (scenario.equals("normal") || scenario.equals("infoLegacy")) checkEffectiveQueries(); - if (scenario.equals("merge")) { - var material = GTMaterialRegistry.get("SharedMaterial"); - check(material.getId() >= GTMaterialRegistry.ADDON_ID_START); - check(AddonMaterials.owners(material).equals(List.of("alpha_addon", "beta_addon"))); - check(!GTMaterialRegistry.isCoreMaterial(material)); - } - check(MaterialViews.catalog().resolve("Fe").orElseThrow().equals(new MaterialKey("Iron"))); - var woodFamily = new DataKey("gt6ce", "wood_family"); - check(MaterialViews.catalog().tags().members(woodFamily).size() == 32); - check(!MaterialViews.catalog().tags().contains(new MaterialKey("PetrifiedWood"), woodFamily)); - var group = MaterialViews.catalog() - .tags() - .group(new MaterialGroupKey(new DataKey("gt6ce", "anyiron"))) - .orElseThrow(); - check(group.members().contains(new MaterialKey("Iron"))); - check(!MaterialViews.catalog().resolve("AnyIron").isPresent()); - check(MaterialViews.catalog().forms().allows(new MaterialKey("Graphite"), new FormKey("dust"))); - check(MaterialViews.catalog().forms().rules(new MaterialKey("Graphite")).stream() - .anyMatch(rule -> rule.form().equals(new FormKey("dust")) - && rule.kind() == MaterialFormKind.ITEM - && rule.materialUnits() > 0)); - check(MaterialViews.catalog().forms().rules(new MaterialKey("Iron")).stream() - .anyMatch(rule -> - rule.form().equals(new FormKey("blockIngot")) && rule.kind() == MaterialFormKind.BLOCK)); - check(MaterialViews.catalog() - .formBindings() - .find(new MaterialKey("Iron")) - .isEmpty()); - var graphiteSmelting = - MaterialViews.catalog().processes().find(new MaterialKey("Graphite"), MaterialProcessKeys.SMELTING); - check(graphiteSmelting.size() == 1); - check(graphiteSmelting.get(0).value().equals(new MaterialTarget(new MaterialKey("Carbon"), 648648000L))); - rejects(() -> graphiteSmelting.clear()); - if (scenario.equals("metadata")) { - check(MaterialViews.catalog() - .find(new MaterialKey("MetadataMaterial")) - .orElseThrow() - .property(new PropertyKey<>(new DataKey("metadata_test", "hardness"), Integer.class)) - .orElseThrow() - == 3); - check(MaterialViews.catalog() - .tags() - .contains(new MaterialKey("Iron"), new DataKey("metadata_test", "descriptive"))); - check(GTMaterialRegistry.get("MetadataMaterial") - .getProperties() - .equals(java.util.Set.of( - MaterialProperty.DUST, MaterialProperty.GENERATE_DUST, MaterialProperty.UNIT))); - } - if (scenario.equals("relations")) { - var iron = new MaterialKey("Iron"); - var leaf = new DataKey("metadata_test", "leaf"); - var parent = new DataKey("metadata_test", "parent"); - check(MaterialViews.catalog().tags().contains(iron, leaf)); - check(MaterialViews.catalog().tags().contains(iron, parent)); - check(MaterialViews.catalog().tags().members(parent).contains(iron)); - var family = new MaterialGroupKey(new DataKey("metadata_test", "family")); - check(MaterialViews.catalog() - .tags() - .group(family) - .orElseThrow() - .members() - .contains(iron)); - check(MaterialViews.catalog() - .tags() - .group(family) - .orElseThrow() - .members() - .contains(new MaterialKey("Steel"))); - } - if (scenario.contains("Decomposition")) { - var material = new MaterialKey("MetadataMaterial"); - var process = MaterialProcessKeys.DECOMPOSITION; - checkProcessPublication(material, process); - var declared = MaterialViews.catalog() - .processes() - .findSingle(material, process) - .orElseThrow(); - String form = scenario.endsWith("Block") - ? "blockDust" - : scenario.endsWith("Liquid") ? "liquid" : scenario.endsWith("Gas") ? "gas" : "dust"; - check(declared.forms().equals(java.util.Set.of(new FormKey(form)))); - check(declared.value().routes().equals(java.util.Set.of(MaterialDecompositionRule.Route.CENTRIFUGE))); - check(GTMaterialRegistry.get(material.name()).has(MaterialProperty.CENTRIFUGE)); - } - if (scenario.equals("processes")) { - var key = MaterialProcessKey.multiple(new DataKey("metadata_test", "throw_into_water"), String.class); - checkProcessPublication(new MaterialKey("Iron"), key); - var rules = MaterialViews.catalog().processes().find(new MaterialKey("Iron"), new FormKey("dust"), key); - check(rules.size() == 1 && rules.get(0).value().equals("wet")); - check(MaterialViews.catalog() - .processes() - .find(new MaterialKey("Iron"), new FormKey("ingot"), key) - .isEmpty()); - } - if (scenario.equals("processFormAlias") || scenario.equals("infoProcessFormAlias")) { - var key = scenario.equals("processFormAlias") - ? MaterialProcessKey.multiple(new DataKey("metadata_test", "throw_into_water"), String.class) - : MaterialProcessKey.multiple(new DataKey("metadata_test", "typed_process"), String.class); - var iron = new MaterialKey("Iron"); - checkProcessPublication(iron, key); - check(MaterialViews.catalog() - .processes() - .find(iron, new FormKey("itemCasing"), key) - .size() - == 1); - check(MaterialViews.catalog() - .processes() - .find(iron, new FormKey("casingSmall"), key) - .isEmpty()); - } - if (scenario.equals("info")) { - var material = new MaterialKey("MetadataMaterial"); - check(GTMaterialRegistry.get(material.name()).tool().equals(new MaterialToolProfile(1, 3F, 64, 1))); - check(MaterialInfoTool.tool(material).orElseThrow().equals(new MaterialToolProfile(1, 3F, 64, 1))); - check(MaterialInfoTool.tool(new MaterialKey("DefinitelyUnknown")).isEmpty()); - check(MaterialInfoTool.composition(material).orElseThrow().parts().size() == 1); - check(SmeltingMaterialHelper.target(new MaterialKey("Graphite")) - .orElseThrow() - .equals(new MaterialTarget(new MaterialKey("Carbon"), 648648000L))); - check(MaterialViews.catalog().tags().contains(material, new DataKey("metadata_test", "typed_tag"))); - var process = MaterialProcessKey.multiple(new DataKey("metadata_test", "typed_process"), String.class); - check(MaterialViews.catalog() - .processes() - .find(material, process) - .get(0) - .value() - .equals("typed")); - rejects(() -> - MaterialInfoRegistry.addonRegistrar("metadata_test").registerForm(material, new FormKey("dust"))); - } - if (scenario.equals("infoProcessMultiple")) { - var material = new MaterialKey("MetadataMaterial"); - var process = new MaterialProcessKey<>( - new DataKey("metadata_test", "typed_multi"), String.class, MaterialProcessCardinality.MULTIPLE); - checkProcessPublication(material, process); - var rules = MaterialViews.catalog().processes().find(material, process); - check(rules.size() == 2); - check(rules.stream().map(MaterialProcessRule::value).toList().equals(List.of("wet", "dry"))); - check(MaterialViews.catalog() - .processes() - .findSingle(material, process) - .isEmpty()); - } - if (scenario.equals("processMultiple")) { - var material = new MaterialKey("Iron"); - var process = new MaterialProcessKey<>( - new DataKey("metadata_test", "listed_multi"), String.class, MaterialProcessCardinality.MULTIPLE); - checkProcessPublication(material, process); - check(MaterialViews.catalog().processes().find(material, process).size() == 2); - } - if (scenario.equals("infoLegacy")) { - var material = new MaterialKey("MetadataMaterial"); - var composition = MaterialInfoTool.composition(material).orElseThrow(); - check(composition.divider() == 2 && composition.parts().size() == 2 && composition.crucible()); - check(composition.parts().get(0).equals(new MaterialComposition.Part("Iron", GTValues.U))); - check(composition.parts().get(1).equals(new MaterialComposition.Part("Copper", GTValues.U))); - check(MaterialInfoTool.tool(material).orElseThrow().equals(new MaterialToolProfile(3, 7F, 600L, 4))); - check(GregTechMaterials.find(material.name()).toolQuality() == 4); - check(SmeltingMaterialHelper.target(material) - .orElseThrow() - .equals(new MaterialTarget(new MaterialKey("Copper"), GTValues.U2))); - var second = new MaterialKey("MetadataSecond"); - check(!MaterialInfoTool.composition(second).orElseThrow().crucible()); - check(SmeltingMaterialHelper.target(second).isEmpty()); - check(PulverizationMaterialHelper.target(second).isEmpty()); - check(CrushingMaterialHelper.target(second).isEmpty()); - check(MaterialViews.catalog() - .processes() - .find(second, MaterialProcessKeys.SMELTING) - .isEmpty()); - } - rejects(() -> GTMaterialRegistry.registerDefinition(shared.material())); - rejects(() -> GTMaterialRegistry.installAddonMaterial(shared, 10001)); - rejects(() -> GTMaterialRegistry.registerAlias("Fe", "Iron")); - } - - private static void checkProcessPublication(MaterialKey material, MaterialProcessKey process) { - var auxiliary = MaterialInfoRegistry.processes(material).find(process); - check(!auxiliary.isEmpty()); - check(auxiliary.equals(MaterialViews.catalog().processes().find(material, process))); - if (process.cardinality() == MaterialProcessCardinality.SINGLE) - check(MaterialInfoTool.currentProcess(material, process) - .equals(MaterialViews.catalog().processes().findSingle(material, process))); - rejects(() -> auxiliary.clear()); - } - - private static void checkEffectiveQueries() { - for (var view : MaterialViews.catalog().materials()) { - var key = view.key(); - var material = GTMaterialRegistry.get(key.name()); - check(SmeltingMaterialHelper.target(material).equals(SmeltingMaterialHelper.target(key))); - check(CrushingMaterialHelper.target(material).equals(CrushingMaterialHelper.target(key))); - check(PulverizationMaterialHelper.target(material).equals(PulverizationMaterialHelper.target(key))); - check(FuelMaterialHelper.rule(material).equals(FuelMaterialHelper.rule(key))); - check(OreProcessingMaterialHelper.rule(material).equals(OreProcessingMaterialHelper.rule(key))); - check(material.tool() - .equals(new MaterialToolProfile( - material.getToolTypes(), - material.getToolSpeed(), - material.getToolDurability(), - material.getToolQuality()))); - var indexed = MaterialInfoTool.composition(key); - check(indexed.isPresent() == material.hasComposition()); - if (indexed.isPresent()) { - check(indexed.get().divider() == material.getCompositionDivider()); - check(indexed.get() - .parts() - .equals(material.getCompositionComponents().stream() - .map(part -> new MaterialComposition.Part( - part.material().getName(), part.amount())) - .toList())); - } - } - var iron = MaterialViews.catalog().resolve("Fe").orElseThrow(); - check(SmeltingMaterialHelper.target(iron).orElseThrow().equals(new MaterialTarget(iron, GTValues.U))); - check(SmeltingMaterialHelper.isMaterialSmeltable(iron)); - check(PulverizationMaterialHelper.target(iron).orElseThrow().equals(new MaterialTarget(iron, GTValues.U))); - } -} diff --git a/core/src/test/java/gregtech/engine/material/MaterialMetadataProbeContributor.java b/core/src/test/java/gregtech/engine/material/MaterialMetadataProbeContributor.java deleted file mode 100644 index c67e8d772..000000000 --- a/core/src/test/java/gregtech/engine/material/MaterialMetadataProbeContributor.java +++ /dev/null @@ -1,312 +0,0 @@ -package gregtech.engine.material; - -import gregtech.api.addon.material.*; -import gregtech.api.material.GTValues; -import gregtech.api.material.MaterialToolProfile; -import java.util.List; - -/** Test-only SPI fixture for side metadata ownership, namespace and catalog-wide type checks. */ -public final class MaterialMetadataProbeContributor implements AddonMaterialContributor { - public String addonId() { - return "metadata_test"; - } - - public List materials() { - var material = MaterialDeclaration.builder("MetadataMaterial").dust(); - if (System.getProperty("material.metadata.scenario", "").contains("Decomposition")) - material.liquid().gas(); - return List.of( - material.build(), - MaterialDeclaration.builder("MetadataSecond").dust().build()); - } - - @Override - public List compositions() { - String scenario = System.getProperty("material.metadata.scenario"); - if (scenario.contains("Decomposition")) - return List.of(new MaterialComposition( - "MetadataMaterial", 1, List.of(new MaterialComposition.Part("Iron", GTValues.U)), false)); - if (!"infoLegacy".equals(scenario)) return List.of(); - return List.of( - new MaterialComposition( - "MetadataMaterial", - 2, - List.of( - new MaterialComposition.Part("Iron", GTValues.U), - new MaterialComposition.Part("Copper", GTValues.U)), - true), - new MaterialComposition( - "MetadataSecond", 1, List.of(new MaterialComposition.Part("Iron", GTValues.U)), false)); - } - - @Override - public List smeltingTargets() { - return "infoLegacy".equals(System.getProperty("material.metadata.scenario")) - ? List.of(new SmeltingTargetDeclaration("MetadataMaterial", "Copper", GTValues.U2)) - : List.of(); - } - - @Override - public List smeltingTargetRemovals() { - return "infoLegacy".equals(System.getProperty("material.metadata.scenario")) - ? List.of(new SmeltingTargetRemoval("MetadataSecond")) - : List.of(); - } - - @Override - public void link() { - String scenario = System.getProperty("material.metadata.scenario"); - if ("infoLegacy".equals(scenario)) { - var material = GTMaterialRegistry.get("MetadataMaterial"); - material.setToolStats(3, 7F, 600L, 4) - .setCrushing(GTMaterialRegistry.get("Iron"), GTValues.U2) - .setPulver(GTMaterialRegistry.get("Copper"), GTValues.U9) - .setFurnaceBurnTime(100) - .setBurning(GTMaterialRegistry.get("Ashes"), GTValues.U9) - .setOreMultiplier(2) - .setOreProcessingMultiplier(3); - material.addOreByProducts(GTMaterialRegistry.get("Copper")); - GTMaterialRegistry.get("MetadataSecond").setPulver(null, 0).setCrushing(null, 0); - } else if ("infoLegacyToolConflictFailure".equals(scenario)) { - GTMaterialRegistry.get("MetadataMaterial").setToolStats(3, 7F, 600L, 4); - } - } - - public List metadata() { - String scenario = System.getProperty("material.metadata.scenario"); - var value = new PropertyKey<>(new DataKey(addonId(), "hardness"), Integer.class); - return switch (scenario) { - case "metadataUnknownFailure" -> - List.of(new MaterialMetadataDeclaration( - "TypoMaterial", MaterialMetadata.builder().build())); - case "metadataOwnerFailure" -> - List.of(new MaterialMetadataDeclaration( - "Iron", MaterialMetadata.builder().property(value, 3).build())); - case "metadataNamespaceFailure" -> - List.of(new MaterialMetadataDeclaration( - "Iron", - MaterialMetadata.builder() - .tag(new DataKey("another_addon", "label")) - .build())); - case "metadataTypeFailure" -> - List.of( - new MaterialMetadataDeclaration( - "MetadataMaterial", - MaterialMetadata.builder().property(value, 3).build()), - new MaterialMetadataDeclaration( - "MetadataSecond", - MaterialMetadata.builder() - .property(new PropertyKey<>(value.id(), String.class), "hard") - .build())); - case "relations", "relationTagCycleFailure", "relationUnknownTagFailure" -> - List.of( - new MaterialMetadataDeclaration( - "MetadataMaterial", - MaterialMetadata.builder().property(value, 3).build()), - new MaterialMetadataDeclaration( - "Iron", - MaterialMetadata.builder() - .tag(new DataKey(addonId(), "leaf")) - .build())); - default -> - List.of( - new MaterialMetadataDeclaration( - "MetadataMaterial", - MaterialMetadata.builder().property(value, 3).build()), - new MaterialMetadataDeclaration( - "Fe", - MaterialMetadata.builder() - .tag(new DataKey(addonId(), "descriptive")) - .build())); - }; - } - - public List materialTags() { - String scenario = System.getProperty("material.metadata.scenario"); - var leaf = new DataKey(addonId(), "leaf"); - var parent = new DataKey(addonId(), "parent"); - return switch (scenario) { - case "relations" -> - List.of( - new MaterialTagDeclaration(leaf, java.util.Set.of()), - new MaterialTagDeclaration(parent, java.util.Set.of(leaf))); - case "relationTagCycleFailure" -> - List.of( - new MaterialTagDeclaration(leaf, java.util.Set.of(parent)), - new MaterialTagDeclaration(parent, java.util.Set.of(leaf))); - case "relationUnknownTagFailure" -> - List.of(new MaterialTagDeclaration(parent, java.util.Set.of(new DataKey(addonId(), "missing")))); - case "relationNamespaceFailure" -> - List.of(new MaterialTagDeclaration(new DataKey("another_addon", "leaf"), java.util.Set.of())); - default -> List.of(); - }; - } - - public List materialGroups() { - String scenario = System.getProperty("material.metadata.scenario"); - var family = new MaterialGroupKey(new DataKey(addonId(), "family")); - var first = new MaterialGroupKey(new DataKey(addonId(), "first")); - var second = new MaterialGroupKey(new DataKey(addonId(), "second")); - return switch (scenario) { - case "relations" -> - List.of(new MaterialGroupDeclaration( - family, - "Family", - java.util.Set.of(new MaterialKey("Steel")), - java.util.Set.of(new MaterialGroupKey(new DataKey("gt6ce", "anyiron"))))); - case "relationUnknownGroupFailure" -> - List.of(new MaterialGroupDeclaration( - family, "Family", java.util.Set.of(new MaterialKey("MissingMaterial")), java.util.Set.of())); - case "relationGroupCycleFailure" -> - List.of( - new MaterialGroupDeclaration(first, "First", java.util.Set.of(), java.util.Set.of(second)), - new MaterialGroupDeclaration(second, "Second", java.util.Set.of(), java.util.Set.of(first))); - default -> List.of(); - }; - } - - public List> processes() { - String scenario = System.getProperty("material.metadata.scenario"); - var key = MaterialProcessKey.multiple(new DataKey(addonId(), "throw_into_water"), String.class); - return switch (scenario) { - case "processDecomposition", "infoDecompositionConflictFailure" -> - List.of(new MaterialProcessDeclaration<>( - "MetadataMaterial", - MaterialProcessKeys.DECOMPOSITION, - java.util.Set.of(new FormKey("dust")), - decomposition())); - case "processDecompositionOwnerFailure" -> - List.of(new MaterialProcessDeclaration<>( - "Iron", MaterialProcessKeys.DECOMPOSITION, java.util.Set.of(), decomposition())); - case "processes" -> - List.of(new MaterialProcessDeclaration<>("Iron", key, java.util.Set.of(new FormKey("dust")), "wet")); - case "processFormAlias" -> - List.of(new MaterialProcessDeclaration<>( - "Iron", key, java.util.Set.of(new FormKey("casingSmall")), "wet")); - case "processSingleConflictFailure" -> { - var single = MaterialProcessKey.single(new DataKey(addonId(), "listed_single"), String.class); - yield List.of( - new MaterialProcessDeclaration<>("Iron", single, java.util.Set.of(), "wet"), - new MaterialProcessDeclaration<>("Iron", single, java.util.Set.of(), "dry")); - } - case "processMultiple" -> { - var multiple = MaterialProcessKey.multiple(new DataKey(addonId(), "listed_multi"), String.class); - yield List.of( - new MaterialProcessDeclaration<>("Iron", multiple, java.util.Set.of(), "wet"), - new MaterialProcessDeclaration<>("Iron", multiple, java.util.Set.of(), "dry")); - } - case "processUnknownFormFailure" -> - List.of(new MaterialProcessDeclaration<>( - "Iron", key, java.util.Set.of(new FormKey("definitelyNotAPrefix")), "wet")); - case "processNamespaceFailure" -> - List.of(new MaterialProcessDeclaration<>( - "Iron", - MaterialProcessKey.multiple(new DataKey("another_addon", "throw_into_water"), String.class), - java.util.Set.of(), - "wet")); - case "processUnknownMaterialFailure" -> - List.of(new MaterialProcessDeclaration<>("MissingMaterial", key, java.util.Set.of(), "wet")); - case "processGroupMaterialFailure" -> - List.of(new MaterialProcessDeclaration<>("AnyIron", key, java.util.Set.of(), "wet")); - default -> List.of(); - }; - } - - @Override - public void materialInfo(MaterialInfoTool.Registrar registrar) { - String scenario = System.getProperty("material.metadata.scenario"); - var material = new MaterialKey("MetadataMaterial"); - switch (scenario) { - case "infoDecomposition", - "infoDecompositionBlock", - "infoDecompositionLiquid", - "infoDecompositionGas", - "infoDecompositionConflictFailure": - String form = scenario.equals("infoDecompositionBlock") - ? "blockDust" - : scenario.equals("infoDecompositionLiquid") - ? "liquid" - : scenario.equals("infoDecompositionGas") ? "gas" : "dust"; - registrar.registerProcess( - material, - MaterialProcessKeys.DECOMPOSITION, - new MaterialProcessRule<>(java.util.Set.of(new FormKey(form)), decomposition())); - return; - case "infoDecompositionOwnerFailure": - registrar.registerProcess( - new MaterialKey("Iron"), - MaterialProcessKeys.DECOMPOSITION, - MaterialProcessRule.anyForm(decomposition())); - return; - case "infoLegacyToolConflictFailure": - registrar.registerTool(material, new MaterialToolProfile(1, 3F, 64, 1)); - return; - case "infoOwnerFailure": - registrar.registerTool(new MaterialKey("Iron"), new MaterialToolProfile(1, 2F, 8, 1)); - return; - case "infoNamespaceFailure": - registrar.registerTag(new MaterialKey("Iron"), new DataKey("another_addon", "typed_tag")); - return; - case "infoProcessTypeFailure": - var key = new DataKey(addonId(), "typed_process"); - registrar.registerProcess( - material, MaterialProcessKey.multiple(key, Integer.class), MaterialProcessRule.anyForm(1)); - registrar.registerProcess( - new MaterialKey("MetadataSecond"), - MaterialProcessKey.multiple(key, String.class), - MaterialProcessRule.anyForm("typed")); - return; - case "infoProcessFormAlias": - registrar.registerProcess( - new MaterialKey("Iron"), - MaterialProcessKey.multiple(new DataKey(addonId(), "typed_process"), String.class), - new MaterialProcessRule<>(java.util.Set.of(new FormKey("casingSmall")), "typed")); - return; - case "infoProcessSingleConflictFailure": { - var single = MaterialProcessKey.single(new DataKey(addonId(), "typed_single"), String.class); - registrar.registerProcess(material, single, MaterialProcessRule.anyForm("wet")); - registrar.registerProcess(material, single, MaterialProcessRule.anyForm("dry")); - return; - } - case "infoProcessMultiple": { - var multiple = MaterialProcessKey.multiple(new DataKey(addonId(), "typed_multi"), String.class); - registrar.registerProcess(material, multiple, MaterialProcessRule.anyForm("wet")); - registrar.registerProcess(material, multiple, MaterialProcessRule.anyForm("dry")); - return; - } - case "infoProcessUnknownFormFailure": - registrar.registerProcess( - new MaterialKey("Iron"), - MaterialProcessKey.multiple(new DataKey(addonId(), "typed_process"), String.class), - new MaterialProcessRule<>(java.util.Set.of(new FormKey("definitelyNotAPrefix")), "typed")); - return; - case "infoProcessMissingFormFailure": - registrar.registerProcess( - new MaterialKey("Iron"), - MaterialProcessKey.multiple(new DataKey(addonId(), "typed_process"), String.class), - new MaterialProcessRule<>(java.util.Set.of(new FormKey("plateGem")), "typed")); - return; - case "info": - break; - default: - return; - } - registrar - .registerTool(material, new MaterialToolProfile(1, 3F, 64, 1)) - .registerComposition( - material, - new MaterialComposition( - material.name(), 1, List.of(new MaterialComposition.Part("Iron", GTValues.U)), false)) - .registerForm(material, new FormKey("dust")) - .registerTag(material, new DataKey(addonId(), "typed_tag")) - .registerProcess( - material, - MaterialProcessKey.multiple(new DataKey(addonId(), "typed_process"), String.class), - MaterialProcessRule.anyForm("typed")); - } - - private static MaterialDecompositionRule decomposition() { - return new MaterialDecompositionRule( - java.util.Set.of(MaterialDecompositionRule.Route.CENTRIFUGE), List.of(), false); - } -} diff --git a/core/src/test/java/gregtech/engine/material/MaterialRegistrationTest.java b/core/src/test/java/gregtech/engine/material/MaterialRegistrationTest.java index ab6fc5aa7..ba7cf8362 100644 --- a/core/src/test/java/gregtech/engine/material/MaterialRegistrationTest.java +++ b/core/src/test/java/gregtech/engine/material/MaterialRegistrationTest.java @@ -7,16 +7,35 @@ import gregtech.api.material.MaterialProperty; import gregtech.api.material.MaterialSentinels; import gregtech.content.material.MaterialDefinitions; -import java.io.File; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.Test; class MaterialRegistrationTest { + @Test + void specialProcessInputCountsFollowFormAliases() { + var alias = new FormKey("casingSmall"); + var canonical = new FormKey("itemCasing"); + var process = new MaterialProcessKey<>( + new DataKey("test_addon", "special"), SpecialProcessValue.class, MaterialProcessCardinality.MULTIPLE); + var output = new SpecialProcessValue.ItemOutput( + new MaterialKey("Iron"), List.of(new SpecialProcessValue.FormCount(new FormKey("dust"), 1)), 10000); + var target = new SpecialProcessValue.Target(Map.of(alias, 2), List.of(output), List.of(), 100, 20, 2); + var normalized = MaterialInfoRegistry.normalizeProcessRule( + "test", process, new MaterialProcessRule<>(Set.of(alias), target)); + assertEquals(Set.of(canonical), normalized.forms()); + assertEquals(Map.of(canonical, 2), ((SpecialProcessValue.Target) normalized.value()).inputCounts()); + var duplicate = + new SpecialProcessValue.Target(Map.of(alias, 2, canonical, 3), List.of(output), List.of(), 100, 20, 2); + assertThrows( + IllegalArgumentException.class, + () -> MaterialInfoRegistry.normalizeProcessRule( + "test", process, new MaterialProcessRule<>(Set.of(alias, canonical), duplicate))); + } + @Test void singleValuedProcessesRejectMultipleRulesDuringConstruction() { var process = new MaterialProcessKey<>( @@ -296,80 +315,4 @@ void everyRealCanonicalMaterialHasEnglishAndChineseTranslations() throws Excepti var almandine = MaterialDefinitions.info("Almandine"); assertTrue(almandine.relations().forms().contains("ORES")); } - - @Test - void isolatedLifecyclesCoverEarlyReadsFailuresAndSharedAddonDeclarations() throws Exception { - for (String scenario : List.of( - "early", - "facade", - "normal", - "aliasPublication", - "merge", - "conflict", - "definitionFailure", - "linkFailure", - "metadata", - "metadataUnknownFailure", - "metadataOwnerFailure", - "metadataNamespaceFailure", - "metadataTypeFailure", - "info", - "infoLegacy", - "infoLegacyToolConflictFailure", - "infoOwnerFailure", - "infoNamespaceFailure", - "infoProcessTypeFailure", - "infoProcessFormAlias", - "infoProcessSingleConflictFailure", - "infoProcessMultiple", - "infoProcessMissingFormFailure", - "infoProcessUnknownFormFailure", - "relations", - "relationTagCycleFailure", - "relationUnknownTagFailure", - "relationNamespaceFailure", - "relationUnknownGroupFailure", - "relationGroupCycleFailure", - "processDecomposition", - "infoDecomposition", - "infoDecompositionBlock", - "infoDecompositionLiquid", - "infoDecompositionGas", - "infoDecompositionConflictFailure", - "infoDecompositionOwnerFailure", - "processDecompositionOwnerFailure", - "processes", - "processFormAlias", - "processSingleConflictFailure", - "processMultiple", - "processUnknownFormFailure", - "processNamespaceFailure", - "processUnknownMaterialFailure", - "processGroupMaterialFailure")) { - var root = Path.of("").toAbsolutePath(); - if (!Files.isDirectory(root.resolve("core"))) root = root.getParent(); - var output = root.resolve("work/material-system-refactor/02/lifecycle-" + scenario + ".log"); - Files.createDirectories(output.getParent()); - var classpath = new java.util.ArrayList(); - for (Class type : List.of(MaterialLifecycleProbe.class, GTMaterialRegistry.class, GTMaterial.class)) - classpath.add(Path.of(type.getProtectionDomain() - .getCodeSource() - .getLocation() - .toURI()) - .toString()); - var process = new ProcessBuilder( - Path.of(System.getProperty("java.home"), "bin/java").toString(), - "-cp", - String.join(File.pathSeparator, classpath), - MaterialLifecycleProbe.class.getName(), - scenario) - .redirectErrorStream(true) - .redirectOutput(output.toFile()) - .start(); - boolean done = process.waitFor(45, TimeUnit.SECONDS); - if (!done) process.destroyForcibly(); - assertTrue(done, scenario + " timed out"); - assertEquals(0, process.exitValue(), () -> "Lifecycle failed: " + output); - } - } } diff --git a/core/src/test/java/gregtech/engine/material/SpecialProcessLanguageTest.java b/core/src/test/java/gregtech/engine/material/SpecialProcessLanguageTest.java new file mode 100644 index 000000000..a9d94389a --- /dev/null +++ b/core/src/test/java/gregtech/engine/material/SpecialProcessLanguageTest.java @@ -0,0 +1,33 @@ +package gregtech.engine.material; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashSet; +import java.util.Set; +import java.util.regex.Pattern; +import org.junit.jupiter.api.Test; + +class SpecialProcessLanguageTest { + private static final Pattern PROCESS_KEYS = Pattern.compile("\"(gt6ce\\.special_process\\.[^\"]+)\"\\s*:"); + + @Test + void specialProcessLanguagesHaveTheSameKeys() throws Exception { + var english = keys("en_us.json"); + var chinese = keys("zh_cn.json"); + assertEquals(english, chinese); + for (var method : gregtech.content.recipe.SpecialProcessMethods.methods()) + assertTrue(english.contains(method.displayNameKey()), method.displayNameKey()); + } + + private static Set keys(String language) throws Exception { + var text = + Files.readString(Path.of("src/main/resources/assets/gt6ce/lang").resolve(language)); + var keys = new HashSet(); + var matcher = PROCESS_KEYS.matcher(text); + while (matcher.find()) keys.add(matcher.group(1)); + return keys; + } +} diff --git a/core/src/test/java/gregtech/engine/recipe/MaterialDecompositionPlannerTest.java b/core/src/test/java/gregtech/engine/recipe/MaterialDecompositionPlannerTest.java index 91c71b789..3e483c36c 100644 --- a/core/src/test/java/gregtech/engine/recipe/MaterialDecompositionPlannerTest.java +++ b/core/src/test/java/gregtech/engine/recipe/MaterialDecompositionPlannerTest.java @@ -7,9 +7,10 @@ import gregtech.api.addon.material.MaterialProcessKeys; import gregtech.api.material.GTValues; import gregtech.content.material.MaterialDefinitions; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.material.MaterialTestFixture; import gregtech.content.material.catalog.DecompositionMaterials; -import gregtech.content.recipe.OriginalMaterialFluidUnits; +import gregtech.content.material.catalog.MaterialFluidUnitFacts; import gregtech.engine.material.MaterialInfoRegistry; import java.util.List; import org.junit.jupiter.api.BeforeAll; @@ -98,20 +99,28 @@ void declaredWaterPhasesRemainAvailableWithoutInventingARoute() { @Test void decompositionReusesSharedFluidUnitFacts() { - assertEquals(GTValues.U, OriginalMaterialFluidUnits.SOURCE_UNIT); + assertEquals(GTValues.U, MaterialFluidUnitFacts.SOURCE_UNIT); var rule = MaterialInfoRegistry.processes(new MaterialKey("Chocolate")) .findSingle(MaterialProcessKeys.DECOMPOSITION) .orElseThrow() .value(); - var shared = OriginalMaterialFluidUnits.binding("Chocolate", 9783, "liquid"); + var shared = MaterialInfoRegistry.processes(new MaterialKey("Chocolate")) + .findSingle(MaterialFactKeys.MATERIAL_FLUID_UNIT) + .orElseThrow() + .value() + .units() + .stream() + .filter(binding -> binding.phase().equals("liquid")) + .findFirst() + .orElseThrow(); assertTrue(rule.fluids() .contains(new MaterialDecompositionRule.FluidBinding( MaterialDecompositionRule.Phase.LIQUID, - shared.registryName(), + shared.registryPath(), shared.referenceSourceUnits(), shared.referenceMillibuckets()))); assertEquals( - OriginalMaterialFluidUnits.millibuckets(GTValues.U, GTValues.U, 144, false), + MaterialFluidUnitFacts.millibuckets(GTValues.U, GTValues.U, 144, false), UnitConversion.fluidAmount(GTValues.U, GTValues.U, 144, false)); } diff --git a/core/src/test/java/gregtech/engine/recipe/chem/MaterialAmountTest.java b/core/src/test/java/gregtech/engine/recipe/chem/MaterialAmountTest.java index 347f7436e..0d82fa51e 100644 --- a/core/src/test/java/gregtech/engine/recipe/chem/MaterialAmountTest.java +++ b/core/src/test/java/gregtech/engine/recipe/chem/MaterialAmountTest.java @@ -1,11 +1,9 @@ package gregtech.engine.recipe.chem; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.*; import gregtech.api.material.GTValues; -import gregtech.content.recipe.OriginalMaterialFluidUnits; +import gregtech.content.material.catalog.MaterialFluidUnitFacts; import org.junit.jupiter.api.Test; /** Material units are exact and only material fluids cross a reviewed millibucket boundary. */ @@ -31,14 +29,13 @@ void fractionConstantU50IsOneFiftiethOfAUnit() { assertEquals(GTValues.U / 50, MaterialAmount.fraction(1, 50).units()); assertEquals( 20, - OriginalMaterialFluidUnits.millibuckets( - GTValues.U / 50, OriginalMaterialFluidUnits.SOURCE_UNIT, 1000, false)); + MaterialFluidUnitFacts.millibuckets(GTValues.U / 50, MaterialFluidUnitFacts.SOURCE_UNIT, 1000, false)); } @Test void cryoliteTwentyUnitsUseTheMoltenBinding() { - int millibuckets = OriginalMaterialFluidUnits.millibuckets( - 20 * GTValues.U, OriginalMaterialFluidUnits.SOURCE_UNIT, 144, false); + int millibuckets = + MaterialFluidUnitFacts.millibuckets(20 * GTValues.U, MaterialFluidUnitFacts.SOURCE_UNIT, 144, false); assertEquals(2880, millibuckets); } @@ -46,15 +43,12 @@ void cryoliteTwentyUnitsUseTheMoltenBinding() { void aluminiumFluorideProductionAndElectrolysisShareOneRule() { assertEquals( 576, - OriginalMaterialFluidUnits.millibuckets( - 4 * GTValues.U, OriginalMaterialFluidUnits.SOURCE_UNIT, 144, false)); + MaterialFluidUnitFacts.millibuckets(4 * GTValues.U, MaterialFluidUnitFacts.SOURCE_UNIT, 144, false)); assertEquals( 1152, - OriginalMaterialFluidUnits.millibuckets( - 8 * GTValues.U, OriginalMaterialFluidUnits.SOURCE_UNIT, 144, false)); + MaterialFluidUnitFacts.millibuckets(8 * GTValues.U, MaterialFluidUnitFacts.SOURCE_UNIT, 144, false)); assertEquals( 1728, - OriginalMaterialFluidUnits.millibuckets( - 12 * GTValues.U, OriginalMaterialFluidUnits.SOURCE_UNIT, 144, false)); + MaterialFluidUnitFacts.millibuckets(12 * GTValues.U, MaterialFluidUnitFacts.SOURCE_UNIT, 144, false)); } } diff --git a/core/src/test/resources/gregtech/material-import-references.tsv b/core/src/test/resources/gregtech/material-import-references.tsv deleted file mode 100644 index ea560715a..000000000 --- a/core/src/test/resources/gregtech/material-import-references.tsv +++ /dev/null @@ -1,4064 +0,0 @@ -# Historical import references before canonical migration; runtime does not parse this file. -composition Adamantine component[0] Ad 0 ALIAS -composition Adamantine component[1] O 0 ALIAS -composition Adamantine owner Adamantine 0 VALID -composition Air component[0] N 0 ALIAS -composition Air component[1] O 0 ALIAS -composition Air component[2] Ar 0 ALIAS -composition Air owner Air 0 VALID -composition Al2O3 component[0] Al 0 ALIAS -composition Al2O3 component[1] O 0 ALIAS -composition Al2O3 owner Al2O3 0 ALIAS -composition AlF3 component[0] Al 0 ALIAS -composition AlF3 component[1] F 0 ALIAS -composition AlF3 owner AlF3 0 ALIAS -composition AlO3H3 component[0] Al 0 ALIAS -composition AlO3H3 component[1] O 0 ALIAS -composition AlO3H3 component[2] H 0 ALIAS -composition AlO3H3 owner AlO3H3 0 ALIAS -composition Almandine component[0] Al2O3 0 ALIAS -composition Almandine component[1] Fe 0 ALIAS -composition Almandine component[2] SiO2 0 ALIAS -composition Almandine component[3] O 0 ALIAS -composition Almandine owner Almandine 0 VALID -composition AluminiumAlloy component[0] Al 0 ALIAS -composition AluminiumAlloy component[1] Si 0 ALIAS -composition AluminiumAlloy owner AluminiumAlloy 0 VALID -composition AluminiumBrass component[0] Al 0 ALIAS -composition AluminiumBrass component[1] Cu 0 ALIAS -composition AluminiumBrass owner AluminiumBrass 0 VALID -composition Alumite component[0] Al2O3 0 ALIAS -composition Alumite component[1] WroughtIron 0 VALID -composition Alumite component[2] Obsidian 0 VALID -composition Alumite owner Alumite 0 VALID -composition Alunite component[0] Al2O3 0 ALIAS -composition Alunite component[1] KOH 0 ALIAS -composition Alunite component[2] SO3 0 ALIAS -composition Alunite component[3] H2O 0 ALIAS -composition Alunite component[4] O 0 ALIAS -composition Alunite owner Alunite 0 VALID -composition Amazonite component[0] Al2O3 0 ALIAS -composition Amazonite component[1] SiO2 0 ALIAS -composition Amazonite component[2] K 0 ALIAS -composition Amazonite component[3] O 0 ALIAS -composition Amazonite owner Amazonite 0 VALID -composition Amethyst component[0] SiO2 0 ALIAS -composition Amethyst component[1] Fe 0 ALIAS -composition Amethyst owner Amethyst 0 VALID -composition Andradite component[0] Ca 0 ALIAS -composition Andradite component[1] Fe 0 ALIAS -composition Andradite component[2] SiO2 0 ALIAS -composition Andradite component[3] O 0 ALIAS -composition Andradite owner Andradite 0 VALID -composition AnnealedCopper component[0] Cu 0 ALIAS -composition AnnealedCopper owner AnnealedCopper 0 VALID -composition Apatite component[0] Ca 0 ALIAS -composition Apatite component[1] PO4 0 ALIAS -composition Apatite component[2] Cl 0 ALIAS -composition Apatite owner Apatite 0 VALID -composition AquaRegia component[0] HNO3 0 ALIAS -composition AquaRegia component[1] HCl 0 ALIAS -composition AquaRegia owner AquaRegia 0 VALID -composition Aquamarine component[0] Al2O3 0 ALIAS -composition Aquamarine component[1] Be 0 ALIAS -composition Aquamarine component[2] SiO2 0 ALIAS -composition Aquamarine component[3] O 0 ALIAS -composition Aquamarine owner Aquamarine 0 VALID -composition ArsenicBronze component[0] As 0 ALIAS -composition ArsenicBronze component[1] Bronze 0 VALID -composition ArsenicBronze owner ArsenicBronze 0 VALID -composition ArsenicCopper component[0] Cu 0 ALIAS -composition ArsenicCopper component[1] As 0 ALIAS -composition ArsenicCopper owner ArsenicCopper 0 VALID -composition Arsenopyrite component[0] Fe 0 ALIAS -composition Arsenopyrite component[1] As 0 ALIAS -composition Arsenopyrite component[2] S 0 ALIAS -composition Arsenopyrite owner Arsenopyrite 0 VALID -composition Asbestos component[0] Mg 0 ALIAS -composition Asbestos component[1] SiO2 0 ALIAS -composition Asbestos component[2] H2O 0 ALIAS -composition Asbestos component[3] O 0 ALIAS -composition Asbestos owner Asbestos 0 VALID -composition Azurite component[0] Cu 0 ALIAS -composition Azurite component[1] CO3 0 ALIAS -composition Azurite component[2] O 0 ALIAS -composition Azurite component[3] H2O 0 ALIAS -composition Azurite owner Azurite 0 VALID -composition BalasRuby component[0] Cr 0 ALIAS -composition BalasRuby component[1] Mg 0 ALIAS -composition BalasRuby component[2] O 0 ALIAS -composition BalasRuby owner BalasRuby 0 VALID -composition Bamboo component[0] C 0 ALIAS -composition Bamboo component[1] H2O 0 ALIAS -composition Bamboo owner Bamboo 0 VALID -composition Barite component[0] Ba 0 ALIAS -composition Barite component[1] S 0 ALIAS -composition Barite component[2] O 0 ALIAS -composition Barite owner Barite 0 VALID -composition Bark component[0] C 0 ALIAS -composition Bark component[1] H2O 0 ALIAS -composition Bark owner Bark 0 VALID -composition Basalt component[0] Peridot 0 VALID -composition Basalt component[1] CaCO3 0 ALIAS -composition Basalt component[2] Flint 0 VALID -composition Basalt component[3] DarkAsh 0 ALIAS -composition Basalt owner Basalt 0 VALID -composition BasalticMineralSand component[0] Fe 0 ALIAS -composition BasalticMineralSand component[1] O 0 ALIAS -composition BasalticMineralSand owner BasalticMineralSand 0 VALID -composition Bastnasite component[0] Ce 0 ALIAS -composition Bastnasite component[1] C 0 ALIAS -composition Bastnasite component[2] F 0 ALIAS -composition Bastnasite component[3] O 0 ALIAS -composition Bastnasite owner Bastnasite 0 VALID -composition BatteryAlloy component[0] Pb 0 ALIAS -composition BatteryAlloy component[1] Sb 0 ALIAS -composition BatteryAlloy owner BatteryAlloy 0 VALID -composition Bauxite component[0] TiO2 0 ALIAS -composition Bauxite component[1] Ilmenite 0 VALID -composition Bauxite component[2] Al2O3 0 ALIAS -composition Bauxite owner Bauxite 0 VALID -composition Biotite component[0] K 0 ALIAS -composition Biotite component[1] Mg 0 ALIAS -composition Biotite component[2] Al2O3 0 ALIAS -composition Biotite component[3] F 0 ALIAS -composition Biotite component[4] SiO2 0 ALIAS -composition Biotite owner Biotite 0 VALID -composition Bischofite component[0] MgCl2 0 ALIAS -composition Bischofite component[1] H2O 0 ALIAS -composition Bischofite owner Bischofite 0 VALID -composition BismuthBronze component[0] Bi 0 ALIAS -composition BismuthBronze component[1] Brass 0 VALID -composition BismuthBronze owner BismuthBronze 0 VALID -composition Bixbite component[0] Al2O3 0 ALIAS -composition Bixbite component[1] Be 0 ALIAS -composition Bixbite component[2] SiO2 0 ALIAS -composition Bixbite component[3] O 0 ALIAS -composition Bixbite owner Bixbite 0 VALID -composition BlackBronze component[0] Cu 0 ALIAS -composition BlackBronze component[1] Electrum 0 VALID -composition BlackBronze owner BlackBronze 0 VALID -composition BlackSteel component[0] Ni 0 ALIAS -composition BlackSteel component[1] BlackBronze 0 VALID -composition BlackSteel component[2] Steel 0 VALID -composition BlackSteel owner BlackSteel 0 VALID -composition BlackVitriol component[0] Fe 0 ALIAS -composition BlackVitriol component[1] S 0 ALIAS -composition BlackVitriol owner BlackVitriol 0 VALID -composition BlazeQuartz component[0] SiO2 0 ALIAS -composition BlazeQuartz owner BlazeQuartz 0 VALID -composition BlueAlloy component[0] Ag 0 ALIAS -composition BlueAlloy component[1] Nikolite 0 VALID -composition BlueAlloy owner BlueAlloy 0 VALID -composition BlueSapphire component[0] Al2O3 0 ALIAS -composition BlueSapphire component[1] Fe 0 ALIAS -composition BlueSapphire owner BlueSapphire 0 VALID -composition BlueSteel component[0] SterlingSilver 0 VALID -composition BlueSteel component[1] BismuthBronze 0 VALID -composition BlueSteel component[2] Steel 0 VALID -composition BlueSteel component[3] BlackSteel 0 VALID -composition BlueSteel owner BlueSteel 0 VALID -composition BlueTopaz component[0] Al2O3 0 ALIAS -composition BlueTopaz component[1] SiO2 0 ALIAS -composition BlueTopaz component[2] F 0 ALIAS -composition BlueTopaz component[3] H2O 0 ALIAS -composition BlueTopaz owner BlueTopaz 0 VALID -composition BlueVitriol component[0] Cu 0 ALIAS -composition BlueVitriol component[1] S 0 ALIAS -composition BlueVitriol component[2] O 0 ALIAS -composition BlueVitriol owner BlueVitriol 0 VALID -composition Bone component[0] Ca 0 ALIAS -composition Bone owner Bone 0 VALID -composition Borax component[0] Na 0 ALIAS -composition Borax component[1] B 0 ALIAS -composition Borax component[2] H2O 0 ALIAS -composition Borax component[3] O 0 ALIAS -composition Borax owner Borax 0 VALID -composition Brass component[0] Cu 0 ALIAS -composition Brass component[1] Zn 0 ALIAS -composition Brass owner Brass 0 VALID -composition Brick component[0] Ceramic 0 VALID -composition Brick owner Brick 0 ALIAS -composition Bromargyrite component[0] Ag 0 ALIAS -composition Bromargyrite component[1] Br 0 ALIAS -composition Bromargyrite owner Bromargyrite 0 VALID -composition Bronze component[0] Cu 0 ALIAS -composition Bronze component[1] Sn 0 ALIAS -composition Bronze owner Bronze 0 VALID -composition BrownLimonite component[0] Fe 0 ALIAS -composition BrownLimonite component[1] H 0 ALIAS -composition BrownLimonite component[2] O 0 ALIAS -composition BrownLimonite owner BrownLimonite 0 VALID -composition CH4 component[0] C 0 ALIAS -composition CH4 component[1] H 0 ALIAS -composition CH4 owner CH4 0 ALIAS -composition CO component[0] C 0 ALIAS -composition CO component[1] O 0 ALIAS -composition CO owner CO 0 ALIAS -composition CO2 component[0] C 0 ALIAS -composition CO2 component[1] O 0 ALIAS -composition CO2 owner CO2 0 ALIAS -composition CO3 component[0] C 0 ALIAS -composition CO3 component[1] O 0 ALIAS -composition CO3 owner CO3 0 ALIAS -composition CaCO3 component[0] Ca 0 ALIAS -composition CaCO3 component[1] CO3 0 ALIAS -composition CaCO3 owner CaCO3 0 ALIAS -composition CaCl2 component[0] Ca 0 ALIAS -composition CaCl2 component[1] Cl 0 ALIAS -composition CaCl2 owner CaCl2 0 ALIAS -composition CaSO4 component[0] Ca 0 ALIAS -composition CaSO4 component[1] S 0 ALIAS -composition CaSO4 component[2] O 0 ALIAS -composition CaSO4 owner CaSO4 0 ALIAS -composition Cassiterite component[0] Sn 0 ALIAS -composition Cassiterite component[1] O 0 ALIAS -composition Cassiterite owner Cassiterite 0 VALID -composition Cd_In_Ag_Alloy component[0] Cd 0 ALIAS -composition Cd_In_Ag_Alloy component[1] In 0 ALIAS -composition Cd_In_Ag_Alloy component[2] Ag 0 ALIAS -composition Cd_In_Ag_Alloy owner Cd_In_Ag_Alloy 0 ALIAS -composition Celestine component[0] Sr 0 ALIAS -composition Celestine component[1] S 0 ALIAS -composition Celestine component[2] O 0 ALIAS -composition Celestine owner Celestine 0 VALID -composition Ceramic component[0] Al2O3 0 ALIAS -composition Ceramic component[1] SiO2 0 ALIAS -composition Ceramic owner Ceramic 0 VALID -composition CertusQuartz component[0] SiO2 0 ALIAS -composition CertusQuartz owner CertusQuartz 0 VALID -composition Chalcopyrite component[0] Cu 0 ALIAS -composition Chalcopyrite component[1] Fe 0 ALIAS -composition Chalcopyrite component[2] S 0 ALIAS -composition Chalcopyrite owner Chalcopyrite 0 VALID -composition Charcoal component[0] C 0 ALIAS -composition Charcoal owner Charcoal 0 VALID -composition ChargedCertusQuartz component[0] SiO2 0 ALIAS -composition ChargedCertusQuartz owner ChargedCertusQuartz 0 VALID -composition ChloroauricAcid component[0] Au 0 ALIAS -composition ChloroauricAcid component[1] Cl 0 ALIAS -composition ChloroauricAcid component[2] H 0 ALIAS -composition ChloroauricAcid owner ChloroauricAcid 0 VALID -composition ChloroplatinicAcid component[0] Pt 0 ALIAS -composition ChloroplatinicAcid component[1] Cl 0 ALIAS -composition ChloroplatinicAcid component[2] H 0 ALIAS -composition ChloroplatinicAcid owner ChloroplatinicAcid 0 VALID -composition Chocolate component[0] Cocoa 0 VALID -composition Chocolate component[1] Sugar 0 VALID -composition Chocolate owner Chocolate 0 VALID -composition Chromite component[0] Fe 0 ALIAS -composition Chromite component[1] Cr 0 ALIAS -composition Chromite component[2] O 0 ALIAS -composition Chromite owner Chromite 0 VALID -composition ChromiumDioxide component[0] Cr 0 ALIAS -composition ChromiumDioxide component[1] O 0 ALIAS -composition ChromiumDioxide owner ChromiumDioxide 0 VALID -composition Cinnabar component[0] Hg 0 ALIAS -composition Cinnabar component[1] S 0 ALIAS -composition Cinnabar owner Cinnabar 0 VALID -composition Clay component[0] Ceramic 0 VALID -composition Clay component[1] H2O 0 ALIAS -composition Clay owner Clay 0 VALID -composition Coal component[0] C 0 ALIAS -composition Coal owner Coal 0 VALID -composition CoalCoke component[0] C 0 ALIAS -composition CoalCoke owner CoalCoke 0 VALID -composition CobaltBrass component[0] Brass 0 VALID -composition CobaltBrass component[1] Al 0 ALIAS -composition CobaltBrass component[2] Co 0 ALIAS -composition CobaltBrass owner CobaltBrass 0 VALID -composition CobaltHexahydrate component[0] Co 0 ALIAS -composition CobaltHexahydrate component[1] H2O 0 ALIAS -composition CobaltHexahydrate owner CobaltHexahydrate 0 VALID -composition Cobaltite component[0] Co 0 ALIAS -composition Cobaltite component[1] As 0 ALIAS -composition Cobaltite component[2] S 0 ALIAS -composition Cobaltite owner Cobaltite 0 VALID -composition Coltan component[0] Tantalite 0 VALID -composition Coltan component[1] Columbite 0 VALID -composition Coltan owner Coltan 0 VALID -composition Columbite component[0] Nb2O5 0 ALIAS -composition Columbite component[1] MnO2 0 ALIAS -composition Columbite owner Columbite 0 VALID -composition Concrete component[0] Stone 0 VALID -composition Concrete owner Concrete 0 VALID -composition ConductiveIron component[0] WroughtIron 0 VALID -composition ConductiveIron component[1] Redstone 0 VALID -composition ConductiveIron owner ConductiveIron 0 VALID -composition Constantan component[0] Cu 0 ALIAS -composition Constantan component[1] Ni 0 ALIAS -composition Constantan owner Constantan 0 VALID -composition Cooperite component[0] Pt 0 ALIAS -composition Cooperite component[1] Ni 0 ALIAS -composition Cooperite component[2] Pd 0 ALIAS -composition Cooperite component[3] S 0 ALIAS -composition Cooperite owner Cooperite 0 VALID -composition CrystalMatrix component[0] Diamond 0 VALID -composition CrystalMatrix component[1] NetherStar 0 VALID -composition CrystalMatrix owner CrystalMatrix 0 VALID -composition CyanVitriol component[0] Ni 0 ALIAS -composition CyanVitriol component[1] S 0 ALIAS -composition CyanVitriol component[2] O 0 ALIAS -composition CyanVitriol owner CyanVitriol 0 VALID -composition D2O component[0] D 0 ALIAS -composition D2O component[1] O 0 ALIAS -composition D2O owner D2O 0 ALIAS -composition DamascusSteel component[0] Steel 0 VALID -composition DamascusSteel component[1] V 0 ALIAS -composition DamascusSteel component[2] W 0 ALIAS -composition DamascusSteel owner DamascusSteel 0 VALID -composition Datolite component[0] H 0 ALIAS -composition Datolite component[1] Ca 0 ALIAS -composition Datolite component[2] B 0 ALIAS -composition Datolite component[3] Si 0 ALIAS -composition Datolite component[4] O 0 ALIAS -composition Datolite owner Datolite 0 VALID -composition Diamond component[0] C 0 ALIAS -composition Diamond owner Diamond 0 VALID -composition DiamondBlue component[0] C 0 ALIAS -composition DiamondBlue owner DiamondBlue 0 ALIAS -composition DiamondGreen component[0] C 0 ALIAS -composition DiamondGreen owner DiamondGreen 0 ALIAS -composition DiamondIndustrial component[0] C 0 ALIAS -composition DiamondIndustrial owner DiamondIndustrial 0 VALID -composition DiamondPink component[0] C 0 ALIAS -composition DiamondPink owner DiamondPink 0 ALIAS -composition DiamondRed component[0] C 0 ALIAS -composition DiamondRed owner DiamondRed 0 ALIAS -composition DiamondYellow component[0] C 0 ALIAS -composition DiamondYellow owner DiamondYellow 0 ALIAS -composition Diatomite component[0] Flint 0 VALID -composition Diatomite component[1] Fe2O3 0 ALIAS -composition Diatomite component[2] Sapphire 0 VALID -composition Diatomite owner Diatomite 0 VALID -composition DiduraniumTrioxide component[0] Dn 0 ALIAS -composition DiduraniumTrioxide component[1] O 0 ALIAS -composition DiduraniumTrioxide owner DiduraniumTrioxide 0 VALID -composition Dioptase component[0] SiO2 0 ALIAS -composition Dioptase component[1] Cu 0 ALIAS -composition Dioptase component[2] O 0 ALIAS -composition Dioptase component[3] H2O 0 ALIAS -composition Dioptase owner Dioptase 0 VALID -composition DistWater component[0] H 0 ALIAS -composition DistWater component[1] O 0 ALIAS -composition DistWater owner DistWater 0 ALIAS -composition Dreamwood component[0] C 0 ALIAS -composition Dreamwood component[1] H2O 0 ALIAS -composition Dreamwood owner Dreamwood 0 VALID -composition Duralumin component[0] Al 0 ALIAS -composition Duralumin component[1] Cu 0 ALIAS -composition Duralumin owner Duralumin 0 VALID -composition DuraniumAlloy component[0] Dn 0 ALIAS -composition DuraniumAlloy component[1] Mg 0 ALIAS -composition DuraniumAlloy owner DuraniumAlloy 0 ALIAS -composition DuraniumHexaastatide component[0] Dn 0 ALIAS -composition DuraniumHexaastatide component[1] At 0 ALIAS -composition DuraniumHexaastatide owner DuraniumHexaastatide 0 VALID -composition DuraniumHexabromide component[0] Dn 0 ALIAS -composition DuraniumHexabromide component[1] Br 0 ALIAS -composition DuraniumHexabromide owner DuraniumHexabromide 0 VALID -composition DuraniumHexachloride component[0] Dn 0 ALIAS -composition DuraniumHexachloride component[1] Cl 0 ALIAS -composition DuraniumHexachloride owner DuraniumHexachloride 0 VALID -composition DuraniumHexafluoride component[0] Dn 0 ALIAS -composition DuraniumHexafluoride component[1] F 0 ALIAS -composition DuraniumHexafluoride owner DuraniumHexafluoride 0 VALID -composition DuraniumHexaiodide component[0] Dn 0 ALIAS -composition DuraniumHexaiodide component[1] I 0 ALIAS -composition DuraniumHexaiodide owner DuraniumHexaiodide 0 VALID -composition Dynamite component[0] Glyceryl 0 VALID -composition Dynamite component[1] Wood 0 VALID -composition Dynamite owner Dynamite 0 VALID -composition ElectricalSteel component[0] Steel 0 VALID -composition ElectricalSteel component[1] Si 0 ALIAS -composition ElectricalSteel owner ElectricalSteel 0 VALID -composition ElectrotineAlloy component[0] WroughtIron 0 VALID -composition ElectrotineAlloy component[1] Nikolite 0 VALID -composition ElectrotineAlloy owner ElectrotineAlloy 0 VALID -composition Electrum component[0] Ag 0 ALIAS -composition Electrum component[1] Au 0 ALIAS -composition Electrum owner Electrum 0 VALID -composition ElvenQuartz component[0] SiO2 0 ALIAS -composition ElvenQuartz owner ElvenQuartz 0 VALID -composition Emerald component[0] Al2O3 0 ALIAS -composition Emerald component[1] Be 0 ALIAS -composition Emerald component[2] SiO2 0 ALIAS -composition Emerald component[3] O 0 ALIAS -composition Emerald owner Emerald 0 VALID -composition EnderEye component[0] EnderPearl 0 VALID -composition EnderEye component[1] Blaze 0 VALID -composition EnderEye owner EnderEye 0 VALID -composition EnderPearl component[0] Be 0 ALIAS -composition EnderPearl component[1] K 0 ALIAS -composition EnderPearl component[2] N 0 ALIAS -composition EnderPearl component[3] Ma 0 ALIAS -composition EnderPearl owner EnderPearl 0 VALID -composition Enderium component[0] EnderiumBase 0 VALID -composition Enderium component[1] EnderPearl 0 VALID -composition Enderium owner Enderium 0 VALID -composition EnderiumBase component[0] Sn 0 ALIAS -composition EnderiumBase component[1] Ag 0 ALIAS -composition EnderiumBase component[2] Pt 0 ALIAS -composition EnderiumBase owner EnderiumBase 0 VALID -composition EnergiumCyan component[0] Sapphire 0 VALID -composition EnergiumCyan component[1] Nikolite 0 VALID -composition EnergiumCyan owner EnergiumCyan 0 VALID -composition EnergiumRed component[0] Sapphire 0 VALID -composition EnergiumRed component[1] Redstone 0 VALID -composition EnergiumRed owner EnergiumRed 0 VALID -composition Eudialyte component[0] Zircon 0 VALID -composition Eudialyte component[1] MnO2 0 ALIAS -composition Eudialyte component[2] Na 0 ALIAS -composition Eudialyte component[3] Ca 0 ALIAS -composition Eudialyte component[4] Cl 0 ALIAS -composition Eudialyte component[5] SiO2 0 ALIAS -composition Eudialyte component[6] O 0 ALIAS -composition Eudialyte owner Eudialyte 0 VALID -composition Fe2O3 component[0] Fe 0 ALIAS -composition Fe2O3 component[1] O 0 ALIAS -composition Fe2O3 owner Fe2O3 0 ALIAS -composition FeCl2 component[0] Fe 0 ALIAS -composition FeCl2 component[1] Cl 0 ALIAS -composition FeCl2 owner FeCl2 0 ALIAS -composition FeCl3 component[0] Fe 0 ALIAS -composition FeCl3 component[1] Cl 0 ALIAS -composition FeCl3 owner FeCl3 0 ALIAS -composition FeO3H3 component[0] Fe 0 ALIAS -composition FeO3H3 component[1] O 0 ALIAS -composition FeO3H3 component[2] H 0 ALIAS -composition FeO3H3 owner FeO3H3 0 ALIAS -composition Ferberite component[0] Fe 0 ALIAS -composition Ferberite component[1] WO3 0 ALIAS -composition Ferberite component[2] O 0 ALIAS -composition Ferberite owner Ferberite 0 VALID -composition Ferrovanadium component[0] Magnetite 0 VALID -composition Ferrovanadium component[1] V2O5 0 ALIAS -composition Ferrovanadium owner Ferrovanadium 0 ALIAS -composition FierySteel component[0] Steel 0 VALID -composition FierySteel component[1] Ma 0 ALIAS -composition FierySteel owner FierySteel 0 VALID -composition Fireleaf component[0] Steel 0 VALID -composition Fireleaf component[1] Ma 0 ALIAS -composition Fireleaf owner Fireleaf 0 VALID -composition FlamascusSteel component[0] DamascusSteel 0 VALID -composition FlamascusSteel component[1] Ma 0 ALIAS -composition FlamascusSteel owner FlamascusSteel 0 VALID -composition Flint component[0] SiO2 0 ALIAS -composition Flint owner Flint 0 VALID -composition Fluix component[0] SiO2 0 ALIAS -composition Fluix component[1] Redstone 0 VALID -composition Fluix owner Fluix 0 VALID -composition FreshWater component[0] H 0 ALIAS -composition FreshWater component[1] O 0 ALIAS -composition FreshWater owner FreshWater 0 VALID -composition Galena component[0] Pb 0 ALIAS -composition Galena component[1] Ag 0 ALIAS -composition Galena component[2] S 0 ALIAS -composition Galena owner Galena 0 VALID -composition GarnetSand component[0] Almandine 0 VALID -composition GarnetSand component[1] Andradite 0 VALID -composition GarnetSand component[2] Grossular 0 VALID -composition GarnetSand component[3] Pyrope 0 VALID -composition GarnetSand component[4] Spessartine 0 VALID -composition GarnetSand component[5] Uvarovite 0 VALID -composition GarnetSand owner GarnetSand 0 VALID -composition Garnierite component[0] Ni 0 ALIAS -composition Garnierite component[1] O 0 ALIAS -composition Garnierite owner Garnierite 0 VALID -composition Glass component[0] SiO2 0 ALIAS -composition Glass owner Glass 0 VALID -composition Glauconite component[0] Al2O3 0 ALIAS -composition Glauconite component[1] K 0 ALIAS -composition Glauconite component[2] Mg 0 ALIAS -composition Glauconite component[3] H2O 0 ALIAS -composition Glauconite component[4] O 0 ALIAS -composition Glauconite owner Glauconite 0 VALID -composition Glowstone component[0] Phosphorite 0 VALID -composition Glowstone component[1] Au 0 ALIAS -composition Glowstone component[2] SiO2 0 ALIAS -composition Glowstone component[3] He 0 ALIAS -composition Glowstone owner Glowstone 0 VALID -composition Glycerol component[0] C 0 ALIAS -composition Glycerol component[1] H 0 ALIAS -composition Glycerol component[2] O 0 ALIAS -composition Glycerol owner Glycerol 0 VALID -composition Glyceryl component[0] C 0 ALIAS -composition Glyceryl component[1] H 0 ALIAS -composition Glyceryl component[2] N 0 ALIAS -composition Glyceryl component[3] O 0 ALIAS -composition Glyceryl owner Glyceryl 0 VALID -composition Goshenite component[0] Al2O3 0 ALIAS -composition Goshenite component[1] Be 0 ALIAS -composition Goshenite component[2] SiO2 0 ALIAS -composition Goshenite component[3] O 0 ALIAS -composition Goshenite owner Goshenite 0 VALID -composition Granite component[0] Biotite 0 VALID -composition Granite component[1] PotassiumFeldspar 0 VALID -composition Granite component[2] Flint 0 VALID -composition Granite owner Granite 0 VALID -composition GraniteBlack component[0] Biotite 0 VALID -composition GraniteBlack component[1] PotassiumFeldspar 0 VALID -composition GraniteBlack component[2] Flint 0 VALID -composition GraniteBlack owner GraniteBlack 0 VALID -composition GraniteRed component[0] Biotite 0 VALID -composition GraniteRed component[1] PotassiumFeldspar 0 VALID -composition GraniteRed component[2] Flint 0 VALID -composition GraniteRed owner GraniteRed 0 VALID -composition GraniticMineralSand component[0] Fe 0 ALIAS -composition GraniticMineralSand component[1] O 0 ALIAS -composition GraniticMineralSand owner GraniticMineralSand 0 VALID -composition Graphene component[0] C 0 ALIAS -composition Graphene owner Graphene 0 VALID -composition Graphite component[0] C 0 ALIAS -composition Graphite owner Graphite 0 VALID -composition GrayVitriol component[0] Mn 0 ALIAS -composition GrayVitriol component[1] S 0 ALIAS -composition GrayVitriol component[2] O 0 ALIAS -composition GrayVitriol owner GrayVitriol 0 VALID -composition Greatwood component[0] C 0 ALIAS -composition Greatwood component[1] H2O 0 ALIAS -composition Greatwood owner Greatwood 0 VALID -composition GreenSapphire component[0] Al2O3 0 ALIAS -composition GreenSapphire component[1] Mg 0 ALIAS -composition GreenSapphire owner GreenSapphire 0 VALID -composition GreenVitriol component[0] Fe 0 ALIAS -composition GreenVitriol component[1] S 0 ALIAS -composition GreenVitriol component[2] O 0 ALIAS -composition GreenVitriol owner GreenVitriol 0 VALID -composition Grossular component[0] Al2O3 0 ALIAS -composition Grossular component[1] Ca 0 ALIAS -composition Grossular component[2] SiO2 0 ALIAS -composition Grossular component[3] O 0 ALIAS -composition Grossular owner Grossular 0 VALID -composition Gunpowder component[0] C 0 ALIAS -composition Gunpowder component[1] S 0 ALIAS -composition Gunpowder component[2] NaNO3 0 ALIAS -composition Gunpowder owner Gunpowder 0 VALID -composition Gypsum component[0] CaSO4 0 ALIAS -composition Gypsum component[1] H2O 0 ALIAS -composition Gypsum owner Gypsum 0 VALID -composition H2O component[0] H 0 ALIAS -composition H2O component[1] O 0 ALIAS -composition H2O owner H2O 0 ALIAS -composition H2O2 component[0] H 0 ALIAS -composition H2O2 component[1] O 0 ALIAS -composition H2O2 owner H2O2 0 ALIAS -composition H2S component[0] H 0 ALIAS -composition H2S component[1] S 0 ALIAS -composition H2S owner H2S 0 ALIAS -composition H2S2O7 component[0] H 0 ALIAS -composition H2S2O7 component[1] S 0 ALIAS -composition H2S2O7 component[2] O 0 ALIAS -composition H2S2O7 owner H2S2O7 0 ALIAS -composition H2SO4 component[0] H 0 ALIAS -composition H2SO4 component[1] S 0 ALIAS -composition H2SO4 component[2] O 0 ALIAS -composition H2SO4 owner H2SO4 0 ALIAS -composition H2SiF6 component[0] H 0 ALIAS -composition H2SiF6 component[1] Si 0 ALIAS -composition H2SiF6 component[2] F 0 ALIAS -composition H2SiF6 owner H2SiF6 0 ALIAS -composition H2WO4 component[0] H 0 ALIAS -composition H2WO4 component[1] W 0 ALIAS -composition H2WO4 component[2] O 0 ALIAS -composition H2WO4 owner H2WO4 0 ALIAS -composition H3BO3 component[0] H 0 ALIAS -composition H3BO3 component[1] B 0 ALIAS -composition H3BO3 component[2] O 0 ALIAS -composition H3BO3 owner H3BO3 0 ALIAS -composition HCl component[0] H 0 ALIAS -composition HCl component[1] Cl 0 ALIAS -composition HCl owner HCl 0 ALIAS -composition HDO component[0] H 0 ALIAS -composition HDO component[1] D 0 ALIAS -composition HDO component[2] O 0 ALIAS -composition HDO owner HDO 0 ALIAS -composition HF component[0] H 0 ALIAS -composition HF component[1] F 0 ALIAS -composition HF owner HF 0 ALIAS -composition HNO3 component[0] H 0 ALIAS -composition HNO3 component[1] N 0 ALIAS -composition HNO3 component[2] O 0 ALIAS -composition HNO3 owner HNO3 0 ALIAS -composition HSSE component[0] HSSG 0 VALID -composition HSSE component[1] Co 0 ALIAS -composition HSSE component[2] Mn 0 ALIAS -composition HSSE component[3] Si 0 ALIAS -composition HSSE owner HSSE 0 VALID -composition HSSG component[0] TungstenSteel 0 ALIAS -composition HSSG component[1] Cr 0 ALIAS -composition HSSG component[2] Mo 0 ALIAS -composition HSSG component[3] V 0 ALIAS -composition HSSG owner HSSG 0 VALID -composition HSSS component[0] HSSG 0 VALID -composition HSSS component[1] Osmiridium 0 VALID -composition HSSS component[2] Ir 0 ALIAS -composition HSSS owner HSSS 0 VALID -composition HeNe component[0] He 0 ALIAS -composition HeNe component[1] Ne 0 ALIAS -composition HeNe owner HeNe 0 ALIAS -composition Heliodor component[0] Al2O3 0 ALIAS -composition Heliodor component[1] Be 0 ALIAS -composition Heliodor component[2] SiO2 0 ALIAS -composition Heliodor component[3] O 0 ALIAS -composition Heliodor owner Heliodor 0 VALID -composition HolyWater component[0] H 0 ALIAS -composition HolyWater component[1] O 0 ALIAS -composition HolyWater owner HolyWater 0 VALID -composition Huebnerite component[0] Mn 0 ALIAS -composition Huebnerite component[1] WO3 0 ALIAS -composition Huebnerite component[2] O 0 ALIAS -composition Huebnerite owner Huebnerite 0 VALID -composition HydratedCoal component[0] Coal 0 VALID -composition HydratedCoal component[1] H2O 0 ALIAS -composition HydratedCoal owner HydratedCoal 0 VALID -composition Ice component[0] H 0 ALIAS -composition Ice component[1] O 0 ALIAS -composition Ice owner Ice 0 VALID -composition Ilmenite component[0] Fe 0 ALIAS -composition Ilmenite component[1] Ti 0 ALIAS -composition Ilmenite component[2] O 0 ALIAS -composition Ilmenite owner Ilmenite 0 VALID -composition Invar component[0] WroughtIron 0 VALID -composition Invar component[1] Ni 0 ALIAS -composition Invar owner Invar 0 VALID -composition Iridiron component[0] Ir 0 ALIAS -composition Iridiron component[1] Fe 0 ALIAS -composition Iridiron owner Iridiron 0 RETIRED -composition IridironReinforced component[0] Ir 0 ALIAS -composition IridironReinforced component[1] Fe 0 ALIAS -composition IridironReinforced owner IridironReinforced 0 RETIRED -composition Iritanium component[0] Ir 0 ALIAS -composition Iritanium component[1] Ti 0 ALIAS -composition Iritanium owner Iritanium 0 ALIAS -composition IronCast component[0] Fe 0 ALIAS -composition IronCast owner IronCast 0 ALIAS -composition IronMagnetic component[0] Fe 0 ALIAS -composition IronMagnetic owner IronMagnetic 0 VALID -composition K2CO3 component[0] K 0 ALIAS -composition K2CO3 component[1] CO3 0 ALIAS -composition K2CO3 owner K2CO3 0 ALIAS -composition K2S component[0] K 0 ALIAS -composition K2S component[1] S 0 ALIAS -composition K2S owner K2S 0 ALIAS -composition K2S2O7 component[0] K 0 ALIAS -composition K2S2O7 component[1] S 0 ALIAS -composition K2S2O7 component[2] O 0 ALIAS -composition K2S2O7 owner K2S2O7 0 ALIAS -composition K2SO3 component[0] K 0 ALIAS -composition K2SO3 component[1] S 0 ALIAS -composition K2SO3 component[2] O 0 ALIAS -composition K2SO3 owner K2SO3 0 ALIAS -composition K2SO4 component[0] K 0 ALIAS -composition K2SO4 component[1] S 0 ALIAS -composition K2SO4 component[2] O 0 ALIAS -composition K2SO4 owner K2SO4 0 ALIAS -composition K2TaF7 component[0] K 0 ALIAS -composition K2TaF7 component[1] Ta 0 ALIAS -composition K2TaF7 component[2] F 0 ALIAS -composition K2TaF7 owner K2TaF7 0 ALIAS -composition KAlO2 component[0] K 0 ALIAS -composition KAlO2 component[1] Al 0 ALIAS -composition KAlO2 component[2] O 0 ALIAS -composition KAlO2 owner KAlO2 0 ALIAS -composition KCl component[0] K 0 ALIAS -composition KCl component[1] Cl 0 ALIAS -composition KCl owner KCl 0 ALIAS -composition KF component[0] K 0 ALIAS -composition KF component[1] F 0 ALIAS -composition KF owner KF 0 ALIAS -composition KHSO4 component[0] K 0 ALIAS -composition KHSO4 component[1] H 0 ALIAS -composition KHSO4 component[2] S 0 ALIAS -composition KHSO4 component[3] O 0 ALIAS -composition KHSO4 owner KHSO4 0 ALIAS -composition KIO3 component[0] K 0 ALIAS -composition KIO3 component[1] I 0 ALIAS -composition KIO3 component[2] O 0 ALIAS -composition KIO3 owner KIO3 0 ALIAS -composition KNO3 component[0] K 0 ALIAS -composition KNO3 component[1] N 0 ALIAS -composition KNO3 component[2] O 0 ALIAS -composition KNO3 owner KNO3 0 ALIAS -composition KOH component[0] K 0 ALIAS -composition KOH component[1] O 0 ALIAS -composition KOH component[2] H 0 ALIAS -composition KOH owner KOH 0 ALIAS -composition KSO4 component[0] K 0 ALIAS -composition KSO4 component[1] S 0 ALIAS -composition KSO4 component[2] O 0 ALIAS -composition KSO4 owner KSO4 0 ALIAS -composition Kanthal component[0] WroughtIron 0 VALID -composition Kanthal component[1] Al 0 ALIAS -composition Kanthal component[2] Cr 0 ALIAS -composition Kanthal owner Kanthal 0 VALID -composition Kesterite component[0] Cu 0 ALIAS -composition Kesterite component[1] Zn 0 ALIAS -composition Kesterite component[2] Sn 0 ALIAS -composition Kesterite component[3] S 0 ALIAS -composition Kesterite owner Kesterite 0 VALID -composition Knightmetal component[0] Steel 0 VALID -composition Knightmetal component[1] Ma 0 ALIAS -composition Knightmetal owner Knightmetal 0 VALID -composition Komatiite component[0] Peridot 0 VALID -composition Komatiite component[1] MgCO3 0 ALIAS -composition Komatiite component[2] Flint 0 VALID -composition Komatiite component[3] DarkAsh 0 ALIAS -composition Komatiite owner Komatiite 0 VALID -composition Kyanite component[0] Al2O3 0 ALIAS -composition Kyanite component[1] SiO2 0 ALIAS -composition Kyanite owner Kyanite 0 VALID -composition Lapis component[0] Lazurite 0 VALID -composition Lapis component[1] Sodalite 0 VALID -composition Lapis component[2] Pyrite 0 VALID -composition Lapis component[3] CaCO3 0 ALIAS -composition Lapis owner Lapis 0 VALID -composition Lazurite component[0] Al2O3 0 ALIAS -composition Lazurite component[1] SiO2 0 ALIAS -composition Lazurite component[2] Ca 0 ALIAS -composition Lazurite component[3] Na 0 ALIAS -composition Lazurite owner Lazurite 0 VALID -composition Lepidolite component[0] Al2O3 0 ALIAS -composition Lepidolite component[1] K 0 ALIAS -composition Lepidolite component[2] Li 0 ALIAS -composition Lepidolite component[3] F 0 ALIAS -composition Lepidolite component[4] O 0 ALIAS -composition Lepidolite owner Lepidolite 0 VALID -composition LiCl component[0] Li 0 ALIAS -composition LiCl component[1] Cl 0 ALIAS -composition LiCl owner LiCl 0 ALIAS -composition LiClO3 component[0] Li 0 ALIAS -composition LiClO3 component[1] Cl 0 ALIAS -composition LiClO3 component[2] O 0 ALIAS -composition LiClO3 owner LiClO3 0 ALIAS -composition LiClO4 component[0] Li 0 ALIAS -composition LiClO4 component[1] Cl 0 ALIAS -composition LiClO4 component[2] O 0 ALIAS -composition LiClO4 owner LiClO4 0 ALIAS -composition LiOH component[0] Li 0 ALIAS -composition LiOH component[1] O 0 ALIAS -composition LiOH component[2] H 0 ALIAS -composition LiOH owner LiOH 0 ALIAS -composition Lignite component[0] C 0 ALIAS -composition Lignite component[1] H2O 0 ALIAS -composition Lignite component[2] DarkAsh 0 ALIAS -composition Lignite owner Lignite 0 VALID -composition LigniteCoke component[0] C 0 ALIAS -composition LigniteCoke component[1] DarkAsh 0 ALIAS -composition LigniteCoke owner LigniteCoke 0 VALID -composition Limestone component[0] CaCO3 0 ALIAS -composition Limestone owner Limestone 0 VALID -composition LiveRoot component[0] Wood 0 VALID -composition LiveRoot component[1] Ma 0 ALIAS -composition LiveRoot owner LiveRoot 0 VALID -composition Livingwood component[0] C 0 ALIAS -composition Livingwood component[1] H2O 0 ALIAS -composition Livingwood owner Livingwood 0 VALID -composition Lumium component[0] Sn 0 ALIAS -composition Lumium component[1] Ag 0 ALIAS -composition Lumium component[2] Glowstone 0 VALID -composition Lumium owner Lumium 0 VALID -composition Magnalium component[0] Mg 0 ALIAS -composition Magnalium component[1] Al 0 ALIAS -composition Magnalium owner Magnalium 0 VALID -composition Magnetite component[0] Fe 0 ALIAS -composition Magnetite component[1] O 0 ALIAS -composition Magnetite owner Magnetite 0 VALID -composition Malachite component[0] Cu 0 ALIAS -composition Malachite component[1] CO3 0 ALIAS -composition Malachite component[2] H 0 ALIAS -composition Malachite component[3] O 0 ALIAS -composition Malachite owner Malachite 0 VALID -composition ManaDiamond component[0] C 0 ALIAS -composition ManaDiamond component[1] Ma 0 ALIAS -composition ManaDiamond owner ManaDiamond 0 VALID -composition Manasteel component[0] Fe 0 ALIAS -composition Manasteel component[1] Ma 0 ALIAS -composition Manasteel owner Manasteel 0 VALID -composition Marble component[0] Mg 0 ALIAS -composition Marble component[1] CaCO3 0 ALIAS -composition Marble owner Marble 0 VALID -composition Maxixe component[0] Al2O3 0 ALIAS -composition Maxixe component[1] Be 0 ALIAS -composition Maxixe component[2] SiO2 0 ALIAS -composition Maxixe component[3] O 0 ALIAS -composition Maxixe owner Maxixe 0 VALID -composition MethaneIce component[0] CH4 0 ALIAS -composition MethaneIce component[1] Ice 0 VALID -composition MethaneIce owner MethaneIce 0 VALID -composition MgCO3 component[0] Mg 0 ALIAS -composition MgCO3 component[1] CO3 0 ALIAS -composition MgCO3 owner MgCO3 0 ALIAS -composition MgCl2 component[0] Mg 0 ALIAS -composition MgCl2 component[1] Cl 0 ALIAS -composition MgCl2 owner MgCl2 0 ALIAS -composition Mica component[0] Al2O3 0 ALIAS -composition Mica component[1] K 0 ALIAS -composition Mica component[2] SiO2 0 ALIAS -composition Mica component[3] F 0 ALIAS -composition Mica owner Mica 0 VALID -composition MilkyQuartz component[0] SiO2 0 ALIAS -composition MilkyQuartz owner MilkyQuartz 0 VALID -composition Mirabilite component[0] Na2SO4 0 ALIAS -composition Mirabilite component[1] H2O 0 ALIAS -composition Mirabilite owner Mirabilite 0 VALID -composition MnCl2 component[0] Mn 0 ALIAS -composition MnCl2 component[1] Cl 0 ALIAS -composition MnCl2 owner MnCl2 0 ALIAS -composition MnO2 component[0] Mn 0 ALIAS -composition MnO2 component[1] O 0 ALIAS -composition MnO2 owner MnO2 0 ALIAS -composition Molybdenite component[0] Mo 0 ALIAS -composition Molybdenite component[1] S 0 ALIAS -composition Molybdenite owner Molybdenite 0 VALID -composition Monazite component[0] RareEarth 0 VALID -composition Monazite component[1] PO4 0 ALIAS -composition Monazite owner Monazite 0 VALID -composition Morganite component[0] Al2O3 0 ALIAS -composition Morganite component[1] Be 0 ALIAS -composition Morganite component[2] SiO2 0 ALIAS -composition Morganite component[3] O 0 ALIAS -composition Morganite owner Morganite 0 VALID -composition NH3 component[0] N 0 ALIAS -composition NH3 component[1] H 0 ALIAS -composition NH3 owner NH3 0 ALIAS -composition NO component[0] N 0 ALIAS -composition NO component[1] O 0 ALIAS -composition NO owner NO 0 ALIAS -composition NO2 component[0] N 0 ALIAS -composition NO2 component[1] O 0 ALIAS -composition NO2 owner NO2 0 ALIAS -composition Na2CO3 component[0] Na 0 ALIAS -composition Na2CO3 component[1] CO3 0 ALIAS -composition Na2CO3 owner Na2CO3 0 ALIAS -composition Na2S component[0] Na 0 ALIAS -composition Na2S component[1] S 0 ALIAS -composition Na2S owner Na2S 0 ALIAS -composition Na2S2O7 component[0] Na 0 ALIAS -composition Na2S2O7 component[1] S 0 ALIAS -composition Na2S2O7 component[2] O 0 ALIAS -composition Na2S2O7 owner Na2S2O7 0 ALIAS -composition Na2SO3 component[0] Na 0 ALIAS -composition Na2SO3 component[1] S 0 ALIAS -composition Na2SO3 component[2] O 0 ALIAS -composition Na2SO3 owner Na2SO3 0 ALIAS -composition Na2SO4 component[0] Na 0 ALIAS -composition Na2SO4 component[1] S 0 ALIAS -composition Na2SO4 component[2] O 0 ALIAS -composition Na2SO4 owner Na2SO4 0 ALIAS -composition Na3AlF6 component[0] Na 0 ALIAS -composition Na3AlF6 component[1] Al 0 ALIAS -composition Na3AlF6 component[2] F 0 ALIAS -composition Na3AlF6 owner Na3AlF6 0 ALIAS -composition NaAlO2 component[0] Na 0 ALIAS -composition NaAlO2 component[1] Al 0 ALIAS -composition NaAlO2 component[2] O 0 ALIAS -composition NaAlO2 owner NaAlO2 0 ALIAS -composition NaCl component[0] Na 0 ALIAS -composition NaCl component[1] Cl 0 ALIAS -composition NaCl owner NaCl 0 ALIAS -composition NaF component[0] Na 0 ALIAS -composition NaF component[1] F 0 ALIAS -composition NaF owner NaF 0 ALIAS -composition NaHCO3 component[0] Na 0 ALIAS -composition NaHCO3 component[1] H 0 ALIAS -composition NaHCO3 component[2] C 0 ALIAS -composition NaHCO3 component[3] O 0 ALIAS -composition NaHCO3 owner NaHCO3 0 ALIAS -composition NaHSO4 component[0] Na 0 ALIAS -composition NaHSO4 component[1] H 0 ALIAS -composition NaHSO4 component[2] S 0 ALIAS -composition NaHSO4 component[3] O 0 ALIAS -composition NaHSO4 owner NaHSO4 0 ALIAS -composition NaNO3 component[0] Na 0 ALIAS -composition NaNO3 component[1] N 0 ALIAS -composition NaNO3 component[2] O 0 ALIAS -composition NaNO3 owner NaNO3 0 ALIAS -composition NaOH component[0] Na 0 ALIAS -composition NaOH component[1] O 0 ALIAS -composition NaOH component[2] H 0 ALIAS -composition NaOH owner NaOH 0 ALIAS -composition NaSO4 component[0] Na 0 ALIAS -composition NaSO4 component[1] S 0 ALIAS -composition NaSO4 component[2] O 0 ALIAS -composition NaSO4 owner NaSO4 0 ALIAS -composition Nb2O5 component[0] Nb 0 ALIAS -composition Nb2O5 component[1] O 0 ALIAS -composition Nb2O5 owner Nb2O5 0 ALIAS -composition NeodymiumMagnetic component[0] Nd 0 ALIAS -composition NeodymiumMagnetic owner NeodymiumMagnetic 0 VALID -composition NetherQuartz component[0] SiO2 0 ALIAS -composition NetherQuartz owner NetherQuartz 0 VALID -composition Netherite component[0] Au 0 ALIAS -composition Netherite component[1] AncientDebris 0 VALID -composition Netherite owner Netherite 0 VALID -composition NetherizedDiamond component[0] Netherite 0 VALID -composition NetherizedDiamond component[1] Diamond 0 VALID -composition NetherizedDiamond owner NetherizedDiamond 0 VALID -composition Nichrome component[0] Ni 0 ALIAS -composition Nichrome component[1] Cr 0 ALIAS -composition Nichrome owner Nichrome 0 VALID -composition NikolineAlloy component[0] Si 0 ALIAS -composition NikolineAlloy component[1] Nikolite 0 VALID -composition NikolineAlloy owner NikolineAlloy 0 VALID -composition Nikolite component[0] Sodalite 0 VALID -composition Nikolite component[1] Cu 0 ALIAS -composition Nikolite component[2] SiO2 0 ALIAS -composition Nikolite component[3] Ar 0 ALIAS -composition Nikolite owner Nikolite 0 VALID -composition NiobiumTitanium component[0] Nb 0 ALIAS -composition NiobiumTitanium component[1] Ti 0 ALIAS -composition NiobiumTitanium owner NiobiumTitanium 0 VALID -composition Niter component[0] KNO3 0 ALIAS -composition Niter component[1] NaNO3 0 ALIAS -composition Niter owner Niter 0 VALID -composition NitroCarbon component[0] N 0 ALIAS -composition NitroCarbon component[1] C 0 ALIAS -composition NitroCarbon owner NitroCarbon 0 VALID -composition NitroFuel component[0] Glyceryl 0 VALID -composition NitroFuel component[1] Fuel 0 VALID -composition NitroFuel owner NitroFuel 0 VALID -composition Obsidian component[0] Mg 0 ALIAS -composition Obsidian component[1] Fe 0 ALIAS -composition Obsidian component[2] SiO2 0 ALIAS -composition Obsidian component[3] O 0 ALIAS -composition Obsidian owner Obsidian 0 VALID -composition Oilshale component[0] CaCO3 0 ALIAS -composition Oilshale component[1] MilkyQuartz 0 VALID -composition Oilshale component[2] Clay 0 VALID -composition Oilshale owner Oilshale 0 ALIAS -composition OnyxBlack component[0] SiO2 0 ALIAS -composition OnyxBlack owner OnyxBlack 0 VALID -composition OnyxRed component[0] SiO2 0 ALIAS -composition OnyxRed owner OnyxRed 0 VALID -composition Opal component[0] SiO2 0 ALIAS -composition Opal owner Opal 0 VALID -composition OrangeSapphire component[0] Al2O3 0 ALIAS -composition OrangeSapphire component[1] Cu 0 ALIAS -composition OrangeSapphire owner OrangeSapphire 0 VALID -composition Osmiridium component[0] Os 0 ALIAS -composition Osmiridium component[1] Ir 0 ALIAS -composition Osmiridium owner Osmiridium 0 VALID -composition OsmiumTetroxide component[0] Os 0 ALIAS -composition OsmiumTetroxide component[1] O 0 ALIAS -composition OsmiumTetroxide owner OsmiumTetroxide 0 RETIRED -composition PO4 component[0] P 0 ALIAS -composition PO4 component[1] O 0 ALIAS -composition PO4 owner PO4 0 ALIAS -composition PVC component[0] C 0 ALIAS -composition PVC component[1] H 0 ALIAS -composition PVC owner PVC 0 VALID -composition Pentlandite component[0] Ni 0 ALIAS -composition Pentlandite component[1] S 0 ALIAS -composition Pentlandite owner Pentlandite 0 VALID -composition Peridot component[0] SiO2 0 ALIAS -composition Peridot component[1] Fe 0 ALIAS -composition Peridot component[2] Mg 0 ALIAS -composition Peridot owner Peridot 0 VALID -composition Perlite component[0] Obsidian 0 VALID -composition Perlite component[1] H2O 0 ALIAS -composition Perlite owner Perlite 0 VALID -composition PetCoke component[0] C 0 ALIAS -composition PetCoke component[1] S 0 ALIAS -composition PetCoke owner PetCoke 0 ALIAS -composition PetrifiedWood component[0] Wood 0 VALID -composition PetrifiedWood owner PetrifiedWood 0 VALID -composition Petrotheum component[0] Clay 0 VALID -composition Petrotheum component[1] Obsidian 0 VALID -composition Petrotheum component[2] Redstone 0 VALID -composition Petrotheum component[3] Basalz 0 VALID -composition Petrotheum owner Petrotheum 0 RETIRED -composition Phosphorite component[0] Ca 0 ALIAS -composition Phosphorite component[1] PO4 0 ALIAS -composition Phosphorite component[2] F 0 ALIAS -composition Phosphorite owner Phosphorite 0 VALID -composition Phosphorus component[0] Ca 0 ALIAS -composition Phosphorus component[1] PO4 0 ALIAS -composition Phosphorus owner Phosphorus 0 VALID -composition PhosphorusBlue component[0] Ca 0 ALIAS -composition PhosphorusBlue component[1] PO4 0 ALIAS -composition PhosphorusBlue owner PhosphorusBlue 0 ALIAS -composition PhosphorusRed component[0] Ca 0 ALIAS -composition PhosphorusRed component[1] PO4 0 ALIAS -composition PhosphorusRed owner PhosphorusRed 0 ALIAS -composition PhosphorusWhite component[0] Ca 0 ALIAS -composition PhosphorusWhite component[1] PO4 0 ALIAS -composition PhosphorusWhite owner PhosphorusWhite 0 ALIAS -composition Pinalite component[0] Pb 0 ALIAS -composition Pinalite component[1] WO3 0 ALIAS -composition Pinalite component[2] Cl 0 ALIAS -composition Pinalite component[3] O 0 ALIAS -composition Pinalite owner Pinalite 0 VALID -composition PinkVitriol component[0] Mg 0 ALIAS -composition PinkVitriol component[1] S 0 ALIAS -composition PinkVitriol component[2] O 0 ALIAS -composition PinkVitriol owner PinkVitriol 0 VALID -composition Pitchblende component[0] Uraninite 0 VALID -composition Pitchblende component[1] Th 0 ALIAS -composition Pitchblende component[2] Pb 0 ALIAS -composition Pitchblende owner Pitchblende 0 VALID -composition Plastic component[0] C 0 ALIAS -composition Plastic component[1] H 0 ALIAS -composition Plastic owner Plastic 0 VALID -composition Pollucite component[0] Al2O3 0 ALIAS -composition Pollucite component[1] Cs 0 ALIAS -composition Pollucite component[2] SiO2 0 ALIAS -composition Pollucite component[3] H2O 0 ALIAS -composition Pollucite component[4] O 0 ALIAS -composition Pollucite owner Pollucite 0 VALID -composition Porcelain component[0] Ceramic 0 VALID -composition Porcelain component[1] SiO2 0 ALIAS -composition Porcelain component[2] PotassiumFeldspar 0 VALID -composition Porcelain owner Porcelain 0 VALID -composition PotassiumFeldspar component[0] K 0 ALIAS -composition PotassiumFeldspar component[1] Al2O3 0 ALIAS -composition PotassiumFeldspar component[2] SiO2 0 ALIAS -composition PotassiumFeldspar component[3] O 0 ALIAS -composition PotassiumFeldspar owner PotassiumFeldspar 0 VALID -composition Powellite component[0] Ca 0 ALIAS -composition Powellite component[1] Mo 0 ALIAS -composition Powellite component[2] O 0 ALIAS -composition Powellite owner Powellite 0 VALID -composition Pumice component[0] Peridot 0 VALID -composition Pumice component[1] MgCO3 0 ALIAS -composition Pumice component[2] Flint 0 VALID -composition Pumice component[3] DarkAsh 0 ALIAS -composition Pumice owner Pumice 0 VALID -composition PurpleSapphire component[0] Al2O3 0 ALIAS -composition PurpleSapphire component[1] V 0 ALIAS -composition PurpleSapphire owner PurpleSapphire 0 VALID -composition Pyrite component[0] Fe 0 ALIAS -composition Pyrite component[1] S 0 ALIAS -composition Pyrite owner Pyrite 0 VALID -composition Pyrope component[0] Al2O3 0 ALIAS -composition Pyrope component[1] Mg 0 ALIAS -composition Pyrope component[2] SiO2 0 ALIAS -composition Pyrope component[3] O 0 ALIAS -composition Pyrope owner Pyrope 0 VALID -composition Pyrotheum component[0] Coal 0 VALID -composition Pyrotheum component[1] S 0 ALIAS -composition Pyrotheum component[2] Redstone 0 VALID -composition Pyrotheum component[3] Blaze 0 VALID -composition Pyrotheum owner Pyrotheum 0 RETIRED -composition QuartzSand component[0] CertusQuartz 0 VALID -composition QuartzSand component[1] MilkyQuartz 0 VALID -composition QuartzSand owner QuartzSand 0 VALID -composition Quicklime component[0] Ca 0 ALIAS -composition Quicklime component[1] O 0 ALIAS -composition Quicklime owner Quicklime 0 VALID -composition Realgar component[0] As 0 ALIAS -composition Realgar component[1] S 0 ALIAS -composition Realgar owner Realgar 0 VALID -composition RedAlloy component[0] Cu 0 ALIAS -composition RedAlloy component[1] Redstone 0 VALID -composition RedAlloy owner RedAlloy 0 VALID -composition RedQuartz component[0] SiO2 0 ALIAS -composition RedQuartz owner RedQuartz 0 VALID -composition RedSteel component[0] RoseGold 0 VALID -composition RedSteel component[1] Brass 0 VALID -composition RedSteel component[2] Steel 0 VALID -composition RedSteel component[3] BlackSteel 0 VALID -composition RedSteel owner RedSteel 0 VALID -composition RedVitriol component[0] Co 0 ALIAS -composition RedVitriol component[1] S 0 ALIAS -composition RedVitriol component[2] O 0 ALIAS -composition RedVitriol owner RedVitriol 0 VALID -composition Redstone component[0] Pyrite 0 VALID -composition Redstone component[1] Hg 0 ALIAS -composition Redstone component[2] SiO2 0 ALIAS -composition Redstone component[3] Ruby 0 VALID -composition Redstone owner Redstone 0 VALID -composition RedstoneAlloy component[0] Si 0 ALIAS -composition RedstoneAlloy component[1] Redstone 0 VALID -composition RedstoneAlloy owner RedstoneAlloy 0 VALID -composition RoseGold component[0] Cu 0 ALIAS -composition RoseGold component[1] Au 0 ALIAS -composition RoseGold owner RoseGold 0 VALID -composition Rubber component[0] C 0 ALIAS -composition Rubber component[1] H 0 ALIAS -composition Rubber owner Rubber 0 VALID -composition Ruby component[0] Al2O3 0 ALIAS -composition Ruby component[1] Cr 0 ALIAS -composition Ruby owner Ruby 0 VALID -composition Russellite component[0] Bi 0 ALIAS -composition Russellite component[1] WO3 0 ALIAS -composition Russellite component[2] O 0 ALIAS -composition Russellite owner Russellite 0 VALID -composition SO2 component[0] S 0 ALIAS -composition SO2 component[1] O 0 ALIAS -composition SO2 owner SO2 0 ALIAS -composition SO3 component[0] S 0 ALIAS -composition SO3 component[1] O 0 ALIAS -composition SO3 owner SO3 0 ALIAS -composition SaltWater component[0] H2O 0 ALIAS -composition SaltWater component[1] NaCl 0 ALIAS -composition SaltWater owner SaltWater 0 ALIAS -composition SaltedWater component[0] H2O 0 ALIAS -composition SaltedWater component[1] KCl 0 ALIAS -composition SaltedWater owner SaltedWater 0 VALID -composition Sapphire component[0] Al2O3 0 ALIAS -composition Sapphire owner Sapphire 0 VALID -composition Scheelite component[0] Ca 0 ALIAS -composition Scheelite component[1] WO3 0 ALIAS -composition Scheelite component[2] O 0 ALIAS -composition Scheelite owner Scheelite 0 VALID -composition SeaWater component[0] H 0 ALIAS -composition SeaWater component[1] O 0 ALIAS -composition SeaWater owner SeaWater 0 VALID -composition Shale component[0] CaCO3 0 ALIAS -composition Shale component[1] MilkyQuartz 0 VALID -composition Shale component[2] Clay 0 VALID -composition Shale owner Shale 0 VALID -composition SiC component[0] Si 0 ALIAS -composition SiC component[1] C 0 ALIAS -composition SiC owner SiC 0 ALIAS -composition SiO2 component[0] Si 0 ALIAS -composition SiO2 component[1] O 0 ALIAS -composition SiO2 owner SiO2 0 ALIAS -composition Signalum component[0] Cu 0 ALIAS -composition Signalum component[1] Ag 0 ALIAS -composition Signalum component[2] RedAlloy 0 VALID -composition Signalum owner Signalum 0 VALID -composition Silverwood component[0] C 0 ALIAS -composition Silverwood component[1] H2O 0 ALIAS -composition Silverwood owner Silverwood 0 VALID -composition Smithsonite component[0] Zn 0 ALIAS -composition Smithsonite component[1] C 0 ALIAS -composition Smithsonite component[2] O 0 ALIAS -composition Smithsonite owner Smithsonite 0 VALID -composition SmokeyQuartz component[0] SiO2 0 ALIAS -composition SmokeyQuartz owner SmokeyQuartz 0 VALID -composition Snow component[0] H 0 ALIAS -composition Snow component[1] O 0 ALIAS -composition Snow owner Snow 0 VALID -composition Sodalite component[0] Al2O3 0 ALIAS -composition Sodalite component[1] SiO2 0 ALIAS -composition Sodalite component[2] Na 0 ALIAS -composition Sodalite component[3] Cl 0 ALIAS -composition Sodalite owner Sodalite 0 VALID -composition SodiumPeroxide component[0] Na 0 ALIAS -composition SodiumPeroxide component[1] O 0 ALIAS -composition SodiumPeroxide owner SodiumPeroxide 0 RETIRED -composition SolderingAlloy component[0] Sn 0 ALIAS -composition SolderingAlloy component[1] Sb 0 ALIAS -composition SolderingAlloy owner SolderingAlloy 0 VALID -composition Soularium component[0] SoulSand 0 ALIAS -composition Soularium component[1] Au 0 ALIAS -composition Soularium owner Soularium 0 VALID -composition Sperrylite component[0] Pt 0 ALIAS -composition Sperrylite component[1] As 0 ALIAS -composition Sperrylite owner Sperrylite 0 VALID -composition Spessartine component[0] Al2O3 0 ALIAS -composition Spessartine component[1] Mn 0 ALIAS -composition Spessartine component[2] SiO2 0 ALIAS -composition Spessartine component[3] O 0 ALIAS -composition Spessartine owner Spessartine 0 VALID -composition Sphalerite component[0] Zn 0 ALIAS -composition Sphalerite component[1] S 0 ALIAS -composition Sphalerite owner Sphalerite 0 VALID -composition Spinel component[0] Al2O3 0 ALIAS -composition Spinel component[1] Mg 0 ALIAS -composition Spinel component[2] O 0 ALIAS -composition Spinel owner Spinel 0 VALID -composition Spodumene component[0] Al2O3 0 ALIAS -composition Spodumene component[1] Li 0 ALIAS -composition Spodumene component[2] SiO2 0 ALIAS -composition Spodumene component[3] O 0 ALIAS -composition Spodumene owner Spodumene 0 VALID -composition StainlessSteel component[0] WroughtIron 0 VALID -composition StainlessSteel component[1] Invar 0 VALID -composition StainlessSteel component[2] Cr 0 ALIAS -composition StainlessSteel component[3] Mn 0 ALIAS -composition StainlessSteel owner StainlessSteel 0 VALID -composition StannicChloride component[0] Sn 0 ALIAS -composition StannicChloride component[1] Cl 0 ALIAS -composition StannicChloride owner StannicChloride 0 VALID -composition Stannite component[0] Cu 0 ALIAS -composition Stannite component[1] Fe 0 ALIAS -composition Stannite component[2] Sn 0 ALIAS -composition Stannite component[3] S 0 ALIAS -composition Stannite owner Stannite 0 VALID -composition Steam component[0] H 0 ALIAS -composition Steam component[1] O 0 ALIAS -composition Steam owner Steam 0 VALID -composition Steel component[0] WroughtIron 0 VALID -composition Steel owner Steel 0 VALID -composition SteelGalvanized component[0] Steel 0 VALID -composition SteelGalvanized component[1] Zn 0 ALIAS -composition SteelGalvanized owner SteelGalvanized 0 VALID -composition SteelMagnetic component[0] Steel 0 VALID -composition SteelMagnetic owner SteelMagnetic 0 VALID -composition Steeleaf component[0] Steel 0 VALID -composition Steeleaf component[1] Ma 0 ALIAS -composition Steeleaf owner Steeleaf 0 VALID -composition SterlingSilver component[0] Cu 0 ALIAS -composition SterlingSilver component[1] Ag 0 ALIAS -composition SterlingSilver owner SterlingSilver 0 VALID -composition Stibnite component[0] Sb 0 ALIAS -composition Stibnite component[1] S 0 ALIAS -composition Stibnite owner Stibnite 0 VALID -composition Stolzite component[0] Pb 0 ALIAS -composition Stolzite component[1] WO3 0 ALIAS -composition Stolzite component[2] O 0 ALIAS -composition Stolzite owner Stolzite 0 VALID -composition Sugar component[0] C 0 ALIAS -composition Sugar component[1] H 0 ALIAS -composition Sugar component[2] O 0 ALIAS -composition Sugar owner Sugar 0 VALID -composition SunnyQuartz component[0] SiO2 0 ALIAS -composition SunnyQuartz owner SunnyQuartz 0 VALID -composition T2O component[0] T 0 ALIAS -composition T2O component[1] O 0 ALIAS -composition T2O owner T2O 0 ALIAS -composition Ta2O5 component[0] Ta 0 ALIAS -composition Ta2O5 component[1] O 0 ALIAS -composition Ta2O5 owner Ta2O5 0 ALIAS -composition Ta4HfC5 component[0] Ta 0 ALIAS -composition Ta4HfC5 component[1] Hf 0 ALIAS -composition Ta4HfC5 component[2] C 0 ALIAS -composition Ta4HfC5 owner Ta4HfC5 0 ALIAS -composition Talc component[0] Mg 0 ALIAS -composition Talc component[1] SiO2 0 ALIAS -composition Talc component[2] H2O 0 ALIAS -composition Talc component[3] O 0 ALIAS -composition Talc owner Talc 0 VALID -composition Tantalite component[0] Ta2O5 0 ALIAS -composition Tantalite component[1] MnO2 0 ALIAS -composition Tantalite owner Tantalite 0 VALID -composition Tanzanite component[0] Al2O3 0 ALIAS -composition Tanzanite component[1] SiO2 0 ALIAS -composition Tanzanite component[2] Ca 0 ALIAS -composition Tanzanite component[3] H2O 0 ALIAS -composition Tanzanite component[4] O 0 ALIAS -composition Tanzanite owner Tanzanite 0 VALID -composition Teflon component[0] C 0 ALIAS -composition Teflon component[1] H 0 ALIAS -composition Teflon owner Teflon 0 VALID -composition Tetrahedrite component[0] Cu 0 ALIAS -composition Tetrahedrite component[1] Sb 0 ALIAS -composition Tetrahedrite component[2] Fe 0 ALIAS -composition Tetrahedrite component[3] S 0 ALIAS -composition Tetrahedrite owner Tetrahedrite 0 VALID -composition Thaumium component[0] Fe 0 ALIAS -composition Thaumium component[1] Ma 0 ALIAS -composition Thaumium owner Thaumium 0 VALID -composition TiCl4 component[0] Ti 0 ALIAS -composition TiCl4 component[1] Cl 0 ALIAS -composition TiCl4 owner TiCl4 0 ALIAS -composition TiO2 component[0] Ti 0 ALIAS -composition TiO2 component[1] O 0 ALIAS -composition TiO2 owner TiO2 0 ALIAS -composition TinAlloy component[0] Sn 0 ALIAS -composition TinAlloy component[1] WroughtIron 0 VALID -composition TinAlloy owner TinAlloy 0 VALID -composition Topaz component[0] Al2O3 0 ALIAS -composition Topaz component[1] SiO2 0 ALIAS -composition Topaz component[2] F 0 ALIAS -composition Topaz component[3] H2O 0 ALIAS -composition Topaz owner Topaz 0 VALID -composition Trinaquadalloy component[0] Ke 0 ALIAS -composition Trinaquadalloy component[1] Nq 0 ALIAS -composition Trinaquadalloy component[2] C 0 ALIAS -composition Trinaquadalloy owner Trinaquadalloy 0 VALID -composition Trinitanium component[0] Ke 0 ALIAS -composition Trinitanium component[1] Ti 0 ALIAS -composition Trinitanium owner Trinitanium 0 VALID -composition TritaniumAlloy component[0] Tn 0 ALIAS -composition TritaniumAlloy component[1] Dn 0 ALIAS -composition TritaniumAlloy owner TritaniumAlloy 0 ALIAS -composition TritaniumDioxide component[0] Tn 0 ALIAS -composition TritaniumDioxide component[1] O 0 ALIAS -composition TritaniumDioxide owner TritaniumDioxide 0 VALID -composition TritaniumHexaastatide component[0] Tn 0 ALIAS -composition TritaniumHexaastatide component[1] At 0 ALIAS -composition TritaniumHexaastatide owner TritaniumHexaastatide 0 VALID -composition TritaniumHexabromide component[0] Tn 0 ALIAS -composition TritaniumHexabromide component[1] Br 0 ALIAS -composition TritaniumHexabromide owner TritaniumHexabromide 0 VALID -composition TritaniumHexachloride component[0] Tn 0 ALIAS -composition TritaniumHexachloride component[1] Cl 0 ALIAS -composition TritaniumHexachloride owner TritaniumHexachloride 0 VALID -composition TritaniumHexafluoride component[0] Tn 0 ALIAS -composition TritaniumHexafluoride component[1] F 0 ALIAS -composition TritaniumHexafluoride owner TritaniumHexafluoride 0 VALID -composition TritaniumHexaiodide component[0] Tn 0 ALIAS -composition TritaniumHexaiodide component[1] I 0 ALIAS -composition TritaniumHexaiodide owner TritaniumHexaiodide 0 VALID -composition Trona component[0] Na2CO3 0 ALIAS -composition Trona component[1] H2O 0 ALIAS -composition Trona owner Trona 0 VALID -composition Tungstate component[0] Li 0 ALIAS -composition Tungstate component[1] WO3 0 ALIAS -composition Tungstate component[2] O 0 ALIAS -composition Tungstate owner Tungstate 0 VALID -composition TungstenCarbide component[0] W 0 ALIAS -composition TungstenCarbide component[1] C 0 ALIAS -composition TungstenCarbide owner TungstenCarbide 0 VALID -composition TungstenSintered component[0] W 0 ALIAS -composition TungstenSintered owner TungstenSintered 0 VALID -composition TungstenSteel component[0] Steel 0 VALID -composition TungstenSteel component[1] W 0 ALIAS -composition TungstenSteel owner TungstenSteel 0 ALIAS -composition U235F4 component[0] U_235 0 ALIAS -composition U235F4 component[1] F 0 ALIAS -composition U235F4 owner U235F4 0 ALIAS -composition U235F6 component[0] U_235 0 ALIAS -composition U235F6 component[1] F 0 ALIAS -composition U235F6 owner U235F6 0 ALIAS -composition U238F4 component[0] U_238 0 ALIAS -composition U238F4 component[1] F 0 ALIAS -composition U238F4 owner U238F4 0 ALIAS -composition U238F6 component[0] U_238 0 ALIAS -composition U238F6 component[1] F 0 ALIAS -composition U238F6 owner U238F6 0 ALIAS -composition UF4 component[0] U_238 0 ALIAS -composition UF4 component[1] F 0 ALIAS -composition UF4 owner UF4 0 ALIAS -composition UF6 component[0] U_238 0 ALIAS -composition UF6 component[1] F 0 ALIAS -composition UF6 owner UF6 0 ALIAS -composition Ultimet component[0] Co 0 ALIAS -composition Ultimet component[1] Ni 0 ALIAS -composition Ultimet component[2] Cr 0 ALIAS -composition Ultimet component[3] Mo 0 ALIAS -composition Ultimet owner Ultimet 0 VALID -composition Uraninite component[0] U_238 0 ALIAS -composition Uraninite component[1] O 0 ALIAS -composition Uraninite owner Uraninite 0 VALID -composition Uvarovite component[0] Ca 0 ALIAS -composition Uvarovite component[1] Cr 0 ALIAS -composition Uvarovite component[2] SiO2 0 ALIAS -composition Uvarovite component[3] O 0 ALIAS -composition Uvarovite owner Uvarovite 0 VALID -composition V2O5 component[0] V 0 ALIAS -composition V2O5 component[1] O 0 ALIAS -composition V2O5 owner V2O5 0 ALIAS -composition VanadiumGallium component[0] V 0 ALIAS -composition VanadiumGallium component[1] Ga 0 ALIAS -composition VanadiumGallium owner VanadiumGallium 0 VALID -composition VanadiumSteel component[0] Steel 0 VALID -composition VanadiumSteel component[1] V 0 ALIAS -composition VanadiumSteel owner VanadiumSteel 0 VALID -composition Vermiculite component[0] Al2O3 0 ALIAS -composition Vermiculite component[1] Fe 0 ALIAS -composition Vermiculite component[2] SiO2 0 ALIAS -composition Vermiculite component[3] H2O 0 ALIAS -composition Vermiculite component[4] H 0 ALIAS -composition Vermiculite owner Vermiculite 0 VALID -composition Vibramantium component[0] Vb 0 ALIAS -composition Vibramantium component[1] Ad 0 ALIAS -composition Vibramantium owner Vibramantium 0 VALID -composition VibraniumSilver component[0] Vb 0 ALIAS -composition VibraniumSilver component[1] Ag 0 ALIAS -composition VibraniumSilver owner VibraniumSilver 0 VALID -composition VibraniumSteel component[0] Vb 0 ALIAS -composition VibraniumSteel component[1] Steel 0 VALID -composition VibraniumSteel owner VibraniumSteel 0 VALID -composition Vinteum component[0] Ma 0 ALIAS -composition Vinteum owner Vinteum 0 RETIRED -composition VinteumPurified component[0] Ma 0 ALIAS -composition VinteumPurified owner VinteumPurified 0 RETIRED -composition Vis component[0] Ma 0 ALIAS -composition Vis owner Vis 0 RETIRED -composition VitriolOfClay component[0] Al2O3 0 ALIAS -composition VitriolOfClay component[1] S 0 ALIAS -composition VitriolOfClay component[2] O 0 ALIAS -composition VitriolOfClay owner VitriolOfClay 0 VALID -composition WO3 component[0] W 0 ALIAS -composition WO3 component[1] O 0 ALIAS -composition WO3 owner WO3 0 ALIAS -composition WhiteVitriol component[0] Zn 0 ALIAS -composition WhiteVitriol component[1] S 0 ALIAS -composition WhiteVitriol component[2] O 0 ALIAS -composition WhiteVitriol owner WhiteVitriol 0 VALID -composition Wolframite component[0] Mg 0 ALIAS -composition Wolframite component[1] WO3 0 ALIAS -composition Wolframite component[2] O 0 ALIAS -composition Wolframite owner Wolframite 0 VALID -composition Wollastonite component[0] Ca 0 ALIAS -composition Wollastonite component[1] SiO2 0 ALIAS -composition Wollastonite component[2] O 0 ALIAS -composition Wollastonite owner Wollastonite 0 VALID -composition Wood component[0] C 0 ALIAS -composition Wood component[1] H2O 0 ALIAS -composition Wood owner Wood 0 VALID -composition WoodPolished component[0] C 0 ALIAS -composition WoodPolished component[1] H2O 0 ALIAS -composition WoodPolished owner WoodPolished 0 VALID -composition WoodRubber component[0] C 0 ALIAS -composition WoodRubber component[1] H2O 0 ALIAS -composition WoodRubber owner WoodRubber 0 VALID -composition WoodTreated component[0] C 0 ALIAS -composition WoodTreated component[1] H2O 0 ALIAS -composition WoodTreated owner WoodTreated 0 VALID -composition WroughtIron component[0] Fe 0 ALIAS -composition WroughtIron owner WroughtIron 0 VALID -composition Wulfenite component[0] Pb 0 ALIAS -composition Wulfenite component[1] Mo 0 ALIAS -composition Wulfenite component[2] O 0 ALIAS -composition Wulfenite owner Wulfenite 0 VALID -composition YellowLimonite component[0] Fe 0 ALIAS -composition YellowLimonite component[1] H 0 ALIAS -composition YellowLimonite component[2] O 0 ALIAS -composition YellowLimonite owner YellowLimonite 0 VALID -composition YellowSapphire component[0] Al2O3 0 ALIAS -composition YellowSapphire component[1] TiO2 0 ALIAS -composition YellowSapphire owner YellowSapphire 0 VALID -composition YttriumBariumCuprate component[0] Y 0 ALIAS -composition YttriumBariumCuprate component[1] Ba 0 ALIAS -composition YttriumBariumCuprate component[2] Cu 0 ALIAS -composition YttriumBariumCuprate component[3] O 0 ALIAS -composition YttriumBariumCuprate owner YttriumBariumCuprate 0 VALID -composition Zeolite component[0] Al2O3 0 ALIAS -composition Zeolite component[1] Na 0 ALIAS -composition Zeolite component[2] SiO2 0 ALIAS -composition Zeolite component[3] H2O 0 ALIAS -composition Zeolite component[4] O 0 ALIAS -composition Zeolite owner Zeolite 0 VALID -composition Zircon component[0] Zr 0 ALIAS -composition Zircon component[1] SiO2 0 ALIAS -composition Zircon component[2] O 0 ALIAS -composition Zircon owner Zircon 0 VALID -decomposition Adamantine owner Adamantine 8784 VALID -decomposition Almandine owner Almandine 9101 VALID -decomposition Alumina owner Alumina 8008 VALID -decomposition AluminiumAlloy owner AluminiumAlloy 8622 VALID -decomposition AluminiumBrass owner AluminiumBrass 8700 VALID -decomposition AluminiumFluoride owner AluminiumFluoride 8010 VALID -decomposition AluminiumHydroxide owner AluminiumHydroxide 8014 VALID -decomposition Alumite owner Alumite 8702 VALID -decomposition Alunite owner Alunite 9162 VALID -decomposition Amazonite owner Amazonite 8417 VALID -decomposition Amethyst owner Amethyst 8313 VALID -decomposition Ammonia owner Ammonia 8025 VALID -decomposition Andradite owner Andradite 9102 VALID -decomposition AnnealedCopper owner AnnealedCopper 8640 VALID -decomposition Apatite owner Apatite 8209 VALID -decomposition AquaRegia owner AquaRegia 9827 VALID -decomposition Aquamarine owner Aquamarine 8323 VALID -decomposition ArsenicBronze owner ArsenicBronze 8615 VALID -decomposition ArsenicCopper owner ArsenicCopper 8614 VALID -decomposition Arsenopyrite owner Arsenopyrite 9216 VALID -decomposition Asbestos owner Asbestos 9103 VALID -decomposition Azurite owner Azurite 8420 VALID -decomposition BalasRuby owner BalasRuby 8303 VALID -decomposition Barite owner Barite 9160 VALID -decomposition Basalt owner Basalt 8505 VALID -decomposition BasalticMineralSand owner BasalticMineralSand 9003 VALID -decomposition Bastnasite owner Bastnasite 9144 VALID -decomposition BatteryAlloy owner BatteryAlloy 8668 VALID -decomposition Bauxite owner Bauxite 9105 VALID -decomposition Bentonite owner Bentonite 9153 VALID -decomposition Biotite owner Biotite 9141 VALID -decomposition Bischofite owner Bischofite 9221 VALID -decomposition BismuthBronze owner BismuthBronze 8612 VALID -decomposition Bixbite owner Bixbite 8386 VALID -decomposition BlackAventurine owner BlackAventurine 8449 VALID -decomposition BlackBronze owner BlackBronze 8611 VALID -decomposition BlackEye owner BlackEye 8434 VALID -decomposition BlackFluorite owner BlackFluorite 8440 VALID -decomposition BlackSteel owner BlackSteel 8631 VALID -decomposition BlackVitriol owner BlackVitriol 8403 VALID -decomposition BlueAlloy owner BlueAlloy 8659 VALID -decomposition BlueAventurine owner BlueAventurine 8450 VALID -decomposition BlueDiamond owner BlueDiamond 8464 VALID -decomposition BlueFluorite owner BlueFluorite 8438 VALID -decomposition BlueJasper owner BlueJasper 8427 VALID -decomposition BluePhosphorus owner BluePhosphorus 8458 VALID -decomposition BlueSapphire owner BlueSapphire 8328 VALID -decomposition BlueSteel owner BlueSteel 8632 VALID -decomposition BlueTopaz owner BlueTopaz 8307 VALID -decomposition BlueVitriol owner BlueVitriol 8404 VALID -decomposition Bone owner Bone 8219 VALID -decomposition Borax owner Borax 9139 VALID -decomposition Brass owner Brass 8620 VALID -decomposition Bromargyrite owner Bromargyrite 9210 VALID -decomposition Bronze owner Bronze 8610 VALID -decomposition BrownAventurine owner BrownAventurine 8446 VALID -decomposition BrownLimonite owner BrownLimonite 9106 VALID -decomposition Butane owner Butane 9866 VALID -decomposition Calcite owner Calcite 9107 VALID -decomposition CalciumChloride owner CalciumChloride 8028 VALID -decomposition CalciumSulfate owner CalciumSulfate 8274 VALID -decomposition CarbonDioxide owner CarbonDioxide 9836 VALID -decomposition CarbonMonoxide owner CarbonMonoxide 9838 VALID -decomposition CarbonTrioxide owner CarbonTrioxide 9843 VALID -decomposition Carborundum owner Carborundum 8003 VALID -decomposition Cassiterite owner Cassiterite 9108 VALID -decomposition CastIron owner CastIron 8803 VALID -decomposition CatsEye owner CatsEye 8431 VALID -decomposition CdInAgAlloy owner CdInAgAlloy 8605 VALID -decomposition Celestine owner Celestine 9110 VALID -decomposition Ceramic owner Ceramic 8225 VALID -decomposition Chalcopyrite owner Chalcopyrite 9111 VALID -decomposition Charcoal owner Charcoal 8336 VALID -decomposition ChloroauricAcid owner ChloroauricAcid 8400 VALID -decomposition ChloroplatinicAcid owner ChloroplatinicAcid 8401 VALID -decomposition Chocolate owner Chocolate 9783 VALID -decomposition Chromite owner Chromite 9113 VALID -decomposition ChromiumDioxide owner ChromiumDioxide 8685 VALID -decomposition Cinnabar owner Cinnabar 9114 VALID -decomposition Clay owner Clay 8215 VALID -decomposition ClayBrown owner ClayBrown 8276 VALID -decomposition ClayRed owner ClayRed 8455 VALID -decomposition Coal owner Coal 8334 VALID -decomposition CoalCoke owner CoalCoke 8349 VALID -decomposition CobaltBrass owner CobaltBrass 8621 VALID -decomposition CobaltHexahydrate owner CobaltHexahydrate 8229 VALID -decomposition Cobaltite owner Cobaltite 9115 VALID -decomposition Coltan owner Coltan 9247 VALID -decomposition Columbite owner Columbite 9246 VALID -decomposition ConductiveIron owner ConductiveIron 8727 VALID -decomposition Constantan owner Constantan 8662 VALID -decomposition Cooperite owner Cooperite 9116 VALID -decomposition Cryolite owner Cryolite 8009 VALID -decomposition CrystalMatrix owner CrystalMatrix 8799 VALID -decomposition CyanVitriol owner CyanVitriol 8408 VALID -decomposition DamascusSteel owner DamascusSteel 8634 VALID -decomposition Datolite owner Datolite 8006 VALID -decomposition Diamantine owner Diamantine 8377 RETIRED -decomposition Diamond owner Diamond 8300 VALID -decomposition DiamondIndustrial owner DiamondIndustrial 8423 VALID -decomposition Diatomite owner Diatomite 9001 VALID -decomposition DiduraniumTrioxide owner DiduraniumTrioxide 9198 VALID -decomposition Dioptase owner Dioptase 8325 VALID -decomposition DisulfuricAcid owner DisulfuricAcid 9844 VALID -decomposition DragonEye owner DragonEye 8432 VALID -decomposition Duralumin owner Duralumin 8756 VALID -decomposition Duranium owner Duranium 8751 VALID -decomposition DuraniumHexaastatide owner DuraniumHexaastatide 9203 VALID -decomposition DuraniumHexabromide owner DuraniumHexabromide 9201 VALID -decomposition DuraniumHexachloride owner DuraniumHexachloride 9200 VALID -decomposition DuraniumHexafluoride owner DuraniumHexafluoride 9199 VALID -decomposition DuraniumHexaiodide owner DuraniumHexaiodide 9202 VALID -decomposition ElectricalSteel owner ElectricalSteel 8730 VALID -decomposition ElectrotineAlloy owner ElectrotineAlloy 8658 VALID -decomposition Electrum owner Electrum 8600 VALID -decomposition ElvenElementium owner ElvenElementium 8722 VALID -decomposition Emeradic owner Emeradic 8379 RETIRED -decomposition Emerald owner Emerald 8301 VALID -decomposition EnderEye owner EnderEye 8319 VALID -decomposition EnderPearl owner EnderPearl 8318 VALID -decomposition Enderium owner Enderium 8710 VALID -decomposition EnderiumBase owner EnderiumBase 8729 VALID -decomposition EnergiumCyan owner EnergiumCyan 8299 VALID -decomposition EnergiumRed owner EnergiumRed 8298 VALID -decomposition Enori owner Enori 8380 RETIRED -decomposition Ethylene owner Ethylene 9868 VALID -decomposition Eudialyte owner Eudialyte 8421 VALID -decomposition Ferberite owner Ferberite 9194 VALID -decomposition FerricChloride owner FerricChloride 8017 VALID -decomposition FerricOxyhydroxide owner FerricOxyhydroxide 8035 VALID -decomposition FerrousChloride owner FerrousChloride 8030 VALID -decomposition FierySteel owner FierySteel 8675 VALID -decomposition Fireleaf owner Fireleaf 8698 VALID -decomposition FlamascusSteel owner FlamascusSteel 8697 VALID -decomposition Flint owner Flint 8002 VALID -decomposition Fluorite owner Fluorite 9215 VALID -decomposition GaiaSpirit owner GaiaSpirit 8735 VALID -decomposition Galena owner Galena 9117 VALID -decomposition GarnetSand owner GarnetSand 9005 VALID -decomposition Garnierite owner Garnierite 9118 VALID -decomposition Glass owner Glass 8001 VALID -decomposition Glauconite owner Glauconite 9150 VALID -decomposition Glowstone owner Glowstone 8341 VALID -decomposition Glycerol owner Glycerol 9828 VALID -decomposition Glyceryl owner Glyceryl 9821 VALID -decomposition Goshenite owner Goshenite 8385 VALID -decomposition Granite owner Granite 8518 VALID -decomposition GraniteBlack owner GraniteBlack 8508 VALID -decomposition GraniteRed owner GraniteRed 8507 VALID -decomposition GraniticMineralSand owner GraniticMineralSand 9004 VALID -decomposition Graphene owner Graphene 9175 VALID -decomposition Graphite owner Graphite 9174 VALID -decomposition GrayVitriol owner GrayVitriol 8410 VALID -decomposition GreenAventurine owner GreenAventurine 8448 VALID -decomposition GreenDiamond owner GreenDiamond 8465 VALID -decomposition GreenFluorite owner GreenFluorite 8439 VALID -decomposition GreenJasper owner GreenJasper 8428 VALID -decomposition GreenSapphire owner GreenSapphire 8305 VALID -decomposition GreenVitriol owner GreenVitriol 8405 VALID -decomposition Grossular owner Grossular 9119 VALID -decomposition Gypsum owner Gypsum 9161 VALID -decomposition HSSE owner HSSE 8797 VALID -decomposition HSSG owner HSSG 8796 VALID -decomposition HSSS owner HSSS 8798 VALID -decomposition HawksEye owner HawksEye 8433 VALID -decomposition HeavyWater owner HeavyWater 9812 VALID -decomposition Heliodor owner Heliodor 8384 VALID -decomposition HeliumNeon owner HeliumNeon 9839 VALID -decomposition Hematite owner Hematite 9104 VALID -decomposition HexafluorosilicicAcid owner HexafluorosilicicAcid 8011 VALID -decomposition Huebnerite owner Huebnerite 9195 VALID -decomposition HydratedCoal owner HydratedCoal 8335 VALID -decomposition HydrochloricAcid owner HydrochloricAcid 9826 VALID -decomposition HydrogenBorate owner HydrogenBorate 8007 VALID -decomposition HydrogenFluoride owner HydrogenFluoride 9829 VALID -decomposition HydrogenPeroxide owner HydrogenPeroxide 9809 VALID -decomposition HydrosulfuricAcid owner HydrosulfuricAcid 8024 VALID -decomposition Ilmenite owner Ilmenite 9120 VALID -decomposition Invar owner Invar 8661 VALID -decomposition IodineSalt owner IodineSalt 8242 VALID -decomposition Ironwood owner Ironwood 8672 VALID -decomposition Kanthal owner Kanthal 8664 VALID -decomposition Kaolinite owner Kaolinite 9167 VALID -decomposition Kesterite owner Kesterite 9213 VALID -decomposition Knightmetal owner Knightmetal 8674 VALID -decomposition Komatiite owner Komatiite 9177 VALID -decomposition Kyanite owner Kyanite 9166 VALID -decomposition Lapis owner Lapis 8332 VALID -decomposition Lazurite owner Lazurite 8330 VALID -decomposition Lepidolite owner Lepidolite 9149 VALID -decomposition Lignite owner Lignite 8337 VALID -decomposition LigniteCoke owner LigniteCoke 8365 VALID -decomposition Limestone owner Limestone 9189 VALID -decomposition LithiumChlorate owner LithiumChlorate 8033 VALID -decomposition LithiumChloride owner LithiumChloride 8029 VALID -decomposition LithiumHydroxide owner LithiumHydroxide 8032 VALID -decomposition LithiumPerchlorate owner LithiumPerchlorate 8034 VALID -decomposition LiveRoot owner LiveRoot 8223 VALID -decomposition Lumium owner Lumium 8709 VALID -decomposition MagentaFluorite owner MagentaFluorite 8444 VALID -decomposition Magnalium owner Magnalium 8665 VALID -decomposition MagnesiumCarbonate owner MagnesiumCarbonate 8016 VALID -decomposition MagnesiumChloride owner MagnesiumChloride 8018 VALID -decomposition Magnetite owner Magnetite 9122 VALID -decomposition Malachite owner Malachite 9156 VALID -decomposition ManaDiamond owner ManaDiamond 8278 VALID -decomposition Manasteel owner Manasteel 8720 VALID -decomposition ManganeseChloride owner ManganeseChloride 8031 VALID -decomposition Marble owner Marble 8506 VALID -decomposition Maxixe owner Maxixe 8387 VALID -decomposition Methane owner Methane 9832 VALID -decomposition MethaneIce owner MethaneIce 9833 VALID -decomposition Mica owner Mica 9158 VALID -decomposition Mirabilite owner Mirabilite 9157 VALID -decomposition Molybdenite owner Molybdenite 9123 VALID -decomposition Monazite owner Monazite 8338 VALID -decomposition Morganite owner Morganite 8324 VALID -decomposition Netherite owner Netherite 8745 VALID -decomposition NetherizedDiamond owner NetherizedDiamond 8746 VALID -decomposition Nichrome owner Nichrome 8663 VALID -decomposition NikolineAlloy owner NikolineAlloy 8737 VALID -decomposition Nikolite owner Nikolite 8340 VALID -decomposition NiobiumPentoxide owner NiobiumPentoxide 8461 VALID -decomposition NiobiumTitanium owner NiobiumTitanium 8689 VALID -decomposition Niter owner Niter 8206 VALID -decomposition NitricAcid owner NitricAcid 9825 VALID -decomposition NitroCarbon owner NitroCarbon 9820 VALID -decomposition NitrogenDioxide owner NitrogenDioxide 9831 VALID -decomposition NitrogenMonoxide owner NitrogenMonoxide 9837 VALID -decomposition Obsidian owner Obsidian 8214 VALID -decomposition OceanJasper owner OceanJasper 8425 VALID -decomposition OilShale owner OilShale 9853 VALID -decomposition OnyxBlack owner OnyxBlack 8416 VALID -decomposition OnyxRed owner OnyxRed 8415 VALID -decomposition Opal owner Opal 8312 VALID -decomposition OrangeFluorite owner OrangeFluorite 8443 VALID -decomposition OrangeSapphire owner OrangeSapphire 8314 VALID -decomposition Osmiridium owner Osmiridium 8682 VALID -decomposition Palis owner Palis 8376 RETIRED -decomposition Palygorskite owner Palygorskite 9154 VALID -decomposition Pentlandite owner Pentlandite 9145 VALID -decomposition Peridot owner Peridot 8311 VALID -decomposition Perlite owner Perlite 9138 VALID -decomposition PetroleumCoke owner PetroleumCoke 8390 VALID -decomposition Petrotheum owner Petrotheum 8245 RETIRED -decomposition Phosphate owner Phosphate 8207 VALID -decomposition Phosphorite owner Phosphorite 8226 VALID -decomposition Phosphorus owner Phosphorus 8208 VALID -decomposition Pinalite owner Pinalite 9197 VALID -decomposition PinkDiamond owner PinkDiamond 8424 VALID -decomposition PinkFluorite owner PinkFluorite 8437 VALID -decomposition PinkVitriol owner PinkVitriol 8407 VALID -decomposition Pitchblende owner Pitchblende 9155 VALID -decomposition Pollucite owner Pollucite 9147 VALID -decomposition Porcelain owner Porcelain 8273 VALID -decomposition PotassiumAluminate owner PotassiumAluminate 8023 VALID -decomposition PotassiumBisulfate owner PotassiumBisulfate 8232 VALID -decomposition PotassiumCarbonate owner PotassiumCarbonate 8020 VALID -decomposition PotassiumFeldspar owner PotassiumFeldspar 9140 VALID -decomposition PotassiumFluoride owner PotassiumFluoride 8036 VALID -decomposition PotassiumHeptafluorotantalate owner PotassiumHeptafluorotantalate 8038 VALID -decomposition PotassiumHydroxide owner PotassiumHydroxide 8015 VALID -decomposition PotassiumNitrate owner PotassiumNitrate 8205 VALID -decomposition PotassiumPersulfate owner PotassiumPersulfate 8022 VALID -decomposition PotassiumPyrosulfate owner PotassiumPyrosulfate 8233 VALID -decomposition PotassiumSulfate owner PotassiumSulfate 8271 VALID -decomposition PotassiumSulfide owner PotassiumSulfide 8272 VALID -decomposition PotassiumSulfite owner PotassiumSulfite 8021 VALID -decomposition Powellite owner Powellite 9124 VALID -decomposition Propane owner Propane 9865 VALID -decomposition Propylene owner Propylene 9867 VALID -decomposition Pumice owner Pumice 9000 VALID -decomposition PurpleSapphire owner PurpleSapphire 8383 VALID -decomposition Pyrite owner Pyrite 9125 VALID -decomposition Pyrolusite owner Pyrolusite 9126 VALID -decomposition Pyrope owner Pyrope 9127 VALID -decomposition Pyrotheum owner Pyrotheum 8212 RETIRED -decomposition QuartzSand owner QuartzSand 9006 VALID -decomposition Quicklime owner Quicklime 9271 VALID -decomposition RainforestJasper owner RainforestJasper 8426 VALID -decomposition Realgar owner Realgar 9109 VALID -decomposition RedAlloy owner RedAlloy 8660 VALID -decomposition RedAventurine owner RedAventurine 8451 VALID -decomposition RedDiamond owner RedDiamond 8467 VALID -decomposition RedFluorite owner RedFluorite 8436 VALID -decomposition RedJasper owner RedJasper 8309 VALID -decomposition RedPhosphorus owner RedPhosphorus 8459 VALID -decomposition RedSteel owner RedSteel 8633 VALID -decomposition RedVitriol owner RedVitriol 8406 VALID -decomposition Redstone owner Redstone 8333 VALID -decomposition RedstoneAlloy owner RedstoneAlloy 8733 VALID -decomposition Redstonia owner Redstonia 8375 RETIRED -decomposition RoseGold owner RoseGold 8602 VALID -decomposition Ruby owner Ruby 8302 VALID -decomposition Russellite owner Russellite 9196 VALID -decomposition Rutile owner Rutile 9192 VALID -decomposition Salt owner Salt 8204 VALID -decomposition SaltedWater owner SaltedWater 9815 VALID -decomposition Saltwater owner Saltwater 9804 VALID -decomposition Sapphire owner Sapphire 8304 VALID -decomposition Scheelite owner Scheelite 9128 VALID -decomposition SemiheavyWater owner SemiheavyWater 9811 VALID -decomposition Shale owner Shale 9190 VALID -decomposition Signalum owner Signalum 8708 VALID -decomposition SiliconDioxide owner SiliconDioxide 8000 VALID -decomposition SkyStone owner SkyStone 8528 VALID -decomposition Smithsonite owner Smithsonite 9211 VALID -decomposition Sodalite owner Sodalite 8331 VALID -decomposition SodiumAluminate owner SodiumAluminate 8012 VALID -decomposition SodiumBisulfate owner SodiumBisulfate 8230 VALID -decomposition SodiumCarbonate owner SodiumCarbonate 8013 VALID -decomposition SodiumFluoride owner SodiumFluoride 8037 VALID -decomposition SodiumHydrogencarbonate owner SodiumHydrogencarbonate 8039 VALID -decomposition SodiumHydroxide owner SodiumHydroxide 8268 VALID -decomposition SodiumNitrate owner SodiumNitrate 8019 VALID -decomposition SodiumPersulfate owner SodiumPersulfate 9822 VALID -decomposition SodiumPyrosulfate owner SodiumPyrosulfate 8231 VALID -decomposition SodiumSulfate owner SodiumSulfate 8270 VALID -decomposition SodiumSulfide owner SodiumSulfide 9823 VALID -decomposition SodiumSulfite owner SodiumSulfite 8269 VALID -decomposition SolderingAlloy owner SolderingAlloy 8669 VALID -decomposition Soularium owner Soularium 8732 VALID -decomposition Sperrylite owner Sperrylite 9212 VALID -decomposition Spessartine owner Spessartine 9129 VALID -decomposition Sphalerite owner Sphalerite 9130 VALID -decomposition Spinel owner Spinel 8326 VALID -decomposition Spodumene owner Spodumene 9146 VALID -decomposition StainlessSteel owner StainlessSteel 8636 VALID -decomposition StannicChloride owner StannicChloride 8402 VALID -decomposition Stannite owner Stannite 9214 VALID -decomposition Steam owner Steam 9814 VALID -decomposition Steel owner Steel 8630 VALID -decomposition SteelGalvanized owner SteelGalvanized 8651 VALID -decomposition Steeleaf owner Steeleaf 8673 VALID -decomposition SterlingSilver owner SterlingSilver 8601 VALID -decomposition Stibnite owner Stibnite 9131 VALID -decomposition Stolzite owner Stolzite 9193 VALID -decomposition Sugar owner Sugar 9703 VALID -decomposition SulfurDioxide owner SulfurDioxide 9834 VALID -decomposition SulfurTrioxide owner SulfurTrioxide 9835 VALID -decomposition SulfuricAcid owner SulfuricAcid 9824 VALID -decomposition Sylvite owner Sylvite 8203 VALID -decomposition Talc owner Talc 9169 VALID -decomposition Tantalite owner Tantalite 9148 VALID -decomposition TantalumHafniumCarbide owner TantalumHafniumCarbide 8802 VALID -decomposition TantalumPentoxide owner TantalumPentoxide 8462 VALID -decomposition Tanzanite owner Tanzanite 8308 VALID -decomposition Terrasteel owner Terrasteel 8721 VALID -decomposition Tetrahedrite owner Tetrahedrite 9132 VALID -decomposition Thaumium owner Thaumium 8679 VALID -decomposition TigerEye owner TigerEye 8430 VALID -decomposition TigerIron owner TigerIron 8435 VALID -decomposition TinAlloy owner TinAlloy 8667 VALID -decomposition TitaniumIridium owner TitaniumIridium 8793 VALID -decomposition TitaniumTetrachloride owner TitaniumTetrachloride 8413 VALID -decomposition Topaz owner Topaz 8306 VALID -decomposition Trinaquadalloy owner Trinaquadalloy 8684 VALID -decomposition Trinitanium owner Trinitanium 8790 VALID -decomposition Tritanium owner Tritanium 8752 VALID -decomposition TritaniumDioxide owner TritaniumDioxide 9204 VALID -decomposition TritaniumHexaastatide owner TritaniumHexaastatide 9209 VALID -decomposition TritaniumHexabromide owner TritaniumHexabromide 9207 VALID -decomposition TritaniumHexachloride owner TritaniumHexachloride 9206 VALID -decomposition TritaniumHexafluoride owner TritaniumHexafluoride 9205 VALID -decomposition TritaniumHexaiodide owner TritaniumHexaiodide 9208 VALID -decomposition TritiatedWater owner TritiatedWater 9813 VALID -decomposition Trona owner Trona 9159 VALID -decomposition Tungstate owner Tungstate 9133 VALID -decomposition TungstenCarbide owner TungstenCarbide 8638 VALID -decomposition TungstenSintered owner TungstenSintered 8652 VALID -decomposition TungstenTrioxide owner TungstenTrioxide 8026 VALID -decomposition Tungstensteel owner Tungstensteel 8635 VALID -decomposition TungsticAcid owner TungsticAcid 8027 VALID -decomposition Ultimet owner Ultimet 8666 VALID -decomposition Uraninite owner Uraninite 9134 VALID -decomposition Uranium235Hexafluoride owner Uranium235Hexafluoride 9012 VALID -decomposition Uranium235Tetrafluoride owner Uranium235Tetrafluoride 9011 VALID -decomposition Uranium238Hexafluoride owner Uranium238Hexafluoride 9010 VALID -decomposition Uranium238Tetrafluoride owner Uranium238Tetrafluoride 9009 VALID -decomposition UraniumHexafluoride owner UraniumHexafluoride 9008 VALID -decomposition UraniumTetrafluoride owner UraniumTetrafluoride 9007 VALID -decomposition Uvarovite owner Uvarovite 9135 VALID -decomposition VanadiumGallium owner VanadiumGallium 8686 VALID -decomposition VanadiumMagnetite owner VanadiumMagnetite 9143 VALID -decomposition VanadiumPentoxide owner VanadiumPentoxide 8234 VALID -decomposition VanadiumSteel owner VanadiumSteel 8653 VALID -decomposition Vermiculite owner Vermiculite 9152 VALID -decomposition Vibramantium owner Vibramantium 8706 VALID -decomposition VibraniumSilver owner VibraniumSilver 8705 VALID -decomposition VibraniumSteel owner VibraniumSteel 8704 VALID -decomposition VibrantAlloy owner VibrantAlloy 8726 VALID -decomposition Vinteum owner Vinteum 8316 RETIRED -decomposition VinteumPurified owner VinteumPurified 8327 RETIRED -decomposition VitriolOfClay owner VitriolOfClay 8412 VALID -decomposition VoidCrystal owner VoidCrystal 8378 RETIRED -decomposition Water owner Water 9800 VALID -decomposition WaterDistilled owner WaterDistilled 9808 VALID -decomposition WhiteFluorite owner WhiteFluorite 8441 VALID -decomposition WhitePhosphorus owner WhitePhosphorus 8460 VALID -decomposition WhiteVitriol owner WhiteVitriol 8409 VALID -decomposition Wolframite owner Wolframite 9217 VALID -decomposition Wollastonite owner Wollastonite 9164 VALID -decomposition WroughtIron owner WroughtIron 8643 VALID -decomposition Wulfenite owner Wulfenite 9136 VALID -decomposition YellowAventurine owner YellowAventurine 8447 VALID -decomposition YellowDiamond owner YellowDiamond 8468 VALID -decomposition YellowFluorite owner YellowFluorite 8442 VALID -decomposition YellowJasper owner YellowJasper 8429 VALID -decomposition YellowLimonite owner YellowLimonite 9137 VALID -decomposition YellowSapphire owner YellowSapphire 8315 VALID -decomposition YttriumBariumCuprate owner YttriumBariumCuprate 8687 VALID -decomposition Zeolite owner Zeolite 9165 VALID -decomposition Zircon owner Zircon 8419 VALID -forms 10 owner 10 VALID -forms 100 owner 100 VALID -forms 1000 owner 1000 VALID -forms 1010 owner 1010 VALID -forms 1020 owner 1020 VALID -forms 1030 owner 1030 VALID -forms 1040 owner 1040 VALID -forms 1050 owner 1050 VALID -forms 1060 owner 1060 VALID -forms 1070 owner 1070 VALID -forms 1080 owner 1080 VALID -forms 1090 owner 1090 VALID -forms 11 owner 11 VALID -forms 110 owner 110 VALID -forms 1100 owner 1100 VALID -forms 1110 owner 1110 VALID -forms 1120 owner 1120 VALID -forms 1130 owner 1130 VALID -forms 1140 owner 1140 VALID -forms 1148 owner 1148 VALID -forms 1150 owner 1150 VALID -forms 1160 owner 1160 VALID -forms 1170 owner 1170 VALID -forms 1180 owner 1180 VALID -forms 12 owner 12 VALID -forms 120 owner 120 VALID -forms 1250 owner 1250 VALID -forms 1260 owner 1260 VALID -forms 130 owner 130 VALID -forms 140 owner 140 VALID -forms 1450 owner 1450 VALID -forms 150 owner 150 VALID -forms 1520 owner 1520 VALID -forms 160 owner 160 VALID -forms 170 owner 170 VALID -forms 1740 owner 1740 VALID -forms 1741 owner 1741 VALID -forms 1742 owner 1742 VALID -forms 180 owner 180 VALID -forms 190 owner 190 VALID -forms 20 owner 20 VALID -forms 200 owner 200 VALID -forms 21 owner 21 VALID -forms 210 owner 210 VALID -forms 220 owner 220 VALID -forms 2220 owner 2220 VALID -forms 230 owner 230 VALID -forms 240 owner 240 VALID -forms 250 owner 250 VALID -forms 260 owner 260 VALID -forms 270 owner 270 VALID -forms 278 owner 278 VALID -forms 280 owner 280 VALID -forms 290 owner 290 VALID -forms 30 owner 30 VALID -forms 300 owner 300 VALID -forms 31 owner 31 VALID -forms 310 owner 310 VALID -forms 320 owner 320 VALID -forms 330 owner 330 VALID -forms 340 owner 340 VALID -forms 350 owner 350 VALID -forms 360 owner 360 VALID -forms 370 owner 370 VALID -forms 3720 owner 3720 VALID -forms 380 owner 380 VALID -forms 390 owner 390 VALID -forms 40 owner 40 VALID -forms 400 owner 400 VALID -forms 41 owner 41 VALID -forms 410 owner 410 VALID -forms 42 owner 42 VALID -forms 420 owner 420 VALID -forms 430 owner 430 VALID -forms 440 owner 440 VALID -forms 450 owner 450 VALID -forms 460 owner 460 VALID -forms 470 owner 470 VALID -forms 480 owner 480 VALID -forms 490 owner 490 VALID -forms 50 owner 50 VALID -forms 500 owner 500 VALID -forms 51 owner 51 VALID -forms 510 owner 510 VALID -forms 520 owner 520 VALID -forms 530 owner 530 VALID -forms 540 owner 540 VALID -forms 550 owner 550 VALID -forms 560 owner 560 VALID -forms 570 owner 570 VALID -forms 580 owner 580 VALID -forms 590 owner 590 VALID -forms 60 owner 60 VALID -forms 600 owner 600 VALID -forms 61 owner 61 VALID -forms 610 owner 610 VALID -forms 62 owner 62 VALID -forms 620 owner 620 VALID -forms 630 owner 630 VALID -forms 640 owner 640 VALID -forms 650 owner 650 VALID -forms 660 owner 660 VALID -forms 670 owner 670 VALID -forms 680 owner 680 VALID -forms 690 owner 690 VALID -forms 70 owner 70 VALID -forms 700 owner 700 VALID -forms 710 owner 710 VALID -forms 720 owner 720 VALID -forms 730 owner 730 VALID -forms 740 owner 740 VALID -forms 750 owner 750 VALID -forms 760 owner 760 VALID -forms 770 owner 770 VALID -forms 780 owner 780 VALID -forms 790 owner 790 VALID -forms 791 owner 791 VALID -forms 80 owner 80 VALID -forms 800 owner 800 VALID -forms 8000 owner 8000 VALID -forms 8001 owner 8001 VALID -forms 8002 owner 8002 VALID -forms 8003 owner 8003 VALID -forms 8006 owner 8006 VALID -forms 8007 owner 8007 VALID -forms 8008 owner 8008 VALID -forms 8009 owner 8009 VALID -forms 8010 owner 8010 VALID -forms 8011 owner 8011 VALID -forms 8012 owner 8012 VALID -forms 8013 owner 8013 VALID -forms 8014 owner 8014 VALID -forms 8015 owner 8015 VALID -forms 8016 owner 8016 VALID -forms 8017 owner 8017 VALID -forms 8018 owner 8018 VALID -forms 8019 owner 8019 VALID -forms 8020 owner 8020 VALID -forms 8021 owner 8021 VALID -forms 8022 owner 8022 VALID -forms 8023 owner 8023 VALID -forms 8024 owner 8024 VALID -forms 8025 owner 8025 VALID -forms 8026 owner 8026 VALID -forms 8027 owner 8027 VALID -forms 8028 owner 8028 VALID -forms 8029 owner 8029 VALID -forms 8030 owner 8030 VALID -forms 8031 owner 8031 VALID -forms 8032 owner 8032 VALID -forms 8033 owner 8033 VALID -forms 8034 owner 8034 VALID -forms 8035 owner 8035 VALID -forms 8036 owner 8036 VALID -forms 8037 owner 8037 VALID -forms 8038 owner 8038 VALID -forms 8039 owner 8039 VALID -forms 810 owner 810 VALID -forms 8100 owner 8100 VALID -forms 8101 owner 8101 VALID -forms 8102 owner 8102 VALID -forms 8103 owner 8103 VALID -forms 8104 owner 8104 VALID -forms 8196 owner 8196 VALID -forms 8197 owner 8197 VALID -forms 820 owner 820 VALID -forms 8200 owner 8200 VALID -forms 8201 owner 8201 VALID -forms 8203 owner 8203 VALID -forms 8204 owner 8204 VALID -forms 8205 owner 8205 VALID -forms 8206 owner 8206 VALID -forms 8207 owner 8207 VALID -forms 8208 owner 8208 VALID -forms 8209 owner 8209 VALID -forms 8210 owner 8210 VALID -forms 8211 owner 8211 VALID -forms 8212 owner 8212 RETIRED -forms 8213 owner 8213 RETIRED -forms 8214 owner 8214 VALID -forms 8215 owner 8215 VALID -forms 8216 owner 8216 VALID -forms 8217 owner 8217 VALID -forms 8218 owner 8218 VALID -forms 8219 owner 8219 VALID -forms 8220 owner 8220 VALID -forms 8221 owner 8221 VALID -forms 8222 owner 8222 VALID -forms 8223 owner 8223 VALID -forms 8224 owner 8224 VALID -forms 8225 owner 8225 VALID -forms 8226 owner 8226 VALID -forms 8229 owner 8229 VALID -forms 8230 owner 8230 VALID -forms 8231 owner 8231 VALID -forms 8232 owner 8232 VALID -forms 8233 owner 8233 VALID -forms 8234 owner 8234 VALID -forms 8235 owner 8235 VALID -forms 8236 owner 8236 VALID -forms 8238 owner 8238 VALID -forms 8239 owner 8239 VALID -forms 8242 owner 8242 VALID -forms 8245 owner 8245 RETIRED -forms 8246 owner 8246 RETIRED -forms 8247 owner 8247 VALID -forms 8248 owner 8248 VALID -forms 8249 owner 8249 VALID -forms 8250 owner 8250 VALID -forms 8251 owner 8251 VALID -forms 8252 owner 8252 VALID -forms 8253 owner 8253 VALID -forms 8254 owner 8254 VALID -forms 8255 owner 8255 VALID -forms 8256 owner 8256 VALID -forms 8257 owner 8257 VALID -forms 8258 owner 8258 VALID -forms 8259 owner 8259 VALID -forms 8260 owner 8260 VALID -forms 8261 owner 8261 VALID -forms 8262 owner 8262 VALID -forms 8263 owner 8263 VALID -forms 8264 owner 8264 VALID -forms 8265 owner 8265 VALID -forms 8266 owner 8266 VALID -forms 8267 owner 8267 VALID -forms 8268 owner 8268 VALID -forms 8269 owner 8269 VALID -forms 8270 owner 8270 VALID -forms 8271 owner 8271 VALID -forms 8272 owner 8272 VALID -forms 8273 owner 8273 VALID -forms 8274 owner 8274 VALID -forms 8275 owner 8275 VALID -forms 8276 owner 8276 VALID -forms 8277 owner 8277 VALID -forms 8278 owner 8278 VALID -forms 8289 owner 8289 VALID -forms 8290 owner 8290 VALID -forms 8296 owner 8296 VALID -forms 8297 owner 8297 VALID -forms 8298 owner 8298 VALID -forms 8299 owner 8299 VALID -forms 830 owner 830 VALID -forms 8300 owner 8300 VALID -forms 8301 owner 8301 VALID -forms 8302 owner 8302 VALID -forms 8303 owner 8303 VALID -forms 8304 owner 8304 VALID -forms 8305 owner 8305 VALID -forms 8306 owner 8306 VALID -forms 8307 owner 8307 VALID -forms 8308 owner 8308 VALID -forms 8309 owner 8309 VALID -forms 8310 owner 8310 VALID -forms 8311 owner 8311 VALID -forms 8312 owner 8312 VALID -forms 8313 owner 8313 VALID -forms 8314 owner 8314 VALID -forms 8315 owner 8315 VALID -forms 8316 owner 8316 RETIRED -forms 8318 owner 8318 VALID -forms 8319 owner 8319 VALID -forms 8320 owner 8320 VALID -forms 8321 owner 8321 VALID -forms 8322 owner 8322 VALID -forms 8323 owner 8323 VALID -forms 8324 owner 8324 VALID -forms 8325 owner 8325 VALID -forms 8326 owner 8326 VALID -forms 8327 owner 8327 RETIRED -forms 8328 owner 8328 VALID -forms 8330 owner 8330 VALID -forms 8331 owner 8331 VALID -forms 8332 owner 8332 VALID -forms 8333 owner 8333 VALID -forms 8334 owner 8334 VALID -forms 8335 owner 8335 VALID -forms 8336 owner 8336 VALID -forms 8337 owner 8337 VALID -forms 8338 owner 8338 VALID -forms 8340 owner 8340 VALID -forms 8341 owner 8341 VALID -forms 8346 owner 8346 VALID -forms 8347 owner 8347 VALID -forms 8348 owner 8348 VALID -forms 8349 owner 8349 VALID -forms 8360 owner 8360 VALID -forms 8365 owner 8365 VALID -forms 8375 owner 8375 RETIRED -forms 8376 owner 8376 RETIRED -forms 8377 owner 8377 RETIRED -forms 8378 owner 8378 RETIRED -forms 8379 owner 8379 RETIRED -forms 8380 owner 8380 RETIRED -forms 8383 owner 8383 VALID -forms 8384 owner 8384 VALID -forms 8385 owner 8385 VALID -forms 8386 owner 8386 VALID -forms 8387 owner 8387 VALID -forms 8389 owner 8389 VALID -forms 8390 owner 8390 VALID -forms 8393 owner 8393 VALID -forms 8395 owner 8395 VALID -forms 8396 owner 8396 VALID -forms 8397 owner 8397 VALID -forms 8398 owner 8398 VALID -forms 8399 owner 8399 VALID -forms 840 owner 840 VALID -forms 8400 owner 8400 VALID -forms 8401 owner 8401 VALID -forms 8402 owner 8402 VALID -forms 8403 owner 8403 VALID -forms 8404 owner 8404 VALID -forms 8405 owner 8405 VALID -forms 8406 owner 8406 VALID -forms 8407 owner 8407 VALID -forms 8408 owner 8408 VALID -forms 8409 owner 8409 VALID -forms 8410 owner 8410 VALID -forms 8412 owner 8412 VALID -forms 8413 owner 8413 VALID -forms 8415 owner 8415 VALID -forms 8416 owner 8416 VALID -forms 8417 owner 8417 VALID -forms 8418 owner 8418 VALID -forms 8419 owner 8419 VALID -forms 8420 owner 8420 VALID -forms 8421 owner 8421 VALID -forms 8422 owner 8422 VALID -forms 8423 owner 8423 VALID -forms 8424 owner 8424 VALID -forms 8425 owner 8425 VALID -forms 8426 owner 8426 VALID -forms 8427 owner 8427 VALID -forms 8428 owner 8428 VALID -forms 8429 owner 8429 VALID -forms 8430 owner 8430 VALID -forms 8431 owner 8431 VALID -forms 8432 owner 8432 VALID -forms 8433 owner 8433 VALID -forms 8434 owner 8434 VALID -forms 8435 owner 8435 VALID -forms 8436 owner 8436 VALID -forms 8437 owner 8437 VALID -forms 8438 owner 8438 VALID -forms 8439 owner 8439 VALID -forms 8440 owner 8440 VALID -forms 8441 owner 8441 VALID -forms 8442 owner 8442 VALID -forms 8443 owner 8443 VALID -forms 8444 owner 8444 VALID -forms 8445 owner 8445 VALID -forms 8446 owner 8446 VALID -forms 8447 owner 8447 VALID -forms 8448 owner 8448 VALID -forms 8449 owner 8449 VALID -forms 8450 owner 8450 VALID -forms 8451 owner 8451 VALID -forms 8452 owner 8452 RETIRED -forms 8453 owner 8453 RETIRED -forms 8455 owner 8455 VALID -forms 8458 owner 8458 VALID -forms 8459 owner 8459 VALID -forms 8460 owner 8460 VALID -forms 8461 owner 8461 VALID -forms 8462 owner 8462 VALID -forms 8464 owner 8464 VALID -forms 8465 owner 8465 VALID -forms 8467 owner 8467 VALID -forms 8468 owner 8468 VALID -forms 8470 owner 8470 VALID -forms 8471 owner 8471 VALID -forms 850 owner 850 VALID -forms 8500 owner 8500 VALID -forms 8501 owner 8501 VALID -forms 8502 owner 8502 VALID -forms 8503 owner 8503 VALID -forms 8504 owner 8504 VALID -forms 8505 owner 8505 VALID -forms 8506 owner 8506 VALID -forms 8507 owner 8507 VALID -forms 8508 owner 8508 VALID -forms 8511 owner 8511 VALID -forms 8516 owner 8516 VALID -forms 8518 owner 8518 VALID -forms 8521 owner 8521 VALID -forms 8528 owner 8528 VALID -forms 8599 owner 8599 VALID -forms 860 owner 860 VALID -forms 8600 owner 8600 VALID -forms 8601 owner 8601 VALID -forms 8602 owner 8602 VALID -forms 8605 owner 8605 VALID -forms 8610 owner 8610 VALID -forms 8611 owner 8611 VALID -forms 8612 owner 8612 VALID -forms 8614 owner 8614 VALID -forms 8615 owner 8615 VALID -forms 8620 owner 8620 VALID -forms 8621 owner 8621 VALID -forms 8622 owner 8622 VALID -forms 8630 owner 8630 VALID -forms 8631 owner 8631 VALID -forms 8632 owner 8632 VALID -forms 8633 owner 8633 VALID -forms 8634 owner 8634 VALID -forms 8635 owner 8635 VALID -forms 8636 owner 8636 VALID -forms 8638 owner 8638 VALID -forms 8640 owner 8640 VALID -forms 8643 owner 8643 VALID -forms 8645 owner 8645 VALID -forms 8646 owner 8646 VALID -forms 8647 owner 8647 VALID -forms 8651 owner 8651 VALID -forms 8652 owner 8652 VALID -forms 8653 owner 8653 VALID -forms 8658 owner 8658 VALID -forms 8659 owner 8659 VALID -forms 8660 owner 8660 VALID -forms 8661 owner 8661 VALID -forms 8662 owner 8662 VALID -forms 8663 owner 8663 VALID -forms 8664 owner 8664 VALID -forms 8665 owner 8665 VALID -forms 8666 owner 8666 VALID -forms 8667 owner 8667 VALID -forms 8668 owner 8668 VALID -forms 8669 owner 8669 VALID -forms 8672 owner 8672 VALID -forms 8673 owner 8673 VALID -forms 8674 owner 8674 VALID -forms 8675 owner 8675 VALID -forms 8679 owner 8679 VALID -forms 8682 owner 8682 VALID -forms 8684 owner 8684 VALID -forms 8685 owner 8685 VALID -forms 8686 owner 8686 VALID -forms 8687 owner 8687 VALID -forms 8689 owner 8689 VALID -forms 8697 owner 8697 VALID -forms 8698 owner 8698 VALID -forms 870 owner 870 VALID -forms 8700 owner 8700 VALID -forms 8702 owner 8702 VALID -forms 8704 owner 8704 VALID -forms 8705 owner 8705 VALID -forms 8706 owner 8706 VALID -forms 8708 owner 8708 VALID -forms 8709 owner 8709 VALID -forms 8710 owner 8710 VALID -forms 8717 owner 8717 VALID -forms 8720 owner 8720 VALID -forms 8721 owner 8721 VALID -forms 8722 owner 8722 VALID -forms 8726 owner 8726 VALID -forms 8727 owner 8727 VALID -forms 8729 owner 8729 VALID -forms 8730 owner 8730 VALID -forms 8732 owner 8732 VALID -forms 8733 owner 8733 VALID -forms 8735 owner 8735 VALID -forms 8737 owner 8737 VALID -forms 8744 owner 8744 VALID -forms 8745 owner 8745 VALID -forms 8746 owner 8746 VALID -forms 8751 owner 8751 VALID -forms 8752 owner 8752 VALID -forms 8756 owner 8756 VALID -forms 8784 owner 8784 VALID -forms 8790 owner 8790 VALID -forms 8791 owner 8791 VALID -forms 8792 owner 8792 VALID -forms 8795 owner 8795 RETIRED -forms 8796 owner 8796 VALID -forms 8797 owner 8797 VALID -forms 8798 owner 8798 VALID -forms 8799 owner 8799 VALID -forms 880 owner 880 VALID -forms 8800 owner 8800 VALID -forms 8801 owner 8801 VALID -forms 8802 owner 8802 VALID -forms 8803 owner 8803 VALID -forms 8805 owner 8805 RETIRED -forms 8813 owner 8813 RETIRED -forms 890 owner 890 VALID -forms 90 owner 90 VALID -forms 900 owner 900 VALID -forms 9000 owner 9000 VALID -forms 9001 owner 9001 VALID -forms 9003 owner 9003 VALID -forms 9004 owner 9004 VALID -forms 9005 owner 9005 VALID -forms 9006 owner 9006 VALID -forms 9007 owner 9007 VALID -forms 9008 owner 9008 VALID -forms 9009 owner 9009 VALID -forms 9010 owner 9010 VALID -forms 9011 owner 9011 VALID -forms 9012 owner 9012 VALID -forms 910 owner 910 VALID -forms 9100 owner 9100 VALID -forms 9101 owner 9101 VALID -forms 9102 owner 9102 VALID -forms 9103 owner 9103 VALID -forms 9104 owner 9104 VALID -forms 9105 owner 9105 VALID -forms 9106 owner 9106 VALID -forms 9107 owner 9107 VALID -forms 9108 owner 9108 VALID -forms 9109 owner 9109 VALID -forms 9110 owner 9110 VALID -forms 9111 owner 9111 VALID -forms 9113 owner 9113 VALID -forms 9114 owner 9114 VALID -forms 9115 owner 9115 VALID -forms 9116 owner 9116 VALID -forms 9117 owner 9117 VALID -forms 9118 owner 9118 VALID -forms 9119 owner 9119 VALID -forms 9120 owner 9120 VALID -forms 9122 owner 9122 VALID -forms 9123 owner 9123 VALID -forms 9124 owner 9124 VALID -forms 9125 owner 9125 VALID -forms 9126 owner 9126 VALID -forms 9127 owner 9127 VALID -forms 9128 owner 9128 VALID -forms 9129 owner 9129 VALID -forms 9130 owner 9130 VALID -forms 9131 owner 9131 VALID -forms 9132 owner 9132 VALID -forms 9133 owner 9133 VALID -forms 9134 owner 9134 VALID -forms 9135 owner 9135 VALID -forms 9136 owner 9136 VALID -forms 9137 owner 9137 VALID -forms 9138 owner 9138 VALID -forms 9139 owner 9139 VALID -forms 9140 owner 9140 VALID -forms 9141 owner 9141 VALID -forms 9143 owner 9143 VALID -forms 9144 owner 9144 VALID -forms 9145 owner 9145 VALID -forms 9146 owner 9146 VALID -forms 9147 owner 9147 VALID -forms 9148 owner 9148 VALID -forms 9149 owner 9149 VALID -forms 9150 owner 9150 VALID -forms 9152 owner 9152 VALID -forms 9153 owner 9153 VALID -forms 9154 owner 9154 VALID -forms 9155 owner 9155 VALID -forms 9156 owner 9156 VALID -forms 9157 owner 9157 VALID -forms 9158 owner 9158 VALID -forms 9159 owner 9159 VALID -forms 9160 owner 9160 VALID -forms 9161 owner 9161 VALID -forms 9162 owner 9162 VALID -forms 9164 owner 9164 VALID -forms 9165 owner 9165 VALID -forms 9166 owner 9166 VALID -forms 9167 owner 9167 VALID -forms 9169 owner 9169 VALID -forms 9171 owner 9171 VALID -forms 9174 owner 9174 VALID -forms 9175 owner 9175 VALID -forms 9177 owner 9177 VALID -forms 9180 owner 9180 VALID -forms 9184 owner 9184 VALID -forms 9185 owner 9185 VALID -forms 9186 owner 9186 VALID -forms 9187 owner 9187 VALID -forms 9188 owner 9188 VALID -forms 9189 owner 9189 VALID -forms 9190 owner 9190 VALID -forms 9192 owner 9192 VALID -forms 9193 owner 9193 VALID -forms 9194 owner 9194 VALID -forms 9195 owner 9195 VALID -forms 9196 owner 9196 VALID -forms 9197 owner 9197 VALID -forms 9198 owner 9198 VALID -forms 9199 owner 9199 VALID -forms 920 owner 920 VALID -forms 9200 owner 9200 VALID -forms 9201 owner 9201 VALID -forms 9202 owner 9202 VALID -forms 9203 owner 9203 VALID -forms 9204 owner 9204 VALID -forms 9205 owner 9205 VALID -forms 9206 owner 9206 VALID -forms 9207 owner 9207 VALID -forms 9208 owner 9208 VALID -forms 9209 owner 9209 VALID -forms 921 owner 921 VALID -forms 9210 owner 9210 VALID -forms 9211 owner 9211 VALID -forms 9212 owner 9212 VALID -forms 9213 owner 9213 VALID -forms 9214 owner 9214 VALID -forms 9215 owner 9215 VALID -forms 9216 owner 9216 VALID -forms 9217 owner 9217 VALID -forms 9218 owner 9218 VALID -forms 9219 owner 9219 VALID -forms 922 owner 922 VALID -forms 9220 owner 9220 VALID -forms 9221 owner 9221 VALID -forms 9222 owner 9222 VALID -forms 9223 owner 9223 VALID -forms 9224 owner 9224 RETIRED -forms 9225 owner 9225 RETIRED -forms 9226 owner 9226 RETIRED -forms 9228 owner 9228 RETIRED -forms 9239 owner 9239 RETIRED -forms 9246 owner 9246 VALID -forms 9247 owner 9247 VALID -forms 9248 owner 9248 VALID -forms 9261 owner 9261 VALID -forms 9271 owner 9271 VALID -forms 930 owner 930 VALID -forms 9300 owner 9300 VALID -forms 9301 owner 9301 VALID -forms 9302 owner 9302 VALID -forms 9303 owner 9303 VALID -forms 9304 owner 9304 VALID -forms 9305 owner 9305 VALID -forms 9306 owner 9306 VALID -forms 9307 owner 9307 VALID -forms 9308 owner 9308 VALID -forms 9309 owner 9309 VALID -forms 9310 owner 9310 VALID -forms 9311 owner 9311 VALID -forms 9312 owner 9312 VALID -forms 9313 owner 9313 VALID -forms 9314 owner 9314 VALID -forms 9315 owner 9315 VALID -forms 9316 owner 9316 VALID -forms 9317 owner 9317 VALID -forms 9318 owner 9318 VALID -forms 9319 owner 9319 VALID -forms 9344 owner 9344 VALID -forms 9372 owner 9372 VALID -forms 940 owner 940 VALID -forms 9409 owner 9409 VALID -forms 942 owner 942 VALID -forms 943 owner 943 VALID -forms 945 owner 945 VALID -forms 946 owner 946 VALID -forms 947 owner 947 VALID -forms 950 owner 950 VALID -forms 951 owner 951 VALID -forms 952 owner 952 VALID -forms 960 owner 960 VALID -forms 970 owner 970 VALID -forms 9700 owner 9700 VALID -forms 9701 owner 9701 VALID -forms 9702 owner 9702 VALID -forms 9703 owner 9703 VALID -forms 9705 owner 9705 VALID -forms 9709 owner 9709 VALID -forms 9710 owner 9710 VALID -forms 9711 owner 9711 VALID -forms 9712 owner 9712 VALID -forms 9713 owner 9713 VALID -forms 9779 owner 9779 VALID -forms 9780 owner 9780 VALID -forms 9781 owner 9781 VALID -forms 9782 owner 9782 VALID -forms 9783 owner 9783 VALID -forms 9784 owner 9784 VALID -forms 9785 owner 9785 VALID -forms 9790 owner 9790 VALID -forms 9791 owner 9791 VALID -forms 9792 owner 9792 VALID -forms 9793 owner 9793 VALID -forms 9794 owner 9794 VALID -forms 9796 owner 9796 VALID -forms 980 owner 980 VALID -forms 9800 owner 9800 VALID -forms 9801 owner 9801 VALID -forms 9802 owner 9802 VALID -forms 9803 owner 9803 VALID -forms 9804 owner 9804 VALID -forms 9805 owner 9805 VALID -forms 9806 owner 9806 VALID -forms 9808 owner 9808 VALID -forms 9809 owner 9809 VALID -forms 9810 owner 9810 VALID -forms 9811 owner 9811 VALID -forms 9812 owner 9812 VALID -forms 9813 owner 9813 VALID -forms 9814 owner 9814 VALID -forms 9815 owner 9815 VALID -forms 9820 owner 9820 VALID -forms 9821 owner 9821 VALID -forms 9822 owner 9822 VALID -forms 9823 owner 9823 VALID -forms 9824 owner 9824 VALID -forms 9825 owner 9825 VALID -forms 9826 owner 9826 VALID -forms 9827 owner 9827 VALID -forms 9828 owner 9828 VALID -forms 9829 owner 9829 VALID -forms 9830 owner 9830 VALID -forms 9831 owner 9831 VALID -forms 9832 owner 9832 VALID -forms 9833 owner 9833 VALID -forms 9834 owner 9834 VALID -forms 9835 owner 9835 VALID -forms 9836 owner 9836 VALID -forms 9837 owner 9837 VALID -forms 9838 owner 9838 VALID -forms 9839 owner 9839 VALID -forms 9840 owner 9840 VALID -forms 9841 owner 9841 VALID -forms 9842 owner 9842 VALID -forms 9843 owner 9843 VALID -forms 9844 owner 9844 VALID -forms 9850 owner 9850 VALID -forms 9851 owner 9851 VALID -forms 9852 owner 9852 VALID -forms 9853 owner 9853 VALID -forms 9860 owner 9860 VALID -forms 9861 owner 9861 VALID -forms 9862 owner 9862 VALID -forms 9863 owner 9863 VALID -forms 9864 owner 9864 VALID -forms 9865 owner 9865 VALID -forms 9866 owner 9866 VALID -forms 9867 owner 9867 VALID -forms 9868 owner 9868 VALID -forms 9870 owner 9870 VALID -forms 9871 owner 9871 VALID -forms 9872 owner 9872 VALID -forms 9873 owner 9873 VALID -forms 9874 owner 9874 VALID -forms 9875 owner 9875 VALID -forms 9876 owner 9876 VALID -forms 9877 owner 9877 VALID -forms 9880 owner 9880 VALID -forms 9881 owner 9881 VALID -forms 9882 owner 9882 VALID -forms 9883 owner 9883 VALID -forms 9884 owner 9884 RETIRED -forms 9885 owner 9885 RETIRED -forms 9886 owner 9886 VALID -forms 990 owner 990 VALID -forms ac owner ac 0 ALIAS -forms acacia owner acacia 0 ALIAS -forms ad owner ad 0 ALIAS -forms adamantine owner adamantine 0 ALIAS -forms adamite owner adamite 0 RETIRED -forms adluorite owner adluorite 0 RETIRED -forms advancedalloy owner advancedalloy 0 RETIRED -forms ag owner ag 0 ALIAS -forms agate owner agate 0 RETIRED -forms air owner air 0 ALIAS -forms al owner al 0 ALIAS -forms al2o3 owner al2o3 0 ALIAS -forms alf3 owner alf3 0 ALIAS -forms almandine owner almandine 0 ALIAS -forms alo3h3 owner alo3h3 0 ALIAS -forms aluminiumalloy owner aluminiumalloy 0 ALIAS -forms aluminiumbrass owner aluminiumbrass 0 ALIAS -forms alumite owner alumite 0 ALIAS -forms alunite owner alunite 0 ALIAS -forms am owner am 0 ALIAS -forms am241 owner am241 0 ALIAS -forms am242 owner am242 0 ALIAS -forms amazonite owner amazonite 0 ALIAS -forms amber owner amber 0 ALIAS -forms amberdominican owner amberdominican 0 ALIAS -forms amethyst owner amethyst 0 ALIAS -forms ametrine owner ametrine 0 RETIRED -forms ammonium owner ammonium 0 RETIRED -forms ancientdebris owner ancientdebris 0 ALIAS -forms andesite owner andesite 0 ALIAS -forms andradite owner andradite 0 ALIAS -forms angelite owner angelite 0 RETIRED -forms annealedcopper owner annealedcopper 0 ALIAS -forms apatite owner apatite 0 ALIAS -forms aquamarine owner aquamarine 0 ALIAS -forms aquaregia owner aquaregia 0 ALIAS -forms ar owner ar 0 ALIAS -forms arsenicbronze owner arsenicbronze 0 ALIAS -forms arseniccopper owner arseniccopper 0 ALIAS -forms arsenopyrite owner arsenopyrite 0 ALIAS -forms as owner as 0 ALIAS -forms asbestos owner asbestos 0 ALIAS -forms ash owner ash 0 ALIAS -forms asphalt owner asphalt 0 ALIAS -forms at owner at 0 ALIAS -forms au owner au 0 ALIAS -forms au198 owner au198 0 ALIAS -forms australium owner australium 0 RETIRED -forms aventurineblack owner aventurineblack 0 ALIAS -forms aventurineblue owner aventurineblue 0 ALIAS -forms aventurinebrown owner aventurinebrown 0 ALIAS -forms aventurinegreen owner aventurinegreen 0 ALIAS -forms aventurinered owner aventurinered 0 ALIAS -forms aventurineyellow owner aventurineyellow 0 ALIAS -forms azurite owner azurite 0 ALIAS -forms b owner b 0 ALIAS -forms b11 owner b11 0 ALIAS -forms ba owner ba 0 ALIAS -forms balasruby owner balasruby 0 ALIAS -forms bamboo owner bamboo 0 ALIAS -forms barite owner barite 0 ALIAS -forms bark owner bark 0 ALIAS -forms basalt owner basalt 0 ALIAS -forms basalticmineralsand owner basalticmineralsand 0 ALIAS -forms basalz owner basalz 0 ALIAS -forms basanite owner basanite 0 RETIRED -forms bastnasite owner bastnasite 0 ALIAS -forms batteryalloy owner batteryalloy 0 ALIAS -forms bauxite owner bauxite 0 ALIAS -forms be owner be 0 ALIAS -forms be7 owner be7 0 ALIAS -forms be8 owner be8 0 ALIAS -forms bedrock owner bedrock 0 ALIAS -forms bentonite owner bentonite 0 ALIAS -forms bh owner bh 0 ALIAS -forms bi owner bi 0 ALIAS -forms biofuel owner biofuel 0 ALIAS -forms biomass owner biomass 0 ALIAS -forms biotite owner biotite 0 ALIAS -forms birch owner birch 0 ALIAS -forms bischofite owner bischofite 0 ALIAS -forms bismuthbronze owner bismuthbronze 0 ALIAS -forms bitumen owner bitumen 0 RETIRED -forms bixbite owner bixbite 0 ALIAS -forms bk owner bk 0 ALIAS -forms black owner black 0 ALIAS -forms blackberyl owner blackberyl 0 RETIRED -forms blackbronze owner blackbronze 0 ALIAS -forms blacksteel owner blacksteel 0 ALIAS -forms blackstone owner blackstone 0 ALIAS -forms blackvitriol owner blackvitriol 0 ALIAS -forms blaze owner blaze 0 ALIAS -forms blazequartz owner blazequartz 0 ALIAS -forms blitz owner blitz 0 ALIAS -forms blizz owner blizz 0 ALIAS -forms bloodstone owner bloodstone 0 RETIRED -forms blue owner blue 0 ALIAS -forms bluealloy owner bluealloy 0 ALIAS -forms bluemahoe owner bluemahoe 0 ALIAS -forms bluesapphire owner bluesapphire 0 ALIAS -forms blueschist owner blueschist 0 ALIAS -forms bluespruce owner bluespruce 0 ALIAS -forms bluesteel owner bluesteel 0 ALIAS -forms bluestone owner bluestone 0 ALIAS -forms bluetopaz owner bluetopaz 0 ALIAS -forms bluevitriol owner bluevitriol 0 ALIAS -forms bone owner bone 0 ALIAS -forms borax owner borax 0 ALIAS -forms br owner br 0 ALIAS -forms brass owner brass 0 ALIAS -forms breeze owner breeze 0 ALIAS -forms bromargyrite owner bromargyrite 0 ALIAS -forms bronze owner bronze 0 ALIAS -forms brown owner brown 0 ALIAS -forms brownlimonite owner brownlimonite 0 ALIAS -forms butane owner butane 0 ALIAS -forms c owner c 0 ALIAS -forms c13 owner c13 0 ALIAS -forms c14 owner c14 0 ALIAS -forms ca owner ca 0 ALIAS -forms cacl2 owner cacl2 0 ALIAS -forms caco3 owner caco3 0 ALIAS -forms caf2 owner caf2 0 ALIAS -forms carminite owner carminite 0 ALIAS -forms carnelian owner carnelian 0 RETIRED -forms caso4 owner caso4 0 ALIAS -forms cassiterite owner cassiterite 0 ALIAS -forms cd owner cd 0 ALIAS -forms cdinagalloy owner cdinagalloy 0 ALIAS -forms ce owner ce 0 ALIAS -forms celestine owner celestine 0 ALIAS -forms ceramic owner ceramic 0 ALIAS -forms certusquartz owner certusquartz 0 ALIAS -forms cf owner cf 0 ALIAS -forms ch4 owner ch4 0 ALIAS -forms chalcopyrite owner chalcopyrite 0 ALIAS -forms chalk owner chalk 0 RETIRED -forms charcoal owner charcoal 0 ALIAS -forms chargedcertusquartz owner chargedcertusquartz 0 ALIAS -forms charoite owner charoite 0 RETIRED -forms cheese owner cheese 0 ALIAS -forms cherry owner cherry 0 ALIAS -forms chert owner chert 0 ALIAS -forms chestnut owner chestnut 0 RETIRED -forms chili owner chili 0 ALIAS -forms chloroauricacid owner chloroauricacid 0 ALIAS -forms chloroplatinicacid owner chloroplatinicacid 0 ALIAS -forms chocolate owner chocolate 0 ALIAS -forms chromite owner chromite 0 ALIAS -forms chromiumdioxide owner chromiumdioxide 0 ALIAS -forms chrysocolla owner chrysocolla 0 RETIRED -forms chrysoprase owner chrysoprase 0 RETIRED -forms cinnabar owner cinnabar 0 ALIAS -forms cinnamon owner cinnamon 0 ALIAS -forms citrine owner citrine 0 RETIRED -forms citrus owner citrus 0 RETIRED -forms cl owner cl 0 ALIAS -forms clay owner clay 0 ALIAS -forms claybrown owner claybrown 0 ALIAS -forms clayred owner clayred 0 ALIAS -forms cm owner cm 0 ALIAS -forms cmbsteel owner cmbsteel 0 RETIRED -forms cn owner cn 0 ALIAS -forms co2 owner co2 0 ALIAS -forms co3 owner co3 0 ALIAS -forms co60 owner co60 0 ALIAS -forms coal owner coal 0 ALIAS -forms coalcoke owner coalcoke 0 ALIAS -forms cobaltbrass owner cobaltbrass 0 ALIAS -forms cobalthexahydrate owner cobalthexahydrate 0 ALIAS -forms cobaltite owner cobaltite 0 ALIAS -forms cocoa owner cocoa 0 ALIAS -forms coconut owner coconut 0 ALIAS -forms coffee owner coffee 0 ALIAS -forms coltan owner coltan 0 ALIAS -forms columbite owner columbite 0 ALIAS -forms compressed owner compressed 0 ALIAS -forms concrete owner concrete 0 ALIAS -forms conductiveiron owner conductiveiron 0 ALIAS -forms constantan owner constantan 0 ALIAS -forms constructionfoam owner constructionfoam 0 ALIAS -forms cooperite owner cooperite 0 ALIAS -forms coral owner coral 0 RETIRED -forms cosmicneutronium owner cosmicneutronium 0 ALIAS -forms cr owner cr 0 ALIAS -forms craponite owner craponite 0 ALIAS -forms creosote owner creosote 0 ALIAS -forms crimson owner crimson 0 ALIAS -forms crudeoil owner crudeoil 0 ALIAS -forms crystalflux owner crystalflux 0 RETIRED -forms crystalmatrix owner crystalmatrix 0 ALIAS -forms cs owner cs 0 ALIAS -forms cu owner cu 0 ALIAS -forms cyan owner cyan 0 ALIAS -forms cyanite owner cyanite 0 ALIAS -forms cyanvitriol owner cyanvitriol 0 ALIAS -forms d owner d 0 ALIAS -forms d2o owner d2o 0 ALIAS -forms dacite owner dacite 0 ALIAS -forms daffergon owner daffergon 0 RETIRED -forms damascussteel owner damascussteel 0 ALIAS -forms darkash owner darkash 0 ALIAS -forms darkoak owner darkoak 0 ALIAS -forms darkstone owner darkstone 0 RETIRED -forms datolite owner datolite 0 ALIAS -forms db owner db 0 ALIAS -forms dead owner dead 0 ALIAS -forms deepslate owner deepslate 0 ALIAS -forms demonite owner demonite 0 RETIRED -forms diamantine owner diamantine 0 RETIRED -forms diamond owner diamond 0 ALIAS -forms diamondblue owner diamondblue 0 ALIAS -forms diamondgreen owner diamondgreen 0 ALIAS -forms diamondindustrial owner diamondindustrial 0 ALIAS -forms diamondpink owner diamondpink 0 ALIAS -forms diamondred owner diamondred 0 ALIAS -forms diamondyellow owner diamondyellow 0 ALIAS -forms diatomite owner diatomite 0 ALIAS -forms diduraniumtrioxide owner diduraniumtrioxide 0 ALIAS -forms diesel owner diesel 0 ALIAS -forms dineutronium owner dineutronium 0 RETIRED -forms dioptase owner dioptase 0 ALIAS -forms diorite owner diorite 0 ALIAS -forms distwater owner distwater 0 ALIAS -forms dn owner dn 0 ALIAS -forms dolomite owner dolomite 0 RETIRED -forms draconic owner draconic 0 RETIRED -forms draconium owner draconium 0 ALIAS -forms draconiumawakened owner draconiumawakened 0 ALIAS -forms dreamwood owner dreamwood 0 ALIAS -forms ds owner ds 0 ALIAS -forms dumortierite owner dumortierite 0 RETIRED -forms duralumin owner duralumin 0 ALIAS -forms duraniumalloy owner duraniumalloy 0 ALIAS -forms duraniumhexaastatide owner duraniumhexaastatide 0 ALIAS -forms duraniumhexabromide owner duraniumhexabromide 0 ALIAS -forms duraniumhexachloride owner duraniumhexachloride 0 ALIAS -forms duraniumhexafluoride owner duraniumhexafluoride 0 ALIAS -forms duraniumhexaiodide owner duraniumhexaiodide 0 ALIAS -forms durasteel owner durasteel 0 RETIRED -forms dy owner dy 0 ALIAS -forms dynamite owner dynamite 0 ALIAS -forms efrine owner efrine 0 ALIAS -forms elder owner elder 0 RETIRED -forms electricalsteel owner electricalsteel 0 ALIAS -forms electrotinealloy owner electrotinealloy 0 ALIAS -forms electrum owner electrum 0 ALIAS -forms elvenelementium owner elvenelementium 0 ALIAS -forms elvenquartz owner elvenquartz 0 ALIAS -forms emeradic owner emeradic 0 RETIRED -forms emerald owner emerald 0 ALIAS -forms empty owner empty 0 ALIAS -forms endereye owner endereye 0 ALIAS -forms enderium owner enderium 0 ALIAS -forms enderiumbase owner enderiumbase 0 ALIAS -forms enderpearl owner enderpearl 0 ALIAS -forms endstone owner endstone 0 ALIAS -forms energiumcyan owner energiumcyan 0 ALIAS -forms energiumred owner energiumred 0 ALIAS -forms enori owner enori 0 RETIRED -forms er owner er 0 ALIAS -forms es owner es 0 ALIAS -forms ethanol owner ethanol 0 ALIAS -forms ethylene owner ethylene 0 ALIAS -forms eu owner eu 0 ALIAS -forms eudialyte owner eudialyte 0 ALIAS -forms euphemium owner euphemium 0 RETIRED -forms f owner f 0 ALIAS -forms fa owner fa 0 ALIAS -forms fe owner fe 0 ALIAS -forms fe2o3 owner fe2o3 0 ALIAS -forms fecl2 owner fecl2 0 ALIAS -forms fecl3 owner fecl3 0 ALIAS -forms feo3h3 owner feo3h3 0 ALIAS -forms ferberite owner ferberite 0 ALIAS -forms ferrovanadium owner ferrovanadium 0 ALIAS -forms fierysteel owner fierysteel 0 ALIAS -forms fig owner fig 0 RETIRED -forms fireleaf owner fireleaf 0 ALIAS -forms firestone owner firestone 0 ALIAS -forms fishcooked owner fishcooked 0 ALIAS -forms fishoil owner fishoil 0 ALIAS -forms fishraw owner fishraw 0 ALIAS -forms fishrotten owner fishrotten 0 ALIAS -forms fl owner fl 0 ALIAS -forms fl298 owner fl298 0 ALIAS -forms flamascussteel owner flamascussteel 0 ALIAS -forms flint owner flint 0 ALIAS -forms fluix owner fluix 0 ALIAS -forms fluoriteblack owner fluoriteblack 0 ALIAS -forms fluoriteblue owner fluoriteblue 0 ALIAS -forms fluoritegreen owner fluoritegreen 0 ALIAS -forms fluoritemagenta owner fluoritemagenta 0 ALIAS -forms fluoriteorange owner fluoriteorange 0 ALIAS -forms fluoritepink owner fluoritepink 0 ALIAS -forms fluoritered owner fluoritered 0 ALIAS -forms fluoritewhite owner fluoritewhite 0 ALIAS -forms fluoriteyellow owner fluoriteyellow 0 ALIAS -forms fm owner fm 0 ALIAS -forms fr owner fr 0 ALIAS -forms freshwater owner freshwater 0 ALIAS -forms frozen owner frozen 0 ALIAS -forms fryingoilhot owner fryingoilhot 0 ALIAS -forms fuel owner fuel 0 ALIAS -forms ga owner ga 0 ALIAS -forms gabbro owner gabbro 0 RETIRED -forms gaiaspirit owner gaiaspirit 0 ALIAS -forms galena owner galena 0 ALIAS -forms garnetsand owner garnetsand 0 ALIAS -forms garnierite owner garnierite 0 ALIAS -forms gd owner gd 0 ALIAS -forms ge owner ge 0 ALIAS -forms glass owner glass 0 ALIAS -forms glauconite owner glauconite 0 ALIAS -forms glowstone owner glowstone 0 ALIAS -forms glue owner glue 0 ALIAS -forms glycerol owner glycerol 0 ALIAS -forms glyceryl owner glyceryl 0 ALIAS -forms gneiss owner gneiss 0 RETIRED -forms goshenite owner goshenite 0 ALIAS -forms granite owner granite 0 ALIAS -forms graniteblack owner graniteblack 0 ALIAS -forms granitered owner granitered 0 ALIAS -forms graniticmineralsand owner graniticmineralsand 0 ALIAS -forms graphene owner graphene 0 ALIAS -forms graphite owner graphite 0 ALIAS -forms gray owner gray 0 ALIAS -forms grayvitriol owner grayvitriol 0 ALIAS -forms greatwood owner greatwood 0 ALIAS -forms green owner green 0 ALIAS -forms greensapphire owner greensapphire 0 ALIAS -forms greenschist owner greenschist 0 ALIAS -forms greenvitriol owner greenvitriol 0 ALIAS -forms grossular owner grossular 0 ALIAS -forms gt owner gt 0 ALIAS -forms gunpowder owner gunpowder 0 ALIAS -forms gypsum owner gypsum 0 ALIAS -forms h owner h 0 ALIAS -forms h2o owner h2o 0 ALIAS -forms h2o2 owner h2o2 0 ALIAS -forms h2s owner h2s 0 ALIAS -forms h2s2o7 owner h2s2o7 0 ALIAS -forms h2sif6 owner h2sif6 0 ALIAS -forms h2so4 owner h2so4 0 ALIAS -forms h2wo4 owner h2wo4 0 ALIAS -forms h3bo3 owner h3bo3 0 ALIAS -forms hazel owner hazel 0 ALIAS -forms hazelnut owner hazelnut 0 ALIAS -forms hcl owner hcl 0 ALIAS -forms hdo owner hdo 0 ALIAS -forms he owner he 0 ALIAS -forms he3 owner he3 0 ALIAS -forms heliodor owner heliodor 0 ALIAS -forms hempoil owner hempoil 0 ALIAS -forms hene owner hene 0 ALIAS -forms hexoriumblack owner hexoriumblack 0 RETIRED -forms hexoriumblue owner hexoriumblue 0 RETIRED -forms hexoriumgreen owner hexoriumgreen 0 RETIRED -forms hexoriumred owner hexoriumred 0 RETIRED -forms hexoriumwhite owner hexoriumwhite 0 RETIRED -forms hg owner hg 0 ALIAS -forms hno3 owner hno3 0 ALIAS -forms ho owner ho 0 ALIAS -forms holywater owner holywater 0 ALIAS -forms honey owner honey 0 ALIAS -forms honeydew owner honeydew 0 ALIAS -forms hs owner hs 0 ALIAS -forms hsse owner hsse 0 ALIAS -forms hssg owner hssg 0 ALIAS -forms hsss owner hsss 0 ALIAS -forms huebnerite owner huebnerite 0 ALIAS -forms hydratedcoal owner hydratedcoal 0 ALIAS -forms i owner i 0 ALIAS -forms ice owner ice 0 ALIAS -forms ilmenite owner ilmenite 0 ALIAS -forms in owner in 0 ALIAS -forms infinity owner infinity 0 ALIAS -forms infusedgold owner infusedgold 0 RETIRED -forms invar owner invar 0 ALIAS -forms invisium owner invisium 0 RETIRED -forms ir owner ir 0 ALIAS -forms iridiron owner iridiron 0 RETIRED -forms iridironreinforced owner iridironreinforced 0 RETIRED -forms iritanium owner iritanium 0 ALIAS -forms ironcast owner ironcast 0 ALIAS -forms ironmagnetic owner ironmagnetic 0 ALIAS -forms ironsharp owner ironsharp 0 RETIRED -forms ironwood owner ironwood 0 ALIAS -forms irridantreinforced owner irridantreinforced 0 RETIRED -forms irridanturanium owner irridanturanium 0 RETIRED -forms jade owner jade 0 ALIAS -forms jasper owner jasper 0 ALIAS -forms jasperblue owner jasperblue 0 ALIAS -forms jaspergreen owner jaspergreen 0 ALIAS -forms jasperocean owner jasperocean 0 ALIAS -forms jasperrainforest owner jasperrainforest 0 ALIAS -forms jasperyellow owner jasperyellow 0 ALIAS -forms jet owner jet 0 RETIRED -forms jungle owner jungle 0 ALIAS -forms k owner k 0 ALIAS -forms k2co3 owner k2co3 0 ALIAS -forms k2s owner k2s 0 ALIAS -forms k2s2o7 owner k2s2o7 0 ALIAS -forms k2so3 owner k2so3 0 ALIAS -forms k2so4 owner k2so4 0 ALIAS -forms k2taf7 owner k2taf7 0 ALIAS -forms kalo2 owner kalo2 0 ALIAS -forms kanthal owner kanthal 0 ALIAS -forms kaolinite owner kaolinite 0 ALIAS -forms kcl owner kcl 0 ALIAS -forms ke owner ke 0 ALIAS -forms kerosine owner kerosine 0 ALIAS -forms kesterite owner kesterite 0 ALIAS -forms kf owner kf 0 ALIAS -forms khso4 owner khso4 0 ALIAS -forms kimberlite owner kimberlite 0 ALIAS -forms kio3 owner kio3 0 ALIAS -forms knightmetal owner knightmetal 0 ALIAS -forms kno3 owner kno3 0 ALIAS -forms koh owner koh 0 ALIAS -forms komatiite owner komatiite 0 ALIAS -forms kr owner kr 0 ALIAS -forms kso4 owner kso4 0 ALIAS -forms kunzite owner kunzite 0 RETIRED -forms kyanite owner kyanite 0 ALIAS -forms la owner la 0 ALIAS -forms labradorite owner labradorite 0 RETIRED -forms lapis owner lapis 0 ALIAS -forms lapislazuli owner lapislazuli 0 RETIRED -forms larimar owner larimar 0 RETIRED -forms latex owner latex 0 ALIAS -forms lava owner lava 0 ALIAS -forms lazurite owner lazurite 0 ALIAS -forms lepidolite owner lepidolite 0 ALIAS -forms li owner li 0 ALIAS -forms li6 owner li6 0 ALIAS -forms licl owner licl 0 ALIAS -forms liclo3 owner liclo3 0 ALIAS -forms liclo4 owner liclo4 0 ALIAS -forms lightblue owner lightblue 0 ALIAS -forms lightgray owner lightgray 0 ALIAS -forms lignite owner lignite 0 ALIAS -forms lignitecoke owner lignitecoke 0 ALIAS -forms lime owner lime 0 ALIAS -forms limestone owner limestone 0 ALIAS -forms linoil owner linoil 0 ALIAS -forms lioh owner lioh 0 ALIAS -forms liveroot owner liveroot 0 ALIAS -forms livingrock owner livingrock 0 ALIAS -forms livingwood owner livingwood 0 ALIAS -forms lodestone owner lodestone 0 RETIRED -forms lr owner lr 0 ALIAS -forms lu owner lu 0 ALIAS -forms lubricant owner lubricant 0 ALIAS -forms luminite owner luminite 0 RETIRED -forms lumium owner lumium 0 ALIAS -forms lv owner lv 0 ALIAS -forms magenta owner magenta 0 ALIAS -forms magic owner magic 0 ALIAS -forms magnalium owner magnalium 0 ALIAS -forms magnetite owner magnetite 0 ALIAS -forms magnetizedtungsten owner magnetizedtungsten 0 RETIRED -forms mahoe owner mahoe 0 RETIRED -forms malachite owner malachite 0 ALIAS -forms manadiamond owner manadiamond 0 ALIAS -forms manaquartz owner manaquartz 0 ALIAS -forms manasteel owner manasteel 0 ALIAS -forms mangrove owner mangrove 0 ALIAS -forms maple owner maple 0 ALIAS -forms marble owner marble 0 ALIAS -forms marssand owner marssand 0 ALIAS -forms mawsitsit owner mawsitsit 0 RETIRED -forms maxixe owner maxixe 0 ALIAS -forms mc owner mc 0 ALIAS -forms md owner md 0 ALIAS -forms meatcooked owner meatcooked 0 ALIAS -forms meatraw owner meatraw 0 ALIAS -forms meatrotten owner meatrotten 0 ALIAS -forms mercassium owner mercassium 0 RETIRED -forms methaneice owner methaneice 0 ALIAS -forms mg owner mg 0 ALIAS -forms mgcl2 owner mgcl2 0 ALIAS -forms mgco3 owner mgco3 0 ALIAS -forms mica owner mica 0 ALIAS -forms milk owner milk 0 ALIAS -forms milkyquartz owner milkyquartz 0 ALIAS -forms mimichite owner mimichite 0 RETIRED -forms mint owner mint 0 ALIAS -forms mirabilite owner mirabilite 0 ALIAS -forms mn owner mn 0 ALIAS -forms mncl2 owner mncl2 0 ALIAS -forms mno2 owner mno2 0 ALIAS -forms mo owner mo 0 ALIAS -forms moissanite owner moissanite 0 RETIRED -forms molybdenite owner molybdenite 0 ALIAS -forms monazite owner monazite 0 ALIAS -forms mookaite owner mookaite 0 RETIRED -forms morganite owner morganite 0 ALIAS -forms mossy owner mossy 0 ALIAS -forms mt owner mt 0 ALIAS -forms n owner n 0 ALIAS -forms na owner na 0 ALIAS -forms na2co3 owner na2co3 0 ALIAS -forms na2s owner na2s 0 ALIAS -forms na2s2o7 owner na2s2o7 0 ALIAS -forms na2so3 owner na2so3 0 ALIAS -forms na2so4 owner na2so4 0 ALIAS -forms na3alf6 owner na3alf6 0 ALIAS -forms naalo2 owner naalo2 0 ALIAS -forms nacl owner nacl 0 ALIAS -forms naf owner naf 0 ALIAS -forms nahco3 owner nahco3 0 ALIAS -forms nahso4 owner nahso4 0 ALIAS -forms nano3 owner nano3 0 ALIAS -forms naoh owner naoh 0 ALIAS -forms naso4 owner naso4 0 ALIAS -forms nb owner nb 0 ALIAS -forms nb2o5 owner nb2o5 0 ALIAS -forms nd owner nd 0 ALIAS -forms ne owner ne 0 ALIAS -forms neodymiummagnetic owner neodymiummagnetic 0 ALIAS -forms netherbrick owner netherbrick 0 ALIAS -forms netherite owner netherite 0 ALIAS -forms netherizeddiamond owner netherizeddiamond 0 ALIAS -forms netherquartz owner netherquartz 0 ALIAS -forms netherrack owner netherrack 0 ALIAS -forms netherstar owner netherstar 0 ALIAS -forms nh owner nh 0 ALIAS -forms nh3 owner nh3 0 ALIAS -forms ni owner ni 0 ALIAS -forms nichrome owner nichrome 0 ALIAS -forms nikolinealloy owner nikolinealloy 0 ALIAS -forms nikolite owner nikolite 0 ALIAS -forms niobiumtitanium owner niobiumtitanium 0 ALIAS -forms niter owner niter 0 ALIAS -forms nitrocarbon owner nitrocarbon 0 ALIAS -forms nitrofuel owner nitrofuel 0 ALIAS -forms no2 owner no2 0 ALIAS -forms np owner np 0 ALIAS -forms nq owner nq 0 ALIAS -forms nq522 owner nq522 0 ALIAS -forms nq528 owner nq528 0 ALIAS -forms nutoil owner nutoil 0 ALIAS -forms o owner o 0 ALIAS -forms oak owner oak 0 ALIAS -forms obsidian owner obsidian 0 ALIAS -forms obsidianflux owner obsidianflux 0 RETIRED -forms og owner og 0 ALIAS -forms oil owner oil 0 ALIAS -forms oilsands owner oilsands 0 ALIAS -forms oilshale owner oilshale 0 ALIAS -forms olive owner olive 0 RETIRED -forms oliveoil owner oliveoil 0 ALIAS -forms onyxblack owner onyxblack 0 ALIAS -forms onyxred owner onyxred 0 ALIAS -forms opal owner opal 0 ALIAS -forms orange owner orange 0 ALIAS -forms orangesapphire owner orangesapphire 0 ALIAS -forms os owner os 0 ALIAS -forms osmiridium owner osmiridium 0 ALIAS -forms osmonium owner osmonium 0 RETIRED -forms p owner p 0 ALIAS -forms pa owner pa 0 ALIAS -forms palis owner palis 0 RETIRED -forms palygorskite owner palygorskite 0 ALIAS -forms papaya owner papaya 0 RETIRED -forms paper owner paper 0 ALIAS -forms pb owner pb 0 ALIAS -forms pd owner pd 0 ALIAS -forms pear owner pear 0 RETIRED -forms peat owner peat 0 ALIAS -forms pentlandite owner pentlandite 0 ALIAS -forms peridot owner peridot 0 ALIAS -forms perlite owner perlite 0 ALIAS -forms petcoke owner petcoke 0 ALIAS -forms petrifiedwood owner petrifiedwood 0 ALIAS -forms petrol owner petrol 0 ALIAS -forms petroleum owner petroleum 0 RETIRED -forms petrotheum owner petrotheum 0 RETIRED -forms phoenixite owner phoenixite 0 RETIRED -forms phosphorite owner phosphorite 0 ALIAS -forms phosphorus owner phosphorus 0 ALIAS -forms phosphorusblue owner phosphorusblue 0 ALIAS -forms phosphorusred owner phosphorusred 0 ALIAS -forms phosphoruswhite owner phosphoruswhite 0 ALIAS -forms pietersite owner pietersite 0 RETIRED -forms pinalite owner pinalite 0 ALIAS -forms pink owner pink 0 ALIAS -forms pinkvitriol owner pinkvitriol 0 ALIAS -forms pitchblende owner pitchblende 0 ALIAS -forms plastic owner plastic 0 ALIAS -forms platinumgroupsludge owner platinumgroupsludge 0 ALIAS -forms plum owner plum 0 RETIRED -forms pm owner pm 0 ALIAS -forms po owner po 0 ALIAS -forms po4 owner po4 0 ALIAS -forms pollucite owner pollucite 0 ALIAS -forms porcelain owner porcelain 0 ALIAS -forms potassiumfeldspar owner potassiumfeldspar 0 ALIAS -forms potato owner potato 0 ALIAS -forms powellite owner powellite 0 ALIAS -forms pr owner pr 0 ALIAS -forms prismarinedark owner prismarinedark 0 ALIAS -forms prismarinelight owner prismarinelight 0 ALIAS -forms propane owner propane 0 ALIAS -forms propylene owner propylene 0 ALIAS -forms pt owner pt 0 ALIAS -forms pu owner pu 0 ALIAS -forms pu238 owner pu238 0 ALIAS -forms pu239 owner pu239 0 ALIAS -forms pu240 owner pu240 0 ALIAS -forms pu241 owner pu241 0 ALIAS -forms pu243 owner pu243 0 ALIAS -forms pumice owner pumice 0 ALIAS -forms purple owner purple 0 ALIAS -forms purplesapphire owner purplesapphire 0 ALIAS -forms pvc owner pvc 0 ALIAS -forms pyrite owner pyrite 0 ALIAS -forms pyrope owner pyrope 0 ALIAS -forms pyrotheum owner pyrotheum 0 RETIRED -forms quartzite owner quartzite 0 ALIAS -forms quartzsand owner quartzsand 0 ALIAS -forms quicklime owner quicklime 0 ALIAS -forms ra owner ra 0 ALIAS -forms rainbowood owner rainbowood 0 ALIAS -forms randomite owner randomite 0 RETIRED -forms rareearth owner rareearth 0 ALIAS -forms rb owner rb 0 ALIAS -forms re owner re 0 ALIAS -forms realgar owner realgar 0 ALIAS -forms red owner red 0 ALIAS -forms redalloy owner redalloy 0 ALIAS -forms redquartz owner redquartz 0 ALIAS -forms redsand owner redsand 0 ALIAS -forms redsteel owner redsteel 0 ALIAS -forms redstone owner redstone 0 ALIAS -forms redstonealloy owner redstonealloy 0 ALIAS -forms redstonia owner redstonia 0 RETIRED -forms redvitriol owner redvitriol 0 ALIAS -forms reiium owner reiium 0 RETIRED -forms rf owner rf 0 ALIAS -forms rg owner rg 0 ALIAS -forms rh owner rh 0 ALIAS -forms rhodonite owner rhodonite 0 RETIRED -forms rhyolite owner rhyolite 0 RETIRED -forms rn owner rn 0 ALIAS -forms rosegold owner rosegold 0 ALIAS -forms rotten owner rotten 0 ALIAS -forms ru owner ru 0 ALIAS -forms rubber owner rubber 0 ALIAS -forms ruby owner ruby 0 ALIAS -forms russellite owner russellite 0 ALIAS -forms rye owner rye 0 ALIAS -forms s owner s 0 ALIAS -forms saltedwater owner saltedwater 0 ALIAS -forms saltwater owner saltwater 0 ALIAS -forms sand owner sand 0 ALIAS -forms sapphire owner sapphire 0 ALIAS -forms saturnite owner saturnite 0 RETIRED -forms sb owner sb 0 ALIAS -forms sc owner sc 0 ALIAS -forms scapolite owner scapolite 0 RETIRED -forms scheelite owner scheelite 0 ALIAS -forms schrabidium owner schrabidium 0 RETIRED -forms se owner se 0 ALIAS -forms seawater owner seawater 0 ALIAS -forms seedoil owner seedoil 0 ALIAS -forms selenite owner selenite 0 RETIRED -forms sg owner sg 0 ALIAS -forms shale owner shale 0 ALIAS -forms si owner si 0 ALIAS -forms sic owner sic 0 ALIAS -forms signalum owner signalum 0 ALIAS -forms silverwood owner silverwood 0 ALIAS -forms sio2 owner sio2 0 ALIAS -forms skystone owner skystone 0 ALIAS -forms slate owner slate 0 ALIAS -forms sluicesand owner sluicesand 0 ALIAS -forms sm owner sm 0 ALIAS -forms smithsonite owner smithsonite 0 ALIAS -forms smokeyquartz owner smokeyquartz 0 ALIAS -forms sn owner sn 0 ALIAS -forms snow owner snow 0 ALIAS -forms snowflakeobsidian owner snowflakeobsidian 0 RETIRED -forms so2 owner so2 0 ALIAS -forms so3 owner so3 0 ALIAS -forms sodalite owner sodalite 0 ALIAS -forms solderingalloy owner solderingalloy 0 ALIAS -forms soularium owner soularium 0 ALIAS -forms soulsand owner soulsand 0 ALIAS -forms soylentgreen owner soylentgreen 0 ALIAS -forms sperrylite owner sperrylite 0 ALIAS -forms spessartine owner spessartine 0 ALIAS -forms sphalerite owner sphalerite 0 ALIAS -forms spinel owner spinel 0 ALIAS -forms spodumene owner spodumene 0 ALIAS -forms spruce owner spruce 0 ALIAS -forms sr owner sr 0 ALIAS -forms stainlesssteel owner stainlesssteel 0 ALIAS -forms stannicchloride owner stannicchloride 0 ALIAS -forms stannite owner stannite 0 ALIAS -forms starconium owner starconium 0 RETIRED -forms starmetal owner starmetal 0 RETIRED -forms steam owner steam 0 ALIAS -forms steel owner steel 0 ALIAS -forms steeleaf owner steeleaf 0 ALIAS -forms steelgalvanized owner steelgalvanized 0 ALIAS -forms steelmagnetic owner steelmagnetic 0 ALIAS -forms sterlingsilver owner sterlingsilver 0 ALIAS -forms stibnite owner stibnite 0 ALIAS -forms stolzite owner stolzite 0 ALIAS -forms stone owner stone 0 ALIAS -forms sugar owner sugar 0 ALIAS -forms sunfloweroil owner sunfloweroil 0 ALIAS -forms sunnyquartz owner sunnyquartz 0 ALIAS -forms sunstone owner sunstone 0 RETIRED -forms t owner t 0 ALIAS -forms t2o owner t2o 0 ALIAS -forms ta owner ta 0 ALIAS -forms ta2o5 owner ta2o5 0 ALIAS -forms ta4hfc5 owner ta4hfc5 0 ALIAS -forms talc owner talc 0 ALIAS -forms tantalite owner tantalite 0 ALIAS -forms tanzanite owner tanzanite 0 ALIAS -forms tapazite owner tapazite 0 RETIRED -forms tb owner tb 0 ALIAS -forms tc owner tc 0 ALIAS -forms te owner te 0 ALIAS -forms tea owner tea 0 ALIAS -forms teflon owner teflon 0 ALIAS -forms terrasteel owner terrasteel 0 ALIAS -forms terrasteelalloyraw owner terrasteelalloyraw 0 RETIRED -forms terrasteelalloystrengthened owner terrasteelalloystrengthened 0 RETIRED -forms teslatite owner teslatite 0 RETIRED -forms tetrahedrite owner tetrahedrite 0 ALIAS -forms th owner th 0 ALIAS -forms thaumium owner thaumium 0 ALIAS -forms thyrium owner thyrium 0 RETIRED -forms ti owner ti 0 ALIAS -forms ticl4 owner ticl4 0 ALIAS -forms tigereyeblack owner tigereyeblack 0 ALIAS -forms tigereyeblue owner tigereyeblue 0 ALIAS -forms tigereyegreen owner tigereyegreen 0 ALIAS -forms tigereyered owner tigereyered 0 ALIAS -forms tigereyeyellow owner tigereyeyellow 0 ALIAS -forms tigeriron owner tigeriron 0 ALIAS -forms tinalloy owner tinalloy 0 ALIAS -forms tio2 owner tio2 0 ALIAS -forms titanrock owner titanrock 0 ALIAS -forms tl owner tl 0 ALIAS -forms tm owner tm 0 ALIAS -forms tn owner tn 0 ALIAS -forms topaz owner topaz 0 ALIAS -forms tourmaline owner tourmaline 0 RETIRED -forms trinaquadalloy owner trinaquadalloy 0 ALIAS -forms trinitanium owner trinitanium 0 ALIAS -forms tritaniumalloy owner tritaniumalloy 0 ALIAS -forms tritaniumdioxide owner tritaniumdioxide 0 ALIAS -forms tritaniumhexaastatide owner tritaniumhexaastatide 0 ALIAS -forms tritaniumhexabromide owner tritaniumhexabromide 0 ALIAS -forms tritaniumhexachloride owner tritaniumhexachloride 0 ALIAS -forms tritaniumhexafluoride owner tritaniumhexafluoride 0 ALIAS -forms tritaniumhexaiodide owner tritaniumhexaiodide 0 ALIAS -forms trona owner trona 0 ALIAS -forms tungstate owner tungstate 0 ALIAS -forms tungstencarbide owner tungstencarbide 0 ALIAS -forms tungstensintered owner tungstensintered 0 ALIAS -forms tungstensteel owner tungstensteel 0 ALIAS -forms turquoise owner turquoise 0 RETIRED -forms u233 owner u233 0 ALIAS -forms u235 owner u235 0 ALIAS -forms u235f4 owner u235f4 0 ALIAS -forms u235f6 owner u235f6 0 ALIAS -forms u238 owner u238 0 ALIAS -forms u238f4 owner u238f4 0 ALIAS -forms u238f6 owner u238f6 0 ALIAS -forms uf4 owner uf4 0 ALIAS -forms uf6 owner uf6 0 ALIAS -forms ultimet owner ultimet 0 ALIAS -forms unakite owner unakite 0 RETIRED -forms unobtainium owner unobtainium 0 RETIRED -forms uraninite owner uraninite 0 ALIAS -forms uuamplifier owner uuamplifier 0 RETIRED -forms uumatter owner uumatter 0 RETIRED -forms uvarovite owner uvarovite 0 ALIAS -forms v owner v 0 ALIAS -forms v2o5 owner v2o5 0 ALIAS -forms vanadiumgallium owner vanadiumgallium 0 ALIAS -forms vanadiumsteel owner vanadiumsteel 0 ALIAS -forms vb owner vb 0 ALIAS -forms vermiculite owner vermiculite 0 ALIAS -forms verticium owner verticium 0 RETIRED -forms vibramantium owner vibramantium 0 ALIAS -forms vibraniumsilver owner vibraniumsilver 0 ALIAS -forms vibraniumsteel owner vibraniumsteel 0 ALIAS -forms vibrantalloy owner vibrantalloy 0 ALIAS -forms vinteum owner vinteum 0 RETIRED -forms vinteumpurified owner vinteumpurified 0 RETIRED -forms vitriolofclay owner vitriolofclay 0 ALIAS -forms voidcrystal owner voidcrystal 0 RETIRED -forms w owner w 0 ALIAS -forms walnut owner walnut 0 RETIRED -forms warped owner warped 0 ALIAS -forms wax owner wax 0 ALIAS -forms waxbee owner waxbee 0 ALIAS -forms waxparaffin owner waxparaffin 0 ALIAS -forms waxplant owner waxplant 0 ALIAS -forms weidanium owner weidanium 0 RETIRED -forms wheat owner wheat 0 ALIAS -forms white owner white 0 ALIAS -forms whitevitriol owner whitevitriol 0 ALIAS -forms willow owner willow 0 ALIAS -forms wimalite owner wimalite 0 RETIRED -forms wo3 owner wo3 0 ALIAS -forms wolframite owner wolframite 0 ALIAS -forms wollastonite owner wollastonite 0 ALIAS -forms wonderstone owner wonderstone 0 RETIRED -forms wood owner wood 0 ALIAS -forms woodpolished owner woodpolished 0 ALIAS -forms woodrubber owner woodrubber 0 ALIAS -forms woodtreated owner woodtreated 0 ALIAS -forms wroughtiron owner wroughtiron 0 ALIAS -forms wulfenite owner wulfenite 0 ALIAS -forms xe owner xe 0 ALIAS -forms y owner y 0 ALIAS -forms yb owner yb 0 ALIAS -forms yellow owner yellow 0 ALIAS -forms yellowlimonite owner yellowlimonite 0 ALIAS -forms yellowsapphire owner yellowsapphire 0 ALIAS -forms yttriumbariumcuprate owner yttriumbariumcuprate 0 ALIAS -forms zectium owner zectium 0 RETIRED -forms zeolite owner zeolite 0 ALIAS -forms zircon owner zircon 0 ALIAS -forms zn owner zn 0 ALIAS -forms zr owner zr 0 ALIAS -processing Ceramic Bending.owner Ceramic 0 VALID -processing Ceramic Compressing.owner Ceramic 0 VALID -processing Ceramic Forging.owner Ceramic 0 VALID -processing Ceramic Smashing.owner Ceramic 0 VALID -processing EndSandWhite Forging.owner EndSandWhite 0 RETIRED -processing EndSandWhite Forging.target Glass 0 VALID -processing FishRaw Forging.owner FishRaw 0 VALID -processing FishRaw Forging.target FishCooked 0 VALID -processing FrozenIron Forging.owner FrozenIron 0 RETIRED -processing FrozenIron Forging.target Fe 0 ALIAS -processing H2O Solidifying.owner H2O 0 ALIAS -processing H2O Solidifying.target Ice 0 VALID -processing IronMagnetic Bending.owner IronMagnetic 0 VALID -processing IronMagnetic Bending.target Fe 0 ALIAS -processing IronMagnetic Compressing.owner IronMagnetic 0 VALID -processing IronMagnetic Compressing.target Fe 0 ALIAS -processing IronMagnetic Forging.owner IronMagnetic 0 VALID -processing IronMagnetic Forging.target Fe 0 ALIAS -processing IronMagnetic Smashing.owner IronMagnetic 0 VALID -processing IronMagnetic Smashing.target Fe 0 ALIAS -processing IronMagnetic Working.owner IronMagnetic 0 VALID -processing IronMagnetic Working.target Fe 0 ALIAS -processing Lava Solidifying.owner Lava 0 VALID -processing Lava Solidifying.target Obsidian 0 VALID -processing MeatRaw Forging.owner MeatRaw 0 VALID -processing MeatRaw Forging.target MeatCooked 0 VALID -processing NeodymiumMagnetic Bending.owner NeodymiumMagnetic 0 VALID -processing NeodymiumMagnetic Bending.target Fe 0 ALIAS -processing NeodymiumMagnetic Compressing.owner NeodymiumMagnetic 0 VALID -processing NeodymiumMagnetic Compressing.target Nd 0 ALIAS -processing NeodymiumMagnetic Forging.owner NeodymiumMagnetic 0 VALID -processing NeodymiumMagnetic Forging.target Nd 0 ALIAS -processing NeodymiumMagnetic Smashing.owner NeodymiumMagnetic 0 VALID -processing NeodymiumMagnetic Smashing.target Nd 0 ALIAS -processing NeodymiumMagnetic Working.owner NeodymiumMagnetic 0 VALID -processing NeodymiumMagnetic Working.target Nd 0 ALIAS -processing Porcelain Bending.owner Porcelain 0 VALID -processing Porcelain Compressing.owner Porcelain 0 VALID -processing Porcelain Forging.owner Porcelain 0 VALID -processing Porcelain Smashing.owner Porcelain 0 VALID -processing RedSand Forging.owner RedSand 0 VALID -processing RedSand Forging.target Glass 0 VALID -processing Sand Forging.owner Sand 0 VALID -processing Sand Forging.target Glass 0 VALID -processing SteelGalvanized Forging.owner SteelGalvanized 0 VALID -processing SteelGalvanized Forging.target Steel 0 VALID -processing SteelMagnetic Bending.owner SteelMagnetic 0 VALID -processing SteelMagnetic Bending.target Steel 0 VALID -processing SteelMagnetic Compressing.owner SteelMagnetic 0 VALID -processing SteelMagnetic Compressing.target Steel 0 VALID -processing SteelMagnetic Forging.owner SteelMagnetic 0 VALID -processing SteelMagnetic Forging.target Steel 0 VALID -processing SteelMagnetic Smashing.owner SteelMagnetic 0 VALID -processing SteelMagnetic Smashing.target Steel 0 VALID -processing SteelMagnetic Working.owner SteelMagnetic 0 VALID -processing SteelMagnetic Working.target Steel 0 VALID -processing TungstenSintered Cutting.owner TungstenSintered 0 VALID -processing TungstenSintered Forging.owner TungstenSintered 0 VALID -processing TungstenSintered Smashing.owner TungstenSintered 0 VALID -processing TungstenSintered Working.owner TungstenSintered 0 VALID -uum 10 owner 10 VALID -uum 100 owner 100 VALID -uum 110 owner 110 VALID -uum 120 owner 120 VALID -uum 1250 owner 1250 VALID -uum 1260 owner 1260 VALID -uum 130 owner 130 VALID -uum 140 owner 140 VALID -uum 1450 owner 1450 VALID -uum 150 owner 150 VALID -uum 1520 owner 1520 VALID -uum 160 owner 160 VALID -uum 170 owner 170 VALID -uum 1740 owner 1740 VALID -uum 180 owner 180 VALID -uum 1850 owner 1850 RETIRED -uum 1860 owner 1860 RETIRED -uum 1870 owner 1870 RETIRED -uum 1880 owner 1880 RETIRED -uum 190 owner 190 VALID -uum 20 owner 20 VALID -uum 200 owner 200 VALID -uum 210 owner 210 VALID -uum 220 owner 220 VALID -uum 2210 owner 2210 RETIRED -uum 2220 owner 2220 VALID -uum 230 owner 230 VALID -uum 2390 owner 2390 RETIRED -uum 240 owner 240 VALID -uum 250 owner 250 VALID -uum 260 owner 260 VALID -uum 270 owner 270 VALID -uum 280 owner 280 VALID -uum 290 owner 290 VALID -uum 30 owner 30 VALID -uum 300 owner 300 VALID -uum 310 owner 310 VALID -uum 320 owner 320 VALID -uum 330 owner 330 VALID -uum 340 owner 340 VALID -uum 350 owner 350 VALID -uum 360 owner 360 VALID -uum 370 owner 370 VALID -uum 3720 owner 3720 VALID -uum 380 owner 380 VALID -uum 390 owner 390 VALID -uum 40 owner 40 VALID -uum 400 owner 400 VALID -uum 410 owner 410 VALID -uum 420 owner 420 VALID -uum 440 owner 440 VALID -uum 450 owner 450 VALID -uum 460 owner 460 VALID -uum 470 owner 470 VALID -uum 480 owner 480 VALID -uum 490 owner 490 VALID -uum 50 owner 50 VALID -uum 500 owner 500 VALID -uum 510 owner 510 VALID -uum 520 owner 520 VALID -uum 530 owner 530 VALID -uum 540 owner 540 VALID -uum 550 owner 550 VALID -uum 560 owner 560 VALID -uum 570 owner 570 VALID -uum 580 owner 580 VALID -uum 590 owner 590 VALID -uum 60 owner 60 VALID -uum 600 owner 600 VALID -uum 620 owner 620 VALID -uum 630 owner 630 VALID -uum 640 owner 640 VALID -uum 650 owner 650 VALID -uum 660 owner 660 VALID -uum 670 owner 670 VALID -uum 680 owner 680 VALID -uum 690 owner 690 VALID -uum 70 owner 70 VALID -uum 700 owner 700 VALID -uum 710 owner 710 VALID -uum 720 owner 720 VALID -uum 730 owner 730 VALID -uum 740 owner 740 VALID -uum 750 owner 750 VALID -uum 760 owner 760 VALID -uum 770 owner 770 VALID -uum 780 owner 780 VALID -uum 790 owner 790 VALID -uum 80 owner 80 VALID -uum 800 owner 800 VALID -uum 8000 owner 8000 VALID -uum 8001 owner 8001 VALID -uum 8002 owner 8002 VALID -uum 8003 owner 8003 VALID -uum 8004 owner 8004 RETIRED -uum 8005 owner 8005 RETIRED -uum 8006 owner 8006 VALID -uum 8007 owner 8007 VALID -uum 8008 owner 8008 VALID -uum 8009 owner 8009 VALID -uum 8010 owner 8010 VALID -uum 8011 owner 8011 VALID -uum 8012 owner 8012 VALID -uum 8013 owner 8013 VALID -uum 8014 owner 8014 VALID -uum 8015 owner 8015 VALID -uum 8016 owner 8016 VALID -uum 8017 owner 8017 VALID -uum 8018 owner 8018 VALID -uum 8019 owner 8019 VALID -uum 8020 owner 8020 VALID -uum 8021 owner 8021 VALID -uum 8022 owner 8022 VALID -uum 8023 owner 8023 VALID -uum 8024 owner 8024 VALID -uum 8025 owner 8025 VALID -uum 8026 owner 8026 VALID -uum 8027 owner 8027 VALID -uum 8028 owner 8028 VALID -uum 8029 owner 8029 VALID -uum 8030 owner 8030 VALID -uum 8031 owner 8031 VALID -uum 8032 owner 8032 VALID -uum 8033 owner 8033 VALID -uum 8034 owner 8034 VALID -uum 8035 owner 8035 VALID -uum 8036 owner 8036 VALID -uum 8037 owner 8037 VALID -uum 8038 owner 8038 VALID -uum 8039 owner 8039 VALID -uum 810 owner 810 VALID -uum 8196 owner 8196 VALID -uum 8197 owner 8197 VALID -uum 8198 owner 8198 RETIRED -uum 8199 owner 8199 RETIRED -uum 820 owner 820 VALID -uum 8203 owner 8203 VALID -uum 8204 owner 8204 VALID -uum 8205 owner 8205 VALID -uum 8206 owner 8206 VALID -uum 8207 owner 8207 VALID -uum 8208 owner 8208 VALID -uum 8209 owner 8209 VALID -uum 8215 owner 8215 VALID -uum 8217 owner 8217 VALID -uum 8218 owner 8218 VALID -uum 8219 owner 8219 VALID -uum 8220 owner 8220 VALID -uum 8221 owner 8221 VALID -uum 8222 owner 8222 VALID -uum 8224 owner 8224 VALID -uum 8225 owner 8225 VALID -uum 8226 owner 8226 VALID -uum 8227 owner 8227 RETIRED -uum 8229 owner 8229 VALID -uum 8230 owner 8230 VALID -uum 8231 owner 8231 VALID -uum 8232 owner 8232 VALID -uum 8233 owner 8233 VALID -uum 8234 owner 8234 VALID -uum 8242 owner 8242 VALID -uum 8243 owner 8243 RETIRED -uum 8249 owner 8249 VALID -uum 8267 owner 8267 VALID -uum 8268 owner 8268 VALID -uum 8269 owner 8269 VALID -uum 8270 owner 8270 VALID -uum 8271 owner 8271 VALID -uum 8272 owner 8272 VALID -uum 8273 owner 8273 VALID -uum 8274 owner 8274 VALID -uum 8275 owner 8275 VALID -uum 8276 owner 8276 VALID -uum 8286 owner 8286 RETIRED -uum 8287 owner 8287 RETIRED -uum 8291 owner 8291 RETIRED -uum 8292 owner 8292 RETIRED -uum 8298 owner 8298 VALID -uum 8299 owner 8299 VALID -uum 8300 owner 8300 VALID -uum 8301 owner 8301 VALID -uum 8302 owner 8302 VALID -uum 8303 owner 8303 VALID -uum 8304 owner 8304 VALID -uum 8305 owner 8305 VALID -uum 8306 owner 8306 VALID -uum 8307 owner 8307 VALID -uum 8308 owner 8308 VALID -uum 8309 owner 8309 VALID -uum 8311 owner 8311 VALID -uum 8312 owner 8312 VALID -uum 8313 owner 8313 VALID -uum 8314 owner 8314 VALID -uum 8315 owner 8315 VALID -uum 8323 owner 8323 VALID -uum 8324 owner 8324 VALID -uum 8325 owner 8325 VALID -uum 8326 owner 8326 VALID -uum 8328 owner 8328 VALID -uum 8330 owner 8330 VALID -uum 8331 owner 8331 VALID -uum 8332 owner 8332 VALID -uum 8333 owner 8333 VALID -uum 8334 owner 8334 VALID -uum 8335 owner 8335 VALID -uum 8336 owner 8336 VALID -uum 8340 owner 8340 VALID -uum 8341 owner 8341 VALID -uum 8346 owner 8346 VALID -uum 8347 owner 8347 VALID -uum 8348 owner 8348 VALID -uum 8349 owner 8349 VALID -uum 8362 owner 8362 RETIRED -uum 8363 owner 8363 RETIRED -uum 8364 owner 8364 RETIRED -uum 8368 owner 8368 RETIRED -uum 8369 owner 8369 RETIRED -uum 8370 owner 8370 RETIRED -uum 8371 owner 8371 RETIRED -uum 8372 owner 8372 RETIRED -uum 8374 owner 8374 RETIRED -uum 8375 owner 8375 RETIRED -uum 8376 owner 8376 RETIRED -uum 8377 owner 8377 RETIRED -uum 8378 owner 8378 RETIRED -uum 8379 owner 8379 RETIRED -uum 8380 owner 8380 RETIRED -uum 8383 owner 8383 VALID -uum 8384 owner 8384 VALID -uum 8385 owner 8385 VALID -uum 8386 owner 8386 VALID -uum 8387 owner 8387 VALID -uum 8388 owner 8388 RETIRED -uum 8389 owner 8389 VALID -uum 8390 owner 8390 VALID -uum 8393 owner 8393 VALID -uum 8394 owner 8394 RETIRED -uum 8395 owner 8395 VALID -uum 8396 owner 8396 VALID -uum 8397 owner 8397 VALID -uum 8400 owner 8400 VALID -uum 8401 owner 8401 VALID -uum 8402 owner 8402 VALID -uum 8403 owner 8403 VALID -uum 8404 owner 8404 VALID -uum 8405 owner 8405 VALID -uum 8406 owner 8406 VALID -uum 8407 owner 8407 VALID -uum 8408 owner 8408 VALID -uum 8409 owner 8409 VALID -uum 8410 owner 8410 VALID -uum 8411 owner 8411 RETIRED -uum 8412 owner 8412 VALID -uum 8413 owner 8413 VALID -uum 8415 owner 8415 VALID -uum 8416 owner 8416 VALID -uum 8417 owner 8417 VALID -uum 8418 owner 8418 VALID -uum 8419 owner 8419 VALID -uum 8420 owner 8420 VALID -uum 8423 owner 8423 VALID -uum 8424 owner 8424 VALID -uum 8425 owner 8425 VALID -uum 8426 owner 8426 VALID -uum 8427 owner 8427 VALID -uum 8428 owner 8428 VALID -uum 8429 owner 8429 VALID -uum 8430 owner 8430 VALID -uum 8431 owner 8431 VALID -uum 8432 owner 8432 VALID -uum 8433 owner 8433 VALID -uum 8434 owner 8434 VALID -uum 8435 owner 8435 VALID -uum 8436 owner 8436 VALID -uum 8437 owner 8437 VALID -uum 8438 owner 8438 VALID -uum 8439 owner 8439 VALID -uum 8440 owner 8440 VALID -uum 8441 owner 8441 VALID -uum 8442 owner 8442 VALID -uum 8443 owner 8443 VALID -uum 8444 owner 8444 VALID -uum 8445 owner 8445 VALID -uum 8446 owner 8446 VALID -uum 8447 owner 8447 VALID -uum 8448 owner 8448 VALID -uum 8449 owner 8449 VALID -uum 8450 owner 8450 VALID -uum 8451 owner 8451 VALID -uum 8455 owner 8455 VALID -uum 8456 owner 8456 RETIRED -uum 8457 owner 8457 RETIRED -uum 8458 owner 8458 VALID -uum 8459 owner 8459 VALID -uum 8460 owner 8460 VALID -uum 8461 owner 8461 VALID -uum 8462 owner 8462 VALID -uum 8463 owner 8463 RETIRED -uum 8464 owner 8464 VALID -uum 8465 owner 8465 VALID -uum 8466 owner 8466 RETIRED -uum 8467 owner 8467 VALID -uum 8468 owner 8468 VALID -uum 8600 owner 8600 VALID -uum 8601 owner 8601 VALID -uum 8602 owner 8602 VALID -uum 8603 owner 8603 RETIRED -uum 8604 owner 8604 RETIRED -uum 8605 owner 8605 VALID -uum 8610 owner 8610 VALID -uum 8611 owner 8611 VALID -uum 8613 owner 8613 RETIRED -uum 8614 owner 8614 VALID -uum 8615 owner 8615 VALID -uum 8620 owner 8620 VALID -uum 8621 owner 8621 VALID -uum 8622 owner 8622 VALID -uum 8630 owner 8630 VALID -uum 8631 owner 8631 VALID -uum 8633 owner 8633 VALID -uum 8634 owner 8634 VALID -uum 8635 owner 8635 VALID -uum 8636 owner 8636 VALID -uum 8637 owner 8637 RETIRED -uum 8638 owner 8638 VALID -uum 8639 owner 8639 RETIRED -uum 8640 owner 8640 VALID -uum 8642 owner 8642 RETIRED -uum 8643 owner 8643 VALID -uum 8644 owner 8644 RETIRED -uum 8645 owner 8645 VALID -uum 8646 owner 8646 VALID -uum 8647 owner 8647 VALID -uum 8649 owner 8649 RETIRED -uum 8650 owner 8650 RETIRED -uum 8652 owner 8652 VALID -uum 8653 owner 8653 VALID -uum 8654 owner 8654 RETIRED -uum 8657 owner 8657 RETIRED -uum 8658 owner 8658 VALID -uum 8659 owner 8659 VALID -uum 8660 owner 8660 VALID -uum 8661 owner 8661 VALID -uum 8662 owner 8662 VALID -uum 8663 owner 8663 VALID -uum 8664 owner 8664 VALID -uum 8665 owner 8665 VALID -uum 8666 owner 8666 VALID -uum 8667 owner 8667 VALID -uum 8668 owner 8668 VALID -uum 8669 owner 8669 VALID -uum 8682 owner 8682 VALID -uum 8684 owner 8684 VALID -uum 8685 owner 8685 VALID -uum 8686 owner 8686 VALID -uum 8687 owner 8687 VALID -uum 8688 owner 8688 RETIRED -uum 8689 owner 8689 VALID -uum 8690 owner 8690 RETIRED -uum 8692 owner 8692 RETIRED -uum 8700 owner 8700 VALID -uum 8704 owner 8704 VALID -uum 8705 owner 8705 VALID -uum 8706 owner 8706 VALID -uum 8708 owner 8708 VALID -uum 8709 owner 8709 VALID -uum 8711 owner 8711 RETIRED -uum 8727 owner 8727 VALID -uum 8728 owner 8728 RETIRED -uum 8729 owner 8729 VALID -uum 8730 owner 8730 VALID -uum 8733 owner 8733 VALID -uum 8737 owner 8737 VALID -uum 8750 owner 8750 RETIRED -uum 8751 owner 8751 VALID -uum 8752 owner 8752 VALID -uum 8756 owner 8756 VALID -uum 8757 owner 8757 RETIRED -uum 8758 owner 8758 RETIRED -uum 8766 owner 8766 RETIRED -uum 8776 owner 8776 RETIRED -uum 8780 owner 8780 RETIRED -uum 8782 owner 8782 RETIRED -uum 8784 owner 8784 VALID -uum 8790 owner 8790 VALID -uum 8793 owner 8793 VALID -uum 8794 owner 8794 RETIRED -uum 8796 owner 8796 VALID -uum 8797 owner 8797 VALID -uum 8798 owner 8798 VALID -uum 8802 owner 8802 VALID -uum 8803 owner 8803 VALID -uum 8804 owner 8804 RETIRED -uum 8808 owner 8808 RETIRED -uum 90 owner 90 VALID -uum 9101 owner 9101 VALID -uum 9102 owner 9102 VALID -uum 9103 owner 9103 VALID -uum 9104 owner 9104 VALID -uum 9107 owner 9107 VALID -uum 9109 owner 9109 VALID -uum 9110 owner 9110 VALID -uum 9111 owner 9111 VALID -uum 9114 owner 9114 VALID -uum 9115 owner 9115 VALID -uum 9116 owner 9116 VALID -uum 9117 owner 9117 VALID -uum 9119 owner 9119 VALID -uum 9120 owner 9120 VALID -uum 9123 owner 9123 VALID -uum 9125 owner 9125 VALID -uum 9126 owner 9126 VALID -uum 9127 owner 9127 VALID -uum 9128 owner 9128 VALID -uum 9129 owner 9129 VALID -uum 9130 owner 9130 VALID -uum 9131 owner 9131 VALID -uum 9132 owner 9132 VALID -uum 9133 owner 9133 VALID -uum 9135 owner 9135 VALID -uum 9140 owner 9140 VALID -uum 9145 owner 9145 VALID -uum 9153 owner 9153 VALID -uum 9154 owner 9154 VALID -uum 9160 owner 9160 VALID -uum 9161 owner 9161 VALID -uum 9167 owner 9167 VALID -uum 9169 owner 9169 VALID -uum 9174 owner 9174 VALID -uum 9175 owner 9175 VALID -uum 9192 owner 9192 VALID -uum 9193 owner 9193 VALID -uum 9194 owner 9194 VALID -uum 9195 owner 9195 VALID -uum 9197 owner 9197 VALID -uum 9213 owner 9213 VALID -uum 9214 owner 9214 VALID -uum 9215 owner 9215 VALID -uum 9216 owner 9216 VALID -uum 9217 owner 9217 VALID -uum 9243 owner 9243 VALID -uum 9271 owner 9271 VALID -uum 9300 owner 9300 VALID -uum 9301 owner 9301 VALID -uum 9302 owner 9302 VALID -uum 9303 owner 9303 VALID -uum 9304 owner 9304 VALID -uum 9305 owner 9305 VALID -uum 9306 owner 9306 VALID -uum 9307 owner 9307 VALID -uum 9308 owner 9308 VALID -uum 9309 owner 9309 VALID -uum 9310 owner 9310 VALID -uum 9311 owner 9311 VALID -uum 9312 owner 9312 VALID -uum 9313 owner 9313 VALID -uum 9314 owner 9314 VALID -uum 9315 owner 9315 VALID -uum 9316 owner 9316 VALID -uum 9317 owner 9317 VALID -uum 9318 owner 9318 VALID -uum 9319 owner 9319 VALID -uum 9320 owner 9320 RETIRED -uum 9321 owner 9321 RETIRED -uum 9322 owner 9322 RETIRED -uum 9323 owner 9323 RETIRED -uum 9324 owner 9324 RETIRED -uum 9325 owner 9325 RETIRED -uum 9326 owner 9326 RETIRED -uum 9327 owner 9327 RETIRED -uum 9328 owner 9328 RETIRED -uum 9329 owner 9329 RETIRED -uum 9330 owner 9330 RETIRED -uum 9331 owner 9331 RETIRED -uum 9332 owner 9332 RETIRED -uum 9333 owner 9333 RETIRED -uum 9334 owner 9334 RETIRED -uum 9335 owner 9335 RETIRED -uum 9336 owner 9336 RETIRED -uum 9337 owner 9337 RETIRED -uum 9338 owner 9338 RETIRED -uum 9339 owner 9339 RETIRED -uum 9340 owner 9340 RETIRED -uum 9341 owner 9341 RETIRED -uum 9342 owner 9342 RETIRED -uum 9343 owner 9343 RETIRED -uum 9344 owner 9344 VALID -uum 9345 owner 9345 RETIRED -uum 9346 owner 9346 RETIRED -uum 9347 owner 9347 RETIRED -uum 9348 owner 9348 RETIRED -uum 9349 owner 9349 RETIRED -uum 9350 owner 9350 RETIRED -uum 9351 owner 9351 RETIRED -uum 9352 owner 9352 RETIRED -uum 9353 owner 9353 RETIRED -uum 9354 owner 9354 RETIRED -uum 9355 owner 9355 RETIRED -uum 9356 owner 9356 RETIRED -uum 9357 owner 9357 RETIRED -uum 9358 owner 9358 RETIRED -uum 9359 owner 9359 RETIRED -uum 9360 owner 9360 RETIRED -uum 9361 owner 9361 RETIRED -uum 9362 owner 9362 RETIRED -uum 9363 owner 9363 RETIRED -uum 9364 owner 9364 RETIRED -uum 9365 owner 9365 RETIRED -uum 9366 owner 9366 RETIRED -uum 9367 owner 9367 RETIRED -uum 9368 owner 9368 RETIRED -uum 9369 owner 9369 RETIRED -uum 9370 owner 9370 RETIRED -uum 9371 owner 9371 RETIRED -uum 9372 owner 9372 VALID -uum 9373 owner 9373 RETIRED -uum 9374 owner 9374 RETIRED -uum 9375 owner 9375 RETIRED -uum 9376 owner 9376 RETIRED -uum 9377 owner 9377 RETIRED -uum 9378 owner 9378 RETIRED -uum 9379 owner 9379 RETIRED -uum 9380 owner 9380 RETIRED -uum 9381 owner 9381 RETIRED -uum 9382 owner 9382 RETIRED -uum 9383 owner 9383 RETIRED -uum 9384 owner 9384 RETIRED -uum 9385 owner 9385 RETIRED -uum 9386 owner 9386 RETIRED -uum 9387 owner 9387 RETIRED -uum 9388 owner 9388 RETIRED -uum 9389 owner 9389 RETIRED -uum 9390 owner 9390 RETIRED -uum 9391 owner 9391 RETIRED -uum 9392 owner 9392 RETIRED -uum 9393 owner 9393 RETIRED -uum 9394 owner 9394 RETIRED -uum 9395 owner 9395 RETIRED -uum 9396 owner 9396 RETIRED -uum 9397 owner 9397 RETIRED -uum 9398 owner 9398 RETIRED -uum 9399 owner 9399 RETIRED -uum 9400 owner 9400 RETIRED -uum 9401 owner 9401 RETIRED -uum 9402 owner 9402 RETIRED -uum 9403 owner 9403 RETIRED -uum 9404 owner 9404 RETIRED -uum 9405 owner 9405 RETIRED -uum 9406 owner 9406 RETIRED -uum 9407 owner 9407 RETIRED -uum 9408 owner 9408 RETIRED -uum 9409 owner 9409 VALID -uum 9703 owner 9703 VALID -uum 9787 owner 9787 RETIRED -uum 9800 owner 9800 VALID -uum 9801 owner 9801 VALID -uum 9802 owner 9802 VALID -uum 9803 owner 9803 VALID -uum 9804 owner 9804 VALID -uum 9808 owner 9808 VALID -uum 9809 owner 9809 VALID -uum 9814 owner 9814 VALID -uum 9815 owner 9815 VALID -uum 9820 owner 9820 VALID -uum 9821 owner 9821 VALID -uum 9822 owner 9822 VALID -uum 9823 owner 9823 VALID -uum 9824 owner 9824 VALID -uum 9825 owner 9825 VALID -uum 9826 owner 9826 VALID -uum 9827 owner 9827 VALID -uum 9828 owner 9828 VALID -uum 9829 owner 9829 VALID -uum 9830 owner 9830 VALID -uum 9831 owner 9831 VALID -uum 9832 owner 9832 VALID -uum 9834 owner 9834 VALID -uum 9835 owner 9835 VALID -uum 9836 owner 9836 VALID -uum 9837 owner 9837 VALID -uum 9838 owner 9838 VALID -uum 9839 owner 9839 VALID -uum 9843 owner 9843 VALID -uum 9844 owner 9844 VALID diff --git a/core/src/test/resources/gregtech/material-reference-history.tsv b/core/src/test/resources/gregtech/material-reference-history.tsv deleted file mode 100644 index f37e8fe3a..000000000 --- a/core/src/test/resources/gregtech/material-reference-history.tsv +++ /dev/null @@ -1,94 +0,0 @@ -# table owner field name id classification evidence (GT6 3703e403 MT.java, or existing parity) -composition Iridiron owner Iridiron 0 RETIRED MT.java:3997 unused/deprecated;上游即非可用材料 -composition IridironReinforced owner IridironReinforced 0 RETIRED MT.java:3998 unused/deprecated;上游即非可用材料 -composition OsmiumTetroxide owner OsmiumTetroxide 0 RETIRED MT.java:3994 unused/deprecated;上游即非可用材料 -composition SodiumPeroxide owner SodiumPeroxide 0 RETIRED MT.java:3995 unused/deprecated;上游即非可用材料 -composition Vis owner Vis 0 RETIRED MT.java:4003 unused/deprecated;上游即非可用材料 -forms adamite owner adamite 0 RETIRED MT.java:4044 unused/deprecated;上游即非可用材料 -forms adluorite owner adluorite 0 RETIRED MT.java:4045 unused/deprecated;上游即非可用材料 -forms advancedalloy owner advancedalloy 0 RETIRED MT.java:4066 unused/deprecated;上游即非可用材料 -forms agate owner agate 0 RETIRED MT.java:4046 unused/deprecated;上游即非可用材料 -forms amberdominican owner amberdominican 0 RETIRED DominicanAmber 的导入别名随 Fossils and Archeology 材料一并退役,见 docs/decisions/parity/material-removal.md -forms ametrine owner ametrine 0 RETIRED MT.java:1475 valgem(0);未分配有效材料 ID -forms ammonium owner ammonium 0 RETIRED MT.java:4047 unused/deprecated;上游即非可用材料 -forms angelite owner angelite 0 RETIRED MT.java:1472 valgem(0);未分配有效材料 ID -forms australium owner australium 0 RETIRED MT.java:4060 unused/deprecated;上游即非可用材料 -forms basanite owner basanite 0 RETIRED MT.java:1470 valgem(0);未分配有效材料 ID -forms bitumen owner bitumen 0 RETIRED MT.java:4048 unused/deprecated;上游即非可用材料 -forms blackberyl owner blackberyl 0 RETIRED MT.java:1455 valgem(0);未分配有效材料 ID -forms bloodstone owner bloodstone 0 RETIRED MT.java:1449,4049 unused/deprecated;上游即非可用材料 -forms carnelian owner carnelian 0 RETIRED MT.java:1464 valgem(0);未分配有效材料 ID -forms charoite owner charoite 0 RETIRED MT.java:1463 valgem(0);未分配有效材料 ID -forms chestnut owner chestnut 0 RETIRED MT.java:3929;字段对应 Chestnutwood(9345),见 docs/decisions/parity/material-removal.md -forms chrysocolla owner chrysocolla 0 RETIRED MT.java:1468,4052 unused/deprecated;上游即非可用材料 -forms chrysoprase owner chrysoprase 0 RETIRED MT.java:1474 valgem(0);未分配有效材料 ID -forms citrine owner citrine 0 RETIRED MT.java:4050 unused/deprecated;上游即非可用材料 -forms citrus owner citrus 0 RETIRED MT.java:3930;字段对应 Citruswood(9346),见 docs/decisions/parity/material-removal.md -forms cmbsteel owner cmbsteel 0 RETIRED MT.java:4064 unused/deprecated;上游即非可用材料 -forms coral owner coral 0 RETIRED MT.java:1469,4051 unused/deprecated;上游即非可用材料 -forms crystalflux owner crystalflux 0 RETIRED MT.java:4018 unused/deprecated;上游即非可用材料 -forms daffergon owner daffergon 0 RETIRED MT.java:4056 unused/deprecated;上游即非可用材料 -forms darkstone owner darkstone 0 RETIRED MT.java:4053 unused/deprecated;上游即非可用材料 -forms demonite owner demonite 0 RETIRED MT.java:4054 unused/deprecated;上游即非可用材料 -forms dineutronium owner dineutronium 0 RETIRED MT.java:4068 unused/deprecated;上游即非可用材料 -forms draconic owner draconic 0 RETIRED MT.java:4012 unused/deprecated;上游即非可用材料 -forms dumortierite owner dumortierite 0 RETIRED MT.java:1459 valgem(0);未分配有效材料 ID -forms durasteel owner durasteel 0 RETIRED MT.java:4065 unused/deprecated;上游即非可用材料 -forms elder owner elder 0 RETIRED MT.java:3967;字段对应 Elderwood(9382),见 docs/decisions/parity/material-removal.md -forms euphemium owner euphemium 0 RETIRED MT.java:4070 unused/deprecated;上游即非可用材料 -forms fig owner fig 0 RETIRED MT.java:3970;字段对应 Figwood(9385),见 docs/decisions/parity/material-removal.md -forms infusedgold owner infusedgold 0 RETIRED MT.java:4055 unused/deprecated;上游即非可用材料 -forms invisium owner invisium 0 RETIRED MT.java:4021 unused/deprecated;上游即非可用材料 -forms iridiron owner iridiron 0 RETIRED MT.java:3997 unused/deprecated;上游即非可用材料 -forms iridironreinforced owner iridironreinforced 0 RETIRED MT.java:3998 unused/deprecated;上游即非可用材料 -forms ironsharp owner ironsharp 0 RETIRED MT.java:4016 unused/deprecated;上游即非可用材料 -forms irridantreinforced owner irridantreinforced 0 RETIRED MT.java:4015 unused/deprecated;上游即非可用材料 -forms irridanturanium owner irridanturanium 0 RETIRED MT.java:4014 unused/deprecated;上游即非可用材料 -forms jet owner jet 0 RETIRED MT.java:1452,4091 unused/deprecated;上游即非可用材料 -forms kunzite owner kunzite 0 RETIRED MT.java:1471 valgem(0);未分配有效材料 ID -forms labradorite owner labradorite 0 RETIRED MT.java:1458 valgem(0);未分配有效材料 ID -forms lapislazuli owner lapislazuli 0 RETIRED MT.java:1453 valgem(0);未分配有效材料 ID -forms larimar owner larimar 0 RETIRED MT.java:1462 valgem(0);未分配有效材料 ID -forms lodestone owner lodestone 0 RETIRED MT.java:4022 unused/deprecated;上游即非可用材料 -forms luminite owner luminite 0 RETIRED MT.java:4023 unused/deprecated;上游即非可用材料 -forms magnetizedtungsten owner magnetizedtungsten 0 RETIRED MT.java:4069 unused/deprecated;上游即非可用材料 -forms mawsitsit owner mawsitsit 0 RETIRED MT.java:4025 unused/deprecated;上游即非可用材料 -forms mercassium owner mercassium 0 RETIRED MT.java:4005 unused/deprecated;上游即非可用材料 -forms mimichite owner mimichite 0 RETIRED MT.java:4019 unused/deprecated;上游即非可用材料 -forms moissanite owner moissanite 0 RETIRED MT.java:1460 valgem(0);未分配有效材料 ID -forms mookaite owner mookaite 0 RETIRED MT.java:1461 valgem(0);未分配有效材料 ID -forms obsidianflux owner obsidianflux 0 RETIRED MT.java:4017 unused/deprecated;上游即非可用材料 -forms olive owner olive 0 RETIRED MT.java:3980;字段对应 Olivewood(9395),见 docs/decisions/parity/material-removal.md -forms osmonium owner osmonium 0 RETIRED MT.java:4006 unused/deprecated;上游即非可用材料 -forms papaya owner papaya 0 RETIRED MT.java:3941;字段对应 Papayawood(9359),见 docs/decisions/parity/material-removal.md -forms pear owner pear 0 RETIRED MT.java:3981;字段对应 Pearwood(9396),见 docs/decisions/parity/material-removal.md -forms petroleum owner petroleum 0 RETIRED MT.java:4028 unused/deprecated;上游即非可用材料 -forms phoenixite owner phoenixite 0 RETIRED MT.java:4007 unused/deprecated;上游即非可用材料 -forms pietersite owner pietersite 0 RETIRED MT.java:1467 valgem(0);未分配有效材料 ID -forms plum owner plum 0 RETIRED MT.java:3942;字段对应 Plumwood(9360),见 docs/decisions/parity/material-removal.md -forms randomite owner randomite 0 RETIRED MT.java:4031 unused/deprecated;上游即非可用材料 -forms reiium owner reiium 0 RETIRED MT.java:4057 unused/deprecated;上游即非可用材料 -forms rhodonite owner rhodonite 0 RETIRED MT.java:1457 valgem(0);未分配有效材料 ID -forms saturnite owner saturnite 0 RETIRED MT.java:4067 unused/deprecated;上游即非可用材料 -forms scapolite owner scapolite 0 RETIRED MT.java:1473 valgem(0);未分配有效材料 ID -forms schrabidium owner schrabidium 0 RETIRED MT.java:4061 unused/deprecated;上游即非可用材料 -forms selenite owner selenite 0 RETIRED MT.java:1466,4090 unused/deprecated;上游即非可用材料 -forms snowflakeobsidian owner snowflakeobsidian 0 RETIRED MT.java:1454 valgem(0);未分配有效材料 ID -forms starconium owner starconium 0 RETIRED MT.java:4009 unused/deprecated;上游即非可用材料 -forms starmetal owner starmetal 0 RETIRED MT.java:4062 unused/deprecated;上游即非可用材料 -forms tapazite owner tapazite 0 RETIRED MT.java:4040 unused/deprecated;上游即非可用材料 -forms terrasteelalloyraw owner terrasteelalloyraw 0 RETIRED MT.java:4001 unused/deprecated;上游即非可用材料 -forms terrasteelalloystrengthened owner terrasteelalloystrengthened 0 RETIRED MT.java:4002 unused/deprecated;上游即非可用材料 -forms teslatite owner teslatite 0 RETIRED MT.java:4013 unused/deprecated;上游即非可用材料 -forms thyrium owner thyrium 0 RETIRED MT.java:4010 unused/deprecated;上游即非可用材料 -forms tourmaline owner tourmaline 0 RETIRED MT.java:4041 unused/deprecated;上游即非可用材料 -forms turquoise owner turquoise 0 RETIRED MT.java:4042 unused/deprecated;上游即非可用材料 -forms unakite owner unakite 0 RETIRED MT.java:1465 valgem(0);未分配有效材料 ID -forms unobtainium owner unobtainium 0 RETIRED MT.java:4063 unused/deprecated;上游即非可用材料 -forms verticium owner verticium 0 RETIRED MT.java:4059 unused/deprecated;上游即非可用材料 -forms walnut owner walnut 0 RETIRED MT.java:3946;字段对应 Walnutwood(9364),见 docs/decisions/parity/material-removal.md -forms weidanium owner weidanium 0 RETIRED MT.java:4058 unused/deprecated;上游即非可用材料 -forms wimalite owner wimalite 0 RETIRED MT.java:4043 unused/deprecated;上游即非可用材料 -forms wonderstone owner wonderstone 0 RETIRED MT.java:1450 valgem(0);未分配有效材料 ID -forms zectium owner zectium 0 RETIRED MT.java:4011 unused/deprecated;上游即非可用材料 -processing EndSandWhite Forging.owner EndSandWhite 0 RETIRED MT.java:1620;字段对应 White End Sand(8105),见 docs/decisions/parity/material-removal.md diff --git a/docs/ADDON_API.zh-CN.md b/docs/ADDON_API.zh-CN.md index 90048ab02..324a319fd 100644 --- a/docs/ADDON_API.zh-CN.md +++ b/docs/ADDON_API.zh-CN.md @@ -39,9 +39,9 @@ | 产物坐标 | 内容与输出 | | --- | --- | -| `gregtech:gt6ce-api:1.8.0` | Java 17 公共协议、模型、声明和宿主服务接口;`api/common/build/libs/` | -| `gregtech:gt6ce-addon-sdk-1.20.1-forge:1.8.0` | Java 17、Mojang 名称的 Forge 游戏侧 API;对应节点 `build/addon-sdk/` | -| `gregtech:gt6ce-addon-sdk-1.21.1-neoforge:1.8.0` | Java 21 的 NeoForge 游戏侧 API;对应节点 `build/addon-sdk/` | +| `gregtech:gt6ce-api:1.9.0` | Java 17 公共协议、模型、声明和宿主服务接口;`api/common/build/libs/` | +| `gregtech:gt6ce-addon-sdk-1.20.1-forge:1.9.0` | Java 17、Mojang 名称的 Forge 游戏侧 API;对应节点 `build/addon-sdk/` | +| `gregtech:gt6ce-addon-sdk-1.21.1-neoforge:1.9.0` | Java 21 的 NeoForge 游戏侧 API;对应节点 `build/addon-sdk/` | 这些是构建配置中的坐标,不表示已发布到公共 Maven 仓库。版本规则见下节[API 版本](#api-版本)。 @@ -55,7 +55,11 @@ ## API 版本 -当前分支使用 API `1.8.0`,与模组版本独立;以 [api/common/build.gradle](../api/common/build.gradle) 为准。`GregTechAddons.apiVersion()` 返回 `major * 1000 + minor`,1.8 为 `1008`,不能据此推断某个模组构建兼容。修改内联 API 时同步构建配置与 `GregTechAddons` 的版本。 +当前分支使用 API `1.9.0`,与模组版本独立;以 [api/common/build.gradle](../api/common/build.gradle) 为准。`GregTechAddons.apiVersion()` 返回 `major * 1000 + minor`,1.9 为 `1009`,不能据此推断某个模组构建兼容。修改内联 API 时同步构建配置与 `GregTechAddons` 的版本。 + +API 1.9 新增 `SpecialProcessMethod`、`SpecialProcessValue` 与 `SpecialProcessesView`。附属通过 `MaterialInfoTool.Registrar.registerSpecialProcess(...)` 声明 typed target/reagent 规则,再通过 `MaterialCatalogView.specialProcesses()` 当前发布快照读取;target 和 reagent 必须绑定同一个 `MaterialProcessKey`。 + +特殊工艺试剂与产物按 `MaterialCatalogView.formBindings()` 已发布的实际形态解析。流体试剂的 `reagentAmount` 和流体产物的 `millibuckets` 直接使用 mB;水和岩浆的原版流体身份也发布为材料形态,不要求内部 `MATERIAL_FLUID_UNIT` 换算条目;`anyForm(new SpecialProcessValue.Reagent())` 从该材料已发布的形态中选择可解析的试剂。任一必需产物无法解析时整行拒绝,日志按输入、试剂、物品产物、流体产物分类汇总,避免发布缺少产物的配方。 宿主专用的 `StructureGrid` 与 `RecipeMapSpec` 不属于附属契约:它们分别位于 `gregtech.content.multiblock` 与 `gregtech.content.recipe`,编码内置多方块几何和配方表,附属不应依赖。 diff --git a/docs/architecture/packages/api.md b/docs/architecture/packages/api.md index 5e9885386..84be04eee 100644 --- a/docs/architecture/packages/api.md +++ b/docs/architecture/packages/api.md @@ -10,7 +10,7 @@ | --- | --- | --- | | `api` | API 包的总体契约说明 | `package-info.java` | | `api.addon` | 附属发现、身份、生命周期、命名限制与 SPI | `GregTechAddon`、`GregTechAddons`、`AddonRuntime`;声明失败应有上下文 | -| `api.addon.material` | 材料、前缀、成分、形态、类型化 metadata、分类 tag、替代组和分解声明 | `MaterialDeclaration`、`MaterialMetadata`、`MaterialTagDeclaration`、`MaterialGroupDeclaration`、`MaterialDecompositionRule`、`GregTechMaterials` | +| `api.addon.material` | 材料、前缀、成分、形态、类型化 metadata、分类 tag、替代组、分解和特殊处理声明 | `MaterialDeclaration`、`MaterialMetadata`、`MaterialTagDeclaration`、`MaterialGroupDeclaration`、`MaterialDecompositionRule`、`SpecialProcessMethod`、`SpecialProcessValue`、`SpecialProcessesView`、`GregTechMaterials` | | `api.addon.machine` | 机器、行为、部件、布局及参数声明 | `AddonMachine.withStructure` 显式绑定;`MultiblockMachine`、`BehaviorMachine`、`LayoutPart`、`AddonMachineContributor` | | `api.addon.recipe` | 配方表、坩埚反应、模具、保留输入与概率声明,以及 `gt6ce:machine` 数据包文档 | `RecipeMachine`、`CrucibleReactionDeclaration`、`RecipeOutputChances`、`MachineRecipeDocument`、`MachineRecipeDocuments`、`MachineRecipeDocumentType` | | `api.addon.pipe` | 附属物品/流体管道的定义 | `ItemPipeDeclaration`、`FluidPipeDeclaration` | diff --git a/docs/architecture/packages/content.md b/docs/architecture/packages/content.md index 59b08440c..3470209f4 100644 --- a/docs/architecture/packages/content.md +++ b/docs/architecture/packages/content.md @@ -10,7 +10,7 @@ core 的 content 描述“有什么”,Minecraft 的 content 将其变为游 | --- | --- | --- | | `content` | 内容层总体职责说明 | `package-info.java` | | `content.material` | 材料目录入口、物性规则和稳定符号门面 | `MaterialDefinitions`、`Materials`;读取符号不触发注册 | -| `content.material.catalog` | 元素、化合物、矿石、石材、木材、特殊材料和组的规范声明 | `ElementMaterials`、`CompoundMaterials`、`GroupMaterials`;每项材料事实只在这里维护 | +| `content.material.catalog` | 元素、化合物、矿石、石材、木材、特殊材料和组的规范声明 | `ElementMaterials`、`CompoundMaterials`、`GroupMaterials`;材料目录事实在这里维护,游戏侧桥接事实经 typed key 汇入 | | `content.material.generated` | 既有 GT6 字段符号门面 | `ElementMaterials`、`CompoundMaterials`;引用规范目录中的已安装对象 | | `content.data` | 原版参数、跨领域内容事实与标识表 | `FluidCatalog`、`MaterialGroups`;仅跨领域事实放这里 | | `content.data.generated` | 尚留存的兼容查询门面和历史字段映射 | `MaterialForms`、`MaterialProcessingTargets`;权威材料事实位于 `content.material.catalog` | @@ -76,6 +76,14 @@ core 的 content 描述“有什么”,Minecraft 的 content 将其变为游 涉及跨模组联动时的来源、单位转换与冲突处理提炼到 [integration](../../integration/README.md);材料目录、形态、成分、回收与分解的系统设计见[材料系统设计](../../decisions/material-system/README.md),偏离原 GT6 的有意差异登记到 [parity](../../decisions/parity/README.md)。不要因 `Original*` 名字而声称完整还原。生成表来源缺失时先记录局限,参见[生成物说明](../resources.md)。验收与自动化测试范围见下。 +### 浸泡槽的特殊处理 + +`SharedSpecialProcessRows` 统一生成声明式酸浸配方,包括金、铜、锡、锡石的八条王水配方;`generated/GTOreRecipes` 不再重复注册这八条静态行。该表的原始转换工具未随仓库保存,本次按固定 GT6 提交的 `Loader_Recipes_Ores` 与现存 typed target 局部收口,未重新生成整表。王水仍接收 1 份洁净矿或 9 份小份洁净矿,保留原有用量、流体产物和五个独立的 50% 副产物槽。 + +过硫酸钠/钾、汞和火石浸洗仍由 `SharedOreWashingRows` 根据洗矿事实生成;它们处理碎矿并产出洁净矿,酸浸处理洁净矿并产出离心矿,属于不同阶段。过硫酸盐保留四种投料组合、900/100 mB 水和 144/16 tick 比例,不产生蒸汽。浸泡槽造纸继续接收所有具有 `WOOD` 属性的已注册材料粉末,以及树皮和纸粉,不以 `AnyWood` 固定成员缩小输入范围。 + +`SpecialProcessRecipeTests` 覆盖平台发布的附属流体绑定、不限形态的物品/流体试剂、缺失流体产物整行拒绝、王水完整产物与单一归属、过硫酸盐投料比例,以及竹/橡胶木/处理木粉末的造纸输入。 + ## 验收 - 新内容按[源码分层](../README.md#第一层源码与依赖)检查依赖,跨版本输入按[跨版本指南](../versions.md)处理。 @@ -99,7 +107,7 @@ core 的 content 描述“有什么”,Minecraft 的 content 将其变为游 - 线缆、管道、轴、电池、覆盖板与储罐的实际传输、断开与方向变化。 - 材料物品/方块注册与统一化;矿脉或结构的注册存在性。 - 现有测试集 - - `MaterialBaselineTest` 与共享 `MaterialBaselineTests` 提供材料源表引用审计、独立 JVM 快照、测试材料 SPI、成分与回收/分解及真实重载入口;契约与不变量见[材料系统设计](../../decisions/material-system/README.md)。 + - `MaterialRegistrationTest` 与 `MaterialCatalogTest` 提供材料目录与附属合并回归;契约与不变量见[材料系统设计](../../decisions/material-system/README.md)。 - core 静态 TSV 与 GameTest TSV 由对应 JUnit/GameTest 维护;用例覆盖物品管道路由与调度回归。 - `core/src/test` 的材料目录、标签名翻译、熔融浇筑与配方引擎测试;`api/common` 的材料、机器、能源模型测试。 - 机器 tick、多方块、能源网络、物流、世界生成完整流程等仍是待补范围。 diff --git a/docs/architecture/packages/engine.md b/docs/architecture/packages/engine.md index f03f79296..fe935ff15 100644 --- a/docs/architecture/packages/engine.md +++ b/docs/architecture/packages/engine.md @@ -11,7 +11,7 @@ | `engine` | 执行层总体说明 | `package-info.java`;不继续使用旧 internal 命名扩张实现 | | `engine.addon` | 附属声明收集、校验、物化与共享服务绑定 | `AddonCoreServices`、`AddonMaterials`、`AddonMachines`、`AddonPipes` | | `engine.definition` | 定义目录的组织与查询机制 | `DefinitionCatalog`;内容行放 content | -| `engine.material` | 材料原子安装(`MaterialRegistryState`)、引用与组校验(`MaterialLinker`)、附属事实冻结、物品成分与回收纯裁决、多代发布版本号(`MaterialPublication`)及不可变视图 | `GTMaterialRegistry`、`MaterialRegistryState`、`MaterialLinker`、`MaterialInfoRegistry`、`ItemCompositionResolver`、`ItemRecoveryPlanner`、`MaterialPublication`、`MaterialViews` | +| `engine.material` | 材料原子安装(`MaterialRegistryState`)、引用与组校验(`MaterialLinker`)、附属事实冻结、物品成分与回收纯裁决、多代发布版本号(`MaterialPublication`)、不可变视图 | `GTMaterialRegistry`、`MaterialRegistryState`、`MaterialLinker`、`MaterialInfoRegistry`、`ItemCompositionResolver`、`ItemRecoveryPlanner`、`MaterialPublication`、`MaterialViews` | | `engine.prefix` | 材料形态/前缀的注册与解析 | `PrefixRegistry`、`BlockPrefixRegistry` | | `engine.recipe` | 配方成本、并行与输出空间拟合、燃料批次、精确单位换算与材料分解纯计划、可合成性和界面坐标等共享机制 | `MachineWorkCost`、`ParallelFit`、`FluidFuelChargeMath`、`UnitConversion`、`MaterialDecompositionPlanner`;不能夹带游戏栈 | | `engine.recipe.data` | 配方文档模型、组件、解析及校验 | `MachineRecipeDocuments`、`ItemComponent`、`FluidComponent` | diff --git a/docs/decisions/material-system/README.md b/docs/decisions/material-system/README.md index 6dd3f9a3d..4cea3d664 100644 --- a/docs/decisions/material-system/README.md +++ b/docs/decisions/material-system/README.md @@ -40,7 +40,7 @@ 原生资源 Tag 导入 / 数据包变更 │ beginTagGeneration() → 构建新代 Tag 候选 → ItemCompositionResolver ▼ 刷新 MaterialFormContent 绑定 → 回收/分解 RecipeMap overlay 重建 - 成功:提交 MaterialPublication.platformGenerationPublished(compRev, recipeRev) + 成功:candidatePlatformGeneration(compRev, recipeRev) → 快照构建成功后 commit(candidate) 失败:按检查点回滚成分快照与机器配方,保持上一完整 Stamp 不变 ``` @@ -51,4 +51,4 @@ 3. [物品成分解析与运行时准入](item-composition.md):结构化来源优先级、同级冲突与显式替换链、显式层封闭与 Tag 代次原子重载、耐久缩放及容器/模具形状区分。 4. [统一回收计划与配方发布仲裁](recovery.md):基于有效成分的纯粉碎/热回收计划、大份量拆栈与精度表达、生产端输入证明、所有权与冲突发布仲裁。 5. [统一材料分解规则与计划](decomposition.md):`MaterialDecompositionRule` 唯一权威、规范组成与精确单位计算、液/气替代相态与固体兜底、原生适配器与重载隔离。 -6. [公共数据 API 与多代发布契约](data-api-and-publication.md):已实现的只读视图(目录、元数据、分类/组、形态规则与实际绑定)、`MaterialPublication.Stamp` 一致性保证,以及明确标为`提议`的多快照来源图规划。 +6. [公共数据 API 与多代发布契约](data-api-and-publication.md):已实现的只读视图(目录、元数据、分类/组、形态规则与实际绑定)、`MaterialPublication.Stamp` 一致性保证。 diff --git a/docs/decisions/material-system/data-api-and-publication.md b/docs/decisions/material-system/data-api-and-publication.md index d5e222a56..c2ef3cab6 100644 --- a/docs/decisions/material-system/data-api-and-publication.md +++ b/docs/decisions/material-system/data-api-and-publication.md @@ -7,7 +7,7 @@ - **稳定键与模型隔离**:公共查询全部基于不可变键(`MaterialKey`、`DataKey`、`FormKey`、`MaterialGroupKey`)和只读视图接口,不把内部可变模型 `GTMaterial`、游戏物品栈 `ItemStack` 或 `RecipeMap` 暴露为协议字段。 - **明确失败语义**:对于宿主服务未绑定、材料系统未就绪、旧版本宿主不支持或查询未知键等场景,公开接口须明确抛出异常或区分状态,禁止统统返回空集掩盖故障。 -## 已实现的公共视图(API 1.4–1.8) +## 已实现的公共视图(API 1.4–1.9) 附属接入手册与 Gradle 坐标细节详见[附属 API 文档](../../ADDON_API.zh-CN.md)。已交付能力划分如下: @@ -24,17 +24,5 @@ 由于材料目录定义在进程内一次定稿,而 Tag 成分、形态绑定与机器配方随世界或数据包重载多代替换,`MaterialPublication` 维护原子发布的版本戳 `Stamp(revision, materialRevision, compositionRevision, recipeRevision)`: 1. **进程定义提交**:`GTMaterialRegistry.init()` 到达 `READY` 时调用 `materialDefinitionsPublished(materialRevision)` 唯一一次写定基础材料版本,不允许二次改写。 -2. **平台代次提交**:每次启动装配或热重载在全部 Tag 候选裁决、有效成分构建、`MaterialFormContent` 绑定刷新以及回收/分解配方重建均成功后,才由平台层推进 `platformGenerationPublished(compositionRevision, recipeRevision)`。 +2. **平台代次提交**:每次启动装配或热重载在全部 Tag 候选裁决、有效成分构建、`MaterialFormContent` 绑定刷新以及回收/分解配方重建均成功后,先生成 `candidatePlatformGeneration(compositionRevision, recipeRevision)` 候选,再在服务端运行时配方发布完成(客户端为炉配方桥应用完成)后调用 `commit(candidate)`。 3. **失败回滚不动旧印记**:重载任一环节报错触发回滚时,`MaterialPublication.current()` 维持上一成功 `Stamp` 不变,保证下游观测不到“成分切至新代但配方仍留旧代”的跨代撕裂。 - -## `提议`:来源用途索引与有界处理图(尚未实施) - -> [!NOTE] -> 本节规划尚处于**提议**状态,尚未进入公共 `api` 产物,不构成当前可调用 API 承诺。 - -- **会话化版本快照(`MaterialDataSnapshot` / `SnapshotStamp`)**: - - 配方来源、用途与动态世界生成信息随具体服务端世界和数据包配置变化,拟引入显式接收服务端或会话上下文的快照入口,每次重载生成绑定唯一 `SnapshotStamp` 的自洽索引,避免跨服、断线或热重载后旧引用混用; - - 来源与用途索引从最终 `RecipeMap`、原版炉镜像、已发布的回收/分解结果及真实生效矿脉配置直接投影(而非从化学成分表猜测或对 `Unit` 族做笛卡尔积展开)。 -- **有界材料处理图(`ProcessGraph`)**: - - 拟在核心层基于来源/用途快照支持有限深度、节点与分支预算的前/反向图检索,精确保留合金/分解/回收闭环中的共同输入、概率分支与状态条件,并在到达预算时诚实标注截断; - - 客户端颜色、图标与坐标映射留在接入层,由 JEI 与 EMI 共用同一图语义模型与世界生成事实投影,解除彼此间的内部类耦合,同时确保专用服务端在无客户端可选模组时独立运行。 diff --git a/docs/development/validation/checks/format.md b/docs/development/validation/checks/format.md index f8316220b..5a23ba893 100644 --- a/docs/development/validation/checks/format.md +++ b/docs/development/validation/checks/format.md @@ -16,6 +16,8 @@ Spotless 使用 Palantir Java Format 检查 Java 源码格式:4 空格缩进 `:api` 与 `:api-platform` 当前未接入 Spotless。修改这两层时仍要按现有文件风格书写,但不能把 `spotlessCheck` 通过解读为这两层已格式化;补齐接入属于单独的构建改动。 +存在 `origin/master` 时默认检查相对它的改动,缺失时检查已接入的源码;`-PspotlessRatchet=HEAD` 使用现有构建参数,仅检查当前工作区相对 HEAD 的改动,适合隔离分支上既有的无关格式问题。此范围通过不能代替默认全分支检查,默认检查的失败仍须单独报告。 + Spotless 排除 `**/generated/**` 与包含 Stonecutter `//?` 标记的共享文件;后两者由节点级处理。不要直接对生成副本套用格式任务。 ## 注意事项 diff --git a/docs/development/validation/checks/gametest.md b/docs/development/validation/checks/gametest.md index 95627f2e7..6da7261d3 100644 --- a/docs/development/validation/checks/gametest.md +++ b/docs/development/validation/checks/gametest.md @@ -36,10 +36,12 @@ GameTest 不接入 `check` 或 CI,只在本地通过两个节点的 `runGameTe ### 配方回归案例表 -材料领域的 `MaterialBaselineTests` 验证存储块的成分与两类准入、72U 附魔金苹果的规划和实际回收输出、复合钻头、耐久缩放、容器与有形状铸模、压模机模具、固体/流体分解、形态绑定刷新及 test-source 材料 SPI。`material_baseline_reload` 为仅含一个测试的独立批次,等待两次真实资源重载;拥有规则数和固定样例必须稳定。已知错误行为明确标为观察,不能当作正确性依据;材料成分、回收与分解契约见[材料系统设计](../../../decisions/material-system/README.md)。 +材料领域的运行时回归已不再依赖 `MaterialBaselineTests` 和一次性 TSV 快照。材料成分、回收与分解的纯规则由 JUnit 覆盖;资源重载、JEI/EMI 配方显示与双平台客户端行为仍按[游戏内人工验收](manual-ingame.md)执行。材料契约见[材料系统设计](../../../decisions/material-system/README.md)。 `decompositionRespectsFormsAndExactFluidIdentities` 通过测试 SPI 声明 dust-only、blockDust-only、liquid-only 和 gas-only 分解,检查形态限制、流体输入不会错误抑制允许的固体兜底、本体完整 ID、附属完整 ID/旧裸路径、外部原版流体 ID、未知及非法 ID,以及附属流体输出的身份和数量。 +`SpecialProcessRecipeTests` 检查特殊工艺的已发布流体绑定与不限形态试剂、缺失产物拒绝、王水配方完整发布和唯一归属、过硫酸盐四种投料组合,以及竹/橡胶木/处理木粉的造纸标签。 + 针对性回归用数据表维护,不为每个 issue 新建测试类、namespace 或结构模板。GameTest 表是运行时权威,只保留 R 级运行时行;静态源检查由 core 的 `crafting-issue-static-cases.tsv` 维护。 引擎契约不属于某个配方 issue,例如 `RecipeMap` 的注册、删除与碰撞判定,直接放在 `minecraft/src/test` 的独立测试类里,参考 `RecipeMapRegistrationTests`。 diff --git a/docs/development/validation/checks/junit.md b/docs/development/validation/checks/junit.md index 0d85dc1b0..8fc5d85f1 100644 --- a/docs/development/validation/checks/junit.md +++ b/docs/development/validation/checks/junit.md @@ -54,4 +54,4 @@ issue source kind target expected JUnit XML 在 `/build/test-results/test/TEST-*.xml`,HTML 报告在 `/build/reports/tests/test/`。 -材料基线入口为 `gregtech.content.material.MaterialBaselineTest`。它在三个独立 JVM 中区分无附属重复启动和测试 SPI 附属,原始投影写入调试输出目录;不使用生产 reset。源表引用的逐行历史依据在 `core/src/test/resources/gregtech/material-reference-history.tsv`;悬空引用与 ID/name 矛盾必须为零,不能用快照允许列表认可错误。历史分类必须核对来源,不能自动重录。材料系统设计、周期与权威口径见[材料系统设计](../../../decisions/material-system/README.md)。 +材料纯规则的常驻入口是 `MaterialRegistrationTest`、`ItemCompositionResolverTest`、`MaterialDecompositionPlannerTest` 和 `SpecialProcessLanguageTest`。一次性的基线快照、独立 JVM 生命周期矩阵和测试附属注入已移除;长期行为应落入可直接重复运行、不会向运行时注册测试内容的定向测试。 diff --git a/gradle/incremental-resources.gradle b/gradle/incremental-resources.gradle index 11996bb25..39f56b3b6 100644 --- a/gradle/incremental-resources.gradle +++ b/gradle/incremental-resources.gradle @@ -1,12 +1,8 @@ -import org.gradle.api.file.ConfigurableFileCollection -import org.gradle.api.file.FileTree -import org.gradle.api.file.FileType -import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* -import org.gradle.language.jvm.tasks.ProcessResources import org.gradle.work.ChangeType import org.gradle.work.Incremental import org.gradle.work.InputChanges + import java.nio.file.Files import java.nio.file.Path diff --git a/minecraft/src/main/java/gregtech/client/MachineRecipeClient.java b/minecraft/src/main/java/gregtech/client/MachineRecipeClient.java index 344c4f1c5..efadee4a5 100644 --- a/minecraft/src/main/java/gregtech/client/MachineRecipeClient.java +++ b/minecraft/src/main/java/gregtech/client/MachineRecipeClient.java @@ -52,11 +52,12 @@ public static void tags(TagsUpdatedEvent event) { private static void apply(RecipeManager recipes) { // Integrated server and client share the static maps. The server pass already applied them. if (ServerLifecycleHooks.getCurrentServer() != null) return; - MachineRecipeOverlay.apply(recipes); + if (MachineRecipeOverlay.apply(recipes).failed()) return; // A dedicated client also needs the furnace bridge: the machine-visible oven rows only // exist after it runs, and the synced recipe list alone does not recreate them locally. var connection = Minecraft.getInstance().getConnection(); if (connection != null) OvenRecipeBridge.apply(recipes, connection.registryAccess()); + gregtech.engine.material.MaterialPublication.commit(MachineRecipeOverlay.lastPublication()); // The row set is final now; build on the task queue so the sync thread is not blocked. // A newer tag update supersedes this pass and its queued build. long generation = MachineRecipeOverlay.generation(); diff --git a/minecraft/src/main/java/gregtech/client/MaterialTooltips.java b/minecraft/src/main/java/gregtech/client/MaterialTooltips.java index 09de41786..1e15d14f9 100644 --- a/minecraft/src/main/java/gregtech/client/MaterialTooltips.java +++ b/minecraft/src/main/java/gregtech/client/MaterialTooltips.java @@ -199,10 +199,7 @@ public static void appendForeign(ItemStack stack, gregtech.engine.material.ItemC return; } GTMaterial mat = data.material(); - if (mat.getId() <= 0) { - if (flag.isAdvanced()) tooltip.add(Component.translatable("tooltip.gt6ce.composition_nonmaterial").withStyle(ChatFormatting.GRAY)); - return; - } + if (mat.getId() <= 0) return; String chemical = data.components().size() == 1 ? mat.getResolvedTooltipChemical() : ""; if (gregtech.GregTechConfig.chemicalFormulas() && chemical != null && !chemical.isEmpty()) { @@ -213,8 +210,6 @@ public static void appendForeign(ItemStack stack, gregtech.engine.material.ItemC appendFuelTooltip(mat, data.prefix(), data.amount(), tooltip); appendFlammableTooltip(mat, tooltip); } - if (!data.bulkRecoveryAllowed()) tooltip.add(Component.translatable("tooltip.gt6ce.composition_descriptive").withStyle(ChatFormatting.GRAY)); - if (gregtech.GregTechConfig.materialDetails() && flag.isAdvanced()) { tooltip.add(Component.translatable("tooltip." + GregTechIdentity.REGISTRY_NAMESPACE + ".contained_materials") diff --git a/minecraft/src/main/java/gregtech/client/MultiblockPreviewPanel.java b/minecraft/src/main/java/gregtech/client/MultiblockPreviewPanel.java index 84e7cd656..aebd2545e 100644 --- a/minecraft/src/main/java/gregtech/client/MultiblockPreviewPanel.java +++ b/minecraft/src/main/java/gregtech/client/MultiblockPreviewPanel.java @@ -1,5 +1,6 @@ package gregtech.client; +import gregtech.compat.common.RecipeMachines; import gregtech.compat.jei.*; import gregtech.util.PreviewCamera; import java.util.*; diff --git a/minecraft/src/main/java/gregtech/compat/jei/PreviewViewport.java b/minecraft/src/main/java/gregtech/compat/common/PreviewViewport.java similarity index 97% rename from minecraft/src/main/java/gregtech/compat/jei/PreviewViewport.java rename to minecraft/src/main/java/gregtech/compat/common/PreviewViewport.java index 623412c58..a15f47f7a 100644 --- a/minecraft/src/main/java/gregtech/compat/jei/PreviewViewport.java +++ b/minecraft/src/main/java/gregtech/compat/common/PreviewViewport.java @@ -1,4 +1,4 @@ -package gregtech.compat.jei; +package gregtech.compat.common; import org.joml.Matrix4fc; import org.joml.Vector3f; diff --git a/minecraft/src/main/java/gregtech/compat/jei/RecipeMachines.java b/minecraft/src/main/java/gregtech/compat/common/RecipeMachines.java similarity index 99% rename from minecraft/src/main/java/gregtech/compat/jei/RecipeMachines.java rename to minecraft/src/main/java/gregtech/compat/common/RecipeMachines.java index a024f92e1..e86fa9011 100644 --- a/minecraft/src/main/java/gregtech/compat/jei/RecipeMachines.java +++ b/minecraft/src/main/java/gregtech/compat/common/RecipeMachines.java @@ -1,4 +1,4 @@ -package gregtech.compat.jei; +package gregtech.compat.common; import gregtech.content.data.MachineRecipeMaps; import gregtech.content.registry.BehaviorMachineRegistration; diff --git a/minecraft/src/main/java/gregtech/compat/common/RecipeViewerIcons.java b/minecraft/src/main/java/gregtech/compat/common/RecipeViewerIcons.java index 535fca442..060a13ac0 100644 --- a/minecraft/src/main/java/gregtech/compat/common/RecipeViewerIcons.java +++ b/minecraft/src/main/java/gregtech/compat/common/RecipeViewerIcons.java @@ -36,6 +36,16 @@ public static ItemStack bedrockOre() { return stack; } + /** Resolves the preferred category icon, falling back to a workstation. */ + public static ItemStack category(RecipeMap map, java.util.Map> machines) { + ItemStack preferred = map(map); + if (!preferred.isEmpty()) return preferred; + var workstations = machines.getOrDefault(map, java.util.List.of()); + return workstations.isEmpty() + ? new ItemStack(net.minecraft.world.item.Items.ANVIL) + : workstations.get(0).copy(); + } + public static ItemStack map(RecipeMap map) { if (map == MachineRecipeMaps.ByProductList) return GTItems.getStack(MaterialPrefix.dust, GTMaterialRegistry.get("Platinum")); diff --git a/minecraft/src/main/java/gregtech/compat/jei/WorldgenInfoData.java b/minecraft/src/main/java/gregtech/compat/common/WorldgenInfoData.java similarity index 97% rename from minecraft/src/main/java/gregtech/compat/jei/WorldgenInfoData.java rename to minecraft/src/main/java/gregtech/compat/common/WorldgenInfoData.java index 92dfe578d..f6978ad34 100644 --- a/minecraft/src/main/java/gregtech/compat/jei/WorldgenInfoData.java +++ b/minecraft/src/main/java/gregtech/compat/common/WorldgenInfoData.java @@ -1,4 +1,4 @@ -package gregtech.compat.jei; +package gregtech.compat.common; import gregtech.api.addon.worldgen.OreVeinDeclaration; import gregtech.api.addon.worldgen.SmallOreDeclaration; @@ -16,7 +16,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -/** Actual world generation catalogs, independent of optional recipe browsers. */ +/** Icon-bearing worldgen data shared by the recipe viewers. */ public class WorldgenInfoData { protected WorldgenInfoData() {} @@ -69,6 +69,7 @@ public static ItemStack smallOreStack(GTMaterial material) { } public static List buildVeins() { + if (!gregtech.GregTechConfig.Worldgen.GEOLOGY.enabled()) return List.of(); List out = new ArrayList<>(); var overworld = GTOreVeins.activeOverworldVeins(); int overworldWeight = @@ -380,6 +381,7 @@ public static List stratumCaptions(VeinInfo vein) { } public static List buildSmallOres() { + if (!gregtech.GregTechConfig.Worldgen.GEOLOGY.enabled()) return List.of(); List out = new ArrayList<>(); for (GTOreVeins.SmallOre o : GTOreVeins.activeOverworldSmallOres()) { out.add(new SmallOreInfo( @@ -405,6 +407,7 @@ public static List buildSmallOres() { } public static List buildLayers() { + if (!gregtech.GregTechConfig.Worldgen.GEOLOGY.enabled()) return List.of(); List out = new ArrayList<>(); java.util.Set seen = new java.util.HashSet<>(); for (GTStoneLayersGen.LayerDef def : GTStoneLayersGen.LAYERS) { @@ -442,6 +445,7 @@ public static List buildLayers() { public record BedrockInfo(String name, GTMaterial material, int chance, ItemStack flower) {} public static List buildBedrockOres() { + if (!gregtech.GregTechConfig.Worldgen.BEDROCK_ORES.enabled()) return List.of(); List out = new ArrayList<>(); for (gregtech.content.worldgen.GTBedrockOres.BedrockOre ore : gregtech.content.worldgen.GTBedrockOres.OVERWORLD) { diff --git a/minecraft/src/main/java/gregtech/compat/emi/EmiInteractiveWidget.java b/minecraft/src/main/java/gregtech/compat/emi/EmiInteractiveWidget.java index 40d8f44a4..3f6dadc8a 100644 --- a/minecraft/src/main/java/gregtech/compat/emi/EmiInteractiveWidget.java +++ b/minecraft/src/main/java/gregtech/compat/emi/EmiInteractiveWidget.java @@ -4,6 +4,10 @@ /** Optional input surface; native screen events supply drag/scroll absent from EMI's Widget API. */ public abstract class EmiInteractiveWidget extends Widget { + public dev.emi.emi.api.stack.EmiIngredient ingredientAt(double x, double y) { + return dev.emi.emi.api.stack.EmiStack.EMPTY; + } + public boolean pressed(double x, double y, int button) { return false; } diff --git a/minecraft/src/main/java/gregtech/compat/emi/EmiWidgetInput.java b/minecraft/src/main/java/gregtech/compat/emi/EmiWidgetInput.java index 9ea780f85..bca5abed2 100644 --- a/minecraft/src/main/java/gregtech/compat/emi/EmiWidgetInput.java +++ b/minecraft/src/main/java/gregtech/compat/emi/EmiWidgetInput.java @@ -1,6 +1,6 @@ package gregtech.compat.emi; -import gregtech.compat.jei.PreviewViewport; +import gregtech.compat.common.PreviewViewport; import java.util.*; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.Screen; @@ -59,6 +59,18 @@ public static void rendered(EmiInteractiveWidget widget, GuiGraphics graphics) { new org.joml.Matrix4f(graphics.pose().last().pose()).invert())); } + public static dev.emi.emi.api.stack.EmiStackInteraction stackAt(Screen screen, double x, double y) { + if (screen != frameScreen) return dev.emi.emi.api.stack.EmiStackInteraction.EMPTY; + for (int index = surfaces.size() - 1; index >= 0; index--) { + var surface = surfaces.get(index); + if (!surface.contains(x, y)) continue; + var local = surface.local(x, y); + var ingredient = surface.widget().ingredientAt(local.x(), local.y()); + if (!ingredient.isEmpty()) return new dev.emi.emi.api.stack.EmiStackInteraction(ingredient); + } + return dev.emi.emi.api.stack.EmiStackInteraction.EMPTY; + } + public static boolean pressed(Screen screen, double x, double y, int button) { clearCapture(); if (screen != frameScreen) return false; diff --git a/minecraft/src/main/java/gregtech/compat/emi/GregTechEMIPlugin.java b/minecraft/src/main/java/gregtech/compat/emi/GregTechEMIPlugin.java index 63385ac1f..ef74690ad 100644 --- a/minecraft/src/main/java/gregtech/compat/emi/GregTechEMIPlugin.java +++ b/minecraft/src/main/java/gregtech/compat/emi/GregTechEMIPlugin.java @@ -6,14 +6,13 @@ import dev.emi.emi.api.recipe.EmiRecipe; import dev.emi.emi.api.recipe.EmiRecipeCategory; import dev.emi.emi.api.stack.EmiStack; -import gregtech.compat.jei.RecipeMachines; +import gregtech.compat.common.RecipeMachines; import gregtech.content.item.GTToolItem; import gregtech.engine.recipe.RecipeMap; import java.util.Locale; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; /** Native EMI integration: machine maps are independent of the vanilla RecipeManager and JEI. */ @EmiEntrypoint @@ -57,6 +56,7 @@ public void register(EmiRegistry registry) { }); gregtech.engine.fluid.FluidContainerDisplayBinding.invalidate(); FluidScreenStackProvider.register(registry); + registry.addGenericStackProvider(EmiWidgetInput::stackAt); WoodenBucketLookupRecipe.register(registry); FormConversionEmiRecipe.register(registry); registry.addRecipeHandler( @@ -96,9 +96,7 @@ public void register(EmiRegistry registry) { || map.mRecipeList.stream().noneMatch(r -> r.mEnabled && !r.mHidden) && !map.hasDynamicEnumeration()) continue; var workstations = machines.getOrDefault(map, java.util.List.of()); - ItemStack icon = workstations.isEmpty() ? new ItemStack(Items.ANVIL) : workstations.get(0); - var preferred = gregtech.compat.common.RecipeViewerIcons.map(map); - if (!preferred.isEmpty()) icon = preferred; + ItemStack icon = gregtech.compat.common.RecipeViewerIcons.category(map, machines); var id = ResourceLocation.fromNamespaceAndPath("gt6ce", map.mNameInternal.toLowerCase(Locale.ROOT)); var category = new EmiRecipeCategory(id, EmiStack.of(icon)) { @Override diff --git a/minecraft/src/main/java/gregtech/compat/emi/StructureEmiRecipe.java b/minecraft/src/main/java/gregtech/compat/emi/StructureEmiRecipe.java index 34b298ed8..27817d224 100644 --- a/minecraft/src/main/java/gregtech/compat/emi/StructureEmiRecipe.java +++ b/minecraft/src/main/java/gregtech/compat/emi/StructureEmiRecipe.java @@ -4,6 +4,7 @@ import dev.emi.emi.api.recipe.*; import dev.emi.emi.api.stack.*; import dev.emi.emi.api.widget.*; +import gregtech.compat.common.PreviewViewport; import gregtech.compat.jei.*; import java.util.*; import net.minecraft.core.registries.BuiltInRegistries; diff --git a/minecraft/src/main/java/gregtech/compat/emi/WorldgenEmiRecipe.java b/minecraft/src/main/java/gregtech/compat/emi/WorldgenEmiRecipe.java index ccd7146cf..c76f44ed9 100644 --- a/minecraft/src/main/java/gregtech/compat/emi/WorldgenEmiRecipe.java +++ b/minecraft/src/main/java/gregtech/compat/emi/WorldgenEmiRecipe.java @@ -4,7 +4,7 @@ import dev.emi.emi.api.recipe.*; import dev.emi.emi.api.stack.*; import dev.emi.emi.api.widget.WidgetHolder; -import gregtech.compat.jei.WorldgenInfoData; +import gregtech.compat.common.WorldgenInfoData; import gregtech.content.worldgen.GTWorldgenScale; import java.util.*; import net.minecraft.client.Minecraft; diff --git a/minecraft/src/main/java/gregtech/compat/jei/GregTechJEIPlugin.java b/minecraft/src/main/java/gregtech/compat/jei/GregTechJEIPlugin.java index c31e5f2bf..f5c92eb7b 100644 --- a/minecraft/src/main/java/gregtech/compat/jei/GregTechJEIPlugin.java +++ b/minecraft/src/main/java/gregtech/compat/jei/GregTechJEIPlugin.java @@ -1,5 +1,6 @@ package gregtech.compat.jei; +import gregtech.compat.common.RecipeMachines; import gregtech.engine.recipe.Recipe; import gregtech.engine.recipe.RecipeMap; import gregtech.platform.Mc; @@ -220,4 +221,5 @@ private ItemStack iconFor(RecipeMap map) { } return new ItemStack(Items.ANVIL); } + } diff --git a/minecraft/src/main/java/gregtech/compat/jei/MultiblockInfoCategory.java b/minecraft/src/main/java/gregtech/compat/jei/MultiblockInfoCategory.java index f37bafe4f..785b0575c 100644 --- a/minecraft/src/main/java/gregtech/compat/jei/MultiblockInfoCategory.java +++ b/minecraft/src/main/java/gregtech/compat/jei/MultiblockInfoCategory.java @@ -1,5 +1,6 @@ package gregtech.compat.jei; +import gregtech.compat.common.PreviewViewport; import gregtech.engine.multiblock.*; import java.util.*; import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; diff --git a/minecraft/src/main/java/gregtech/compat/jei/StructurePreview.java b/minecraft/src/main/java/gregtech/compat/jei/StructurePreview.java index c95b9190a..7e172f3aa 100644 --- a/minecraft/src/main/java/gregtech/compat/jei/StructurePreview.java +++ b/minecraft/src/main/java/gregtech/compat/jei/StructurePreview.java @@ -3,6 +3,7 @@ import com.mojang.blaze3d.platform.Lighting; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.math.Axis; +import gregtech.compat.common.PreviewViewport; import gregtech.util.PreviewCamera; import java.util.Map; import net.minecraft.client.Minecraft; diff --git a/minecraft/src/main/java/gregtech/compat/jei/WorldgenInfoCategories.java b/minecraft/src/main/java/gregtech/compat/jei/WorldgenInfoCategories.java index 9c41ec719..97952f908 100644 --- a/minecraft/src/main/java/gregtech/compat/jei/WorldgenInfoCategories.java +++ b/minecraft/src/main/java/gregtech/compat/jei/WorldgenInfoCategories.java @@ -1,4 +1,6 @@ package gregtech.compat.jei; + +import gregtech.compat.common.WorldgenInfoData; import gregtech.engine.mod.GregTechIdentity; diff --git a/minecraft/src/main/java/gregtech/content/data/MaterialTagPack.java b/minecraft/src/main/java/gregtech/content/data/MaterialTagPack.java index d0986d7e3..91a75fbc2 100644 --- a/minecraft/src/main/java/gregtech/content/data/MaterialTagPack.java +++ b/minecraft/src/main/java/gregtech/content/data/MaterialTagPack.java @@ -4,6 +4,7 @@ import gregtech.engine.material.MaterialEquivalence; import gregtech.engine.material.VanillaUnificationDefinitions; import gregtech.content.block.MaterialBlockLike; +import gregtech.content.registry.GTFluids; import gregtech.platform.Mc; //? if >=1.21.1 { /*import gregtech.platform.neoforge.fluid.FluidDisplayItem;import net.minecraft.network.chat.Component; @@ -365,6 +366,16 @@ private synchronized Map data() { tag.addAll(values); tag.addAll(blocksByMaterial.getOrDefault(name,Set.of())); }); + for (var fluid : GTFluids.entries().entrySet()) { + String bound = fluid.getValue().materialKey(); + if (bound == null) bound = RegisteredFluids.boundMaterial(fluid.getValue().registryName()); + if (bound == null) continue; + var material = gregtech.engine.material.GTMaterialRegistry.get(bound); + if (material == null || !material.isValid()) continue; + add(tags, "gt6ce", "fluids", "fluid/" + MaterialEquivalence.materialName(material.resolve()), + fluid.getKey().toString()); + } + addSpecialProcessTags(tags); // Wood form tags for the wooden-pipe recipes (GT6's OD.plankAnyWood / OD.beamWood): vanilla // planks and slabs join through nested tag references, the port's own species are listed. // The beam identity is the modern stripped log, so vanilla stripped logs join it as well. @@ -517,6 +528,42 @@ private static void addMaterial(Map> target,gregtech.api.mate if(material==null||!material.isValid())return; target.computeIfAbsent(MaterialEquivalence.materialName(material),k->new TreeSet<>()).add(value); } + + private static void addSpecialProcessTags(Map> tags) { + var catalog = gregtech.engine.material.MaterialViews.catalog(); + for (var method : catalog.specialProcesses().methods()) { + for (var material : catalog.materials()) { + for (var rule : catalog.processes().find(material.key(), method.process())) { + String tagPath = rule.value() instanceof gregtech.api.addon.material.SpecialProcessValue.Target + ? method.targetTag().path() + : rule.value() instanceof gregtech.api.addon.material.SpecialProcessValue.Reagent + ? method.reagentTag().path() + : null; + if (tagPath == null) continue; + String materialName = gregtech.engine.material.MaterialEquivalence.materialName( + gregtech.engine.material.GTMaterialRegistry.get(material.key().name()).resolve()); + if (rule.forms().isEmpty()) { + add(tags, method.process().id().namespace(), "items", tagPath, + "#gt6ce:material/" + materialName); + add(tags, method.process().id().namespace(), "fluids", tagPath, + "#gt6ce:fluid/" + materialName); + continue; + } + for (var form : rule.forms()) { + if (Set.of("liquid", "gas", "molten").contains(form.name())) { + add(tags, method.process().id().namespace(), "fluids", tagPath, + "#gt6ce:fluid/" + materialName); + } else { + var prefix = gregtech.engine.prefix.PrefixRegistry.byName(form.name()); + if (prefix != null) + add(tags, method.process().id().namespace(), "items", tagPath, + "#gt6ce:" + prefix.getRegistryName() + "/" + materialName); + } + } + } + } + } + } private static void add(Map> tags,String ns,String kind,String path,String value) { //? if >=1.21.1 { /*// 1.21 registries use singular resource directories. Historical callers still diff --git a/minecraft/src/main/java/gregtech/content/material/MaterialItemCompositions.java b/minecraft/src/main/java/gregtech/content/material/MaterialItemCompositions.java index f7642c9f3..573ff56b2 100644 --- a/minecraft/src/main/java/gregtech/content/material/MaterialItemCompositions.java +++ b/minecraft/src/main/java/gregtech/content/material/MaterialItemCompositions.java @@ -1,8 +1,12 @@ package gregtech.content.material; +import gregtech.api.material.GTValues; import gregtech.api.material.MaterialComponent; import gregtech.content.block.BlockMaterialWeights; +import gregtech.content.block.DenseOreBlock; import gregtech.content.block.MaterialBlockLike; +import gregtech.content.block.OreBlock; +import gregtech.content.block.VanillaOreBlock; import gregtech.content.block.machine.BasicMachineBlock; import gregtech.content.block.stone.GTStoneBlock; import gregtech.content.block.stone.GTStoneSlabBlock; @@ -12,12 +16,16 @@ import gregtech.content.machine.OriginalMachineMaterialData; import gregtech.content.registry.GTBlocks; import gregtech.content.registry.GTItems; +import gregtech.engine.fluid.PortableFluidContainerSpec; import gregtech.engine.material.ItemComposition; import gregtech.engine.material.ItemCompositionSource; import gregtech.engine.material.ItemMaterialRegistry; import gregtech.engine.material.ItemMaterialRuntimeFacts; import java.util.List; import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; /** Pure item and block composition submissions shared by both loader entry points. */ @@ -27,16 +35,18 @@ private MaterialItemCompositions() {} public static void registerCommon() { ItemMaterialRuntimeFacts.install(ItemMaterialContentFacts.INSTANCE); registerMaterialItemForms(); + registerOwnedOreCompositions(); registerBlockWeights(); registerMachineConstruction(); - gregtech.content.recipe.DiggableRecipes.registerMaterials(); - gregtech.content.recipe.RegisteredWoodSurvivalRecipes.registerMaterials(); - gregtech.content.recipe.VanillaWoodProcessingRecipes.registerMaterials(); + registerSingleItemMaterials(); + registerCapsuleCells(); + registerDiggableMaterials(); + WoodMaterialCompositions.register(); gregtech.content.registry.GTBars.registerCompositions(); gregtech.content.registry.GTWires.registerCompositions(); gregtech.content.registry.GTSignalWires.registerCompositions(); - gregtech.content.recipe.PanelMaterialRegistration.register(); - gregtech.content.recipe.TransportMaterialRegistration.register(); + PanelMaterialCompositions.register(); + TransportMaterialCompositions.register(); } public static void registerVanillaBindings() { @@ -99,6 +109,36 @@ private static void registerBlockWeights() { } } + private static void registerOwnedOreCompositions() { + for (var holder : GTBlocks.allEntries()) { + if (holder.isPresent()) registerOreBlockComposition(holder.get()); + } + } + + /** + * Gives an actual ore block the same material-form identity independent of which loader-specific + * registry owns it. + */ + public static boolean registerOreBlockComposition(Block block) { + MaterialPrefix prefix; + gregtech.api.material.GTMaterial material; + if (block instanceof DenseOreBlock ore) { + prefix = MaterialPrefix.oreDense; + material = ore.material(); + } else if (block instanceof VanillaOreBlock ore) { + prefix = MaterialPrefix.oreVanillastone; + material = ore.material(); + } else if (block instanceof OreBlock ore && !ore.isSmall()) { + prefix = MaterialPrefix.oreVanillastone; + material = ore.material(); + } else { + return false; + } + if (material == null || !material.isValid()) return false; + ItemMaterialRegistry.register(block.asItem(), prefix, material); + return true; + } + private static void registerMachineConstruction() { for (Block block : BuiltInRegistries.BLOCK) { var id = BuiltInRegistries.BLOCK.getKey(block); @@ -113,4 +153,68 @@ private static void registerMachineConstruction() { .ifPresent(data -> ItemMaterialRegistry.registerDeclared(block.asItem(), data)); } } + + private static void registerDiggableMaterials() { + for (var row : gregtech.content.recipe.DiggableRecipes.packable()) { + if (row.material() == null) continue; + ItemMaterialRegistry.register(item("gt6ce:" + row.block()), null, row.material(), GTValues.U * 4); + ItemMaterialRegistry.register(item("gt6ce:" + row.ball()), null, row.material(), GTValues.U); + } + ItemMaterialRegistry.register( + item("gt6ce:turf"), null, gregtech.content.material.Materials.Peat, GTValues.U * 4); + } + + private static void registerSingleItemMaterials() { + ItemMaterialRegistry.register( + item("gt6ce:dry_bark"), null, gregtech.engine.material.GTMaterialRegistry.get("Bark"), GTValues.U / 2); + for (var row : gregtech.content.recipe.OriginalSingleItemCatalog.COMPOUNDS) { + ItemMaterialRegistry.register( + item("gt6ce:" + row.item()), + null, + gregtech.engine.material.GTMaterialRegistry.get(row.material()), + GTValues.U / 9); + } + ItemMaterialRegistry.register( + item("gt6ce:scrap_meat"), + null, + gregtech.engine.material.GTMaterialRegistry.get("MeatRaw"), + 2 * GTValues.U); + ItemMaterialRegistry.register( + item("gt6ce:raw_meat_bar"), + MaterialPrefix.ingot, + gregtech.engine.material.GTMaterialRegistry.get("MeatRaw"), + GTValues.U); + ItemMaterialRegistry.register( + item("gt6ce:cooked_meat_bar"), + MaterialPrefix.ingot, + gregtech.engine.material.GTMaterialRegistry.get("MeatCooked"), + GTValues.U); + } + + private static void registerCapsuleCells() { + for (var spec : PortableFluidContainerSpec.values()) { + if (!spec.shapeId().equals("cell")) continue; + var item = item("gt6ce:fluid_" + spec.id()); + if (ItemMaterialRegistry.base(item).isPresent()) continue; + ItemMaterialRegistry.registerDeclared( + item, + new ItemComposition( + null, + List.of(MaterialComponent.of(spec.material(), GTValues.U9)), + spec.material(), + List.of(new ItemCompositionSource( + ItemCompositionSource.Kind.EXPLICIT, + "gt6ce:capsule-cell/" + spec.id(), + "capsule-cell material", + spec.id(), + "")), + true)); + } + } + + private static Item item(String id) { + Item item = BuiltInRegistries.ITEM.get(ResourceLocation.parse(id)); + if (item == Items.AIR) throw new IllegalStateException("Missing material item " + id); + return item; + } } diff --git a/minecraft/src/main/java/gregtech/content/recipe/PanelMaterialRegistration.java b/minecraft/src/main/java/gregtech/content/material/PanelMaterialCompositions.java similarity index 95% rename from minecraft/src/main/java/gregtech/content/recipe/PanelMaterialRegistration.java rename to minecraft/src/main/java/gregtech/content/material/PanelMaterialCompositions.java index 4da7706a6..a75b6d104 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/PanelMaterialRegistration.java +++ b/minecraft/src/main/java/gregtech/content/material/PanelMaterialCompositions.java @@ -1,10 +1,12 @@ /* GregTech-6 Team / Gregorius Techneticies; LGPL-3.0-or-later. * Source constructors and CR.REV bookkeeping: panel-material-source-20261006.json. */ -package gregtech.content.recipe; +package gregtech.content.material; import gregtech.api.material.*; import gregtech.content.data.MaterialPrefix; import gregtech.content.transport.*; +import gregtech.content.transport.PanelCatalog; +import gregtech.content.transport.PanelMaterialRules; import gregtech.engine.material.*; import java.util.*; import net.minecraft.core.registries.BuiltInRegistries; @@ -12,8 +14,8 @@ import net.minecraft.world.item.*; /** Register original panel material fallbacks before recovery recipe creation. */ -public final class PanelMaterialRegistration { - private PanelMaterialRegistration() {} +public final class PanelMaterialCompositions { + private PanelMaterialCompositions() {} private static final Set RECOVERY_ITEMS = Collections.newSetFromMap(new IdentityHashMap<>()); diff --git a/minecraft/src/main/java/gregtech/content/recipe/TransportMaterialRegistration.java b/minecraft/src/main/java/gregtech/content/material/TransportMaterialCompositions.java similarity index 93% rename from minecraft/src/main/java/gregtech/content/recipe/TransportMaterialRegistration.java rename to minecraft/src/main/java/gregtech/content/material/TransportMaterialCompositions.java index 47fe18fc2..977e434af 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/TransportMaterialRegistration.java +++ b/minecraft/src/main/java/gregtech/content/material/TransportMaterialCompositions.java @@ -1,7 +1,8 @@ -package gregtech.content.recipe; +package gregtech.content.material; import gregtech.api.material.*; import gregtech.content.transport.*; +import gregtech.content.transport.TransportMaterialRules; import gregtech.content.transport.fluid.FluidTransportDefinitions; import gregtech.engine.machine.ItemPipeSpec; import gregtech.engine.material.*; @@ -11,8 +12,8 @@ import net.minecraft.world.item.*; /** Bind the actual native block items before material recovery recipes are created. */ -public final class TransportMaterialRegistration { - private TransportMaterialRegistration() {} +public final class TransportMaterialCompositions { + private TransportMaterialCompositions() {} private static final Set RECOVERY_ITEMS = Collections.newSetFromMap(new IdentityHashMap<>()); diff --git a/minecraft/src/main/java/gregtech/content/material/WoodMaterialCompositions.java b/minecraft/src/main/java/gregtech/content/material/WoodMaterialCompositions.java new file mode 100644 index 000000000..8bb9ac6bb --- /dev/null +++ b/minecraft/src/main/java/gregtech/content/material/WoodMaterialCompositions.java @@ -0,0 +1,134 @@ +package gregtech.content.material; + +import gregtech.api.material.GTValues; +import gregtech.api.material.MaterialComponent; +import gregtech.content.block.wood.WoodSpecies; +import gregtech.content.data.MaterialPrefix; +import gregtech.content.plant.WoodSlabCatalog; +import gregtech.content.recipe.NaturalWoodCraftingRows; +import gregtech.content.registry.GTWoods; +import gregtech.engine.material.GTMaterialRegistry; +import gregtech.engine.material.ItemComposition; +import gregtech.engine.material.ItemCompositionSource; +import gregtech.engine.material.ItemMaterialRegistry; +import java.util.List; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; + +/** Fixed GT wood item compositions, installed before recipe families run. */ +public final class WoodMaterialCompositions { + private WoodMaterialCompositions() {} + + public static void register() { + registerNativeWoods(); + registerNaturalWoods(); + registerVanillaWoods(); + } + + private static void registerNativeWoods() { + for (String wood : WoodSlabCatalog.WOODS) { + var material = GTMaterialRegistry.get(WoodSlabCatalog.material(wood)); + ItemMaterialRegistry.register(item("gt6ce:planks_" + wood), MaterialPrefix.plate, material, GTValues.U); + ItemMaterialRegistry.register(item("gt6ce:slab_" + wood), null, material, GTValues.U / 2); + } + for (var species : WoodSpecies.values()) { + var material = GTMaterialRegistry.get(WoodSlabCatalog.material(species.id())); + var bark = GTMaterialRegistry.get(species == WoodSpecies.CINNAMON ? "Cinnamon" : "Bark"); + ItemMaterialRegistry.register( + GTWoods.log(species).asItem(), + new ItemComposition( + null, + List.of( + MaterialComponent.of(material, 8 * GTValues.U), + MaterialComponent.of(bark, GTValues.U)), + material, + List.of(new ItemCompositionSource( + ItemCompositionSource.Kind.EXPLICIT, + "gt6ce:wood-log/" + species.id(), + "GT6 WoodEntry", + species.id(), + "")), + true), + ItemCompositionSource.Kind.EXPLICIT, + "gt6ce:wood-log/" + species.id(), + "GT6 WoodEntry"); + ItemMaterialRegistry.register(GTWoods.strippedLog(species).asItem(), null, material, 8 * GTValues.U); + } + } + + private static void registerNaturalWoods() { + for (var wood : NaturalWoodCraftingRows.SPECIES) { + var material = GTMaterialRegistry.get(wood.material()); + var bark = GTMaterialRegistry.get(wood.barkMaterial()); + var components = + List.of(MaterialComponent.of(material, 5 * GTValues.U), MaterialComponent.of(bark, GTValues.U)); + ItemMaterialRegistry.register( + item("gt6ce:log_" + wood.kind()), + new ItemComposition( + null, + components, + material, + List.of(new ItemCompositionSource( + ItemCompositionSource.Kind.EXPLICIT, + "gt6ce:wood-log/" + wood.kind(), + "GT6 WoodEntry Log1", + wood.kind(), + "")), + true), + ItemCompositionSource.Kind.EXPLICIT, + "gt6ce:wood-log/" + wood.kind(), + "GT6 WoodEntry Log1"); + ItemMaterialRegistry.register( + item("gt6ce:planks_" + wood.kind()), MaterialPrefix.plate, material, GTValues.U); + } + } + + private static void registerVanillaWoods() { + for (String wood : + new String[] {"oak", "spruce", "birch", "jungle", "acacia", "dark_oak", "mangrove", "cherry"}) + registerVanillaWood(wood, "log", "wood"); + registerVanillaWood("crimson", "stem", "hyphae"); + registerVanillaWood("warped", "stem", "hyphae"); + } + + private static void registerVanillaWood(String wood, String... types) { + var material = GTMaterialRegistry.get(WoodSlabCatalog.material(wood)); + var bark = GTMaterialRegistry.get("Bark"); + for (String type : types) { + String raw = wood + "_" + type; + registerVanilla( + raw, + new ItemComposition( + null, + List.of( + MaterialComponent.of(material, 8 * GTValues.U), + MaterialComponent.of(bark, GTValues.U)), + material, + "GT6 WoodEntry (modern wood binding)", + true)); + registerVanilla("stripped_" + raw, new ItemComposition(null, material, 8 * GTValues.U)); + } + registerVanilla(wood + "_planks", new ItemComposition(MaterialPrefix.plate, material, GTValues.U)); + registerVanilla(wood + "_stairs", new ItemComposition(null, material, 3 * GTValues.U / 4)); + registerVanilla(wood + "_slab", new ItemComposition(null, material, GTValues.U / 2)); + } + + private static void registerVanilla(String path, ItemComposition composition) { + var item = item("minecraft:" + path); + ItemMaterialRegistry.register( + item, + composition, + ItemCompositionSource.Kind.EXPLICIT, + "gt6ce:wood-entry/" + path, + "GT6 wood material binding", + VanillaCompositionLoader.declarationId(item).orElse(null)); + } + + private static Item item(String id) { + var value = BuiltInRegistries.ITEM.get(ResourceLocation.parse(id)); + if (value == Items.AIR) throw new IllegalStateException("Missing wood material item " + id); + return value; + } +} diff --git a/minecraft/src/main/java/gregtech/content/recipe/BathMaterialRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/BathMaterialRecipes.java index 0aa379b36..75ac55a30 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/BathMaterialRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/BathMaterialRecipes.java @@ -54,8 +54,6 @@ public final class BathMaterialRecipes extends OriginalRecipeBatch { private static final String[] DUST_FORMS = {"dust", "dustSmall", "dustTiny"}; private static final int[] DUST_COUNTS = {1, 4, 9}; private static final long PAPER_TICKS = 16; - /** Wood-property materials the source ANY.Wood does not contain. */ - private static final Set NOT_ANY_WOOD_DUST = Set.of("PetrifiedWood"); private static final long CONVERSION_TICKS = 144; private final Set used = new HashSet<>(); @@ -75,12 +73,8 @@ public static int register() { private void paper() { Set sources = new LinkedHashSet<>(); - for (GTMaterial material : GTMaterialRegistry.allMaterials()) { - GTMaterial resolved = material.resolve(); - if (!resolved.isValid() || !resolved.has(MaterialProperty.WOOD)) continue; - if (NOT_ANY_WOOD_DUST.contains(resolved.getName())) continue; - sources.add(resolved); - } + for (GTMaterial material : GTMaterialRegistry.allMaterials()) + if (material.isValid() && material.has(MaterialProperty.WOOD)) sources.add(material.resolve()); for (String name : new String[] {"Bark", "Paper"}) { GTMaterial material = GTMaterialRegistry.get(name); if (material.isValid()) sources.add(material); diff --git a/minecraft/src/main/java/gregtech/content/recipe/CapsuleCellRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/CapsuleCellRecipes.java index d2f191c1f..d8771f2eb 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/CapsuleCellRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/CapsuleCellRecipes.java @@ -45,18 +45,6 @@ public static int registerRecycling() { for(var spec:PortableFluidContainerSpec.values())if(spec.shapeId().equals("cell")) { var input=new ItemStack(Mc.item(ResourceLocation.fromNamespaceAndPath("gt6ce","fluid_"+spec.id()))); var composition=ItemMaterialRegistry.base(input.getItem()).orElse(null); - if(composition==null) { - var data=new ItemComposition(null,java.util.List.of(MaterialComponent.of(spec.material(),GTValues.U9)), - spec.material(),java.util.List.of(new ItemCompositionSource( - ItemCompositionSource.Kind.EXPLICIT, - "gt6ce:capsule-cell/"+spec.id(), - "capsule-cell material", - spec.id(), - "")),true); - ItemMaterialRegistry.register(input.getItem(),data,ItemCompositionSource.Kind.EXPLICIT, - "gt6ce:capsule-cell/"+spec.id(),"PortableFluidContainerSpec"); - composition=ItemMaterialRegistry.base(input.getItem()).orElse(null); - } if(composition==null ||ItemMaterialRegistry.recoveryRejection(input)!=ItemMaterialRegistry.RecoveryRejection.ELIGIBLE ||composition.components().size()!=1 diff --git a/minecraft/src/main/java/gregtech/content/recipe/DiggableRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/DiggableRecipes.java index cb52389af..81cd19ce4 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/DiggableRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/DiggableRecipes.java @@ -1,13 +1,11 @@ package gregtech.content.recipe; import gregtech.api.material.GTMaterial; -import gregtech.api.material.GTValues; import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; import gregtech.content.material.Materials; import gregtech.content.registry.GTItems; import gregtech.content.registry.GTTechnological; -import gregtech.engine.material.ItemMaterialRegistry; import gregtech.engine.recipe.Recipe; import gregtech.platform.Mc; import java.util.ArrayList; @@ -45,17 +43,6 @@ public static List entries() { return List.copyOf(ENTRIES); } - /** GT6 {@code OM.data}: five clay blocks and turf contain four units; clay balls one unit. */ - public static void registerMaterials() { - for (Variant row : PACKABLE) { - if (row.material() == null) continue; // GT6 UNUSED.Mud has no composition. - ItemMaterialRegistry.register(item(row.block()), null, row.material(), GTValues.U * 4); - ItemMaterialRegistry.register(item(row.ball()), null, row.material(), GTValues.U); - } - ItemMaterialRegistry.register(item("turf"), null, Materials.Peat, GTValues.U * 4); - // Retired diggable_* IDs resolve through registry aliases to these same material entries. - } - public static int register() { if (registered) throw new IllegalStateException("Diggable processing rows registered twice"); registered = true; diff --git a/minecraft/src/main/java/gregtech/content/recipe/ElectronicsRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/ElectronicsRecipes.java index d07551bbe..beeaaaa4c 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/ElectronicsRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/ElectronicsRecipes.java @@ -8,6 +8,7 @@ import gregtech.content.data.*; import gregtech.content.registry.*; import gregtech.content.material.Materials; +import gregtech.content.material.catalog.SourceLensMaterialFacts.Color; import net.minecraft.world.item.ItemStack; //? if >=1.21.1 { /*import net.neoforged.neoforge.fluids.FluidStack; @@ -177,7 +178,7 @@ private static void crystal(String circuit, String[] names, if (gem == null || !gem.isValid() || (group == MaterialGroups.Sapphire && gem.resolve() == Materials.Ruby.resolve())) continue; ItemStack plate = GTItems.getStack(MaterialPrefix.plateGem, gem, 1); if (plate.isEmpty()) continue; - for (var lens : SourceLensRoles.lenses(SourceLensRoles.Color.GREEN)) + for (var lens : SourceLensRecipeItems.lenses(Color.GREEN)) add(MachineRecipeMaps.LaserEngraver, new Recipe( new ItemStack[]{plate.copy(), lens}, new ItemStack[]{tech(circuit, 1)}, null, null, null, null, 64, 256, 0) @@ -189,7 +190,7 @@ private static void crystal(String circuit, String[] names, private static void engrave(String wire,String foilMaterial) { var foil = GTItems.getStack(MaterialPrefix.foil, GTMaterialRegistry.get(foilMaterial), 4); if (foil.isEmpty()) return; - for (var lens : SourceLensRoles.lenses(SourceLensRoles.Color.RED)) + for (var lens : SourceLensRecipeItems.lenses(Color.RED)) add(MachineRecipeMaps.LaserEngraver,new Recipe( new ItemStack[]{foil.copy(),lens}, new ItemStack[]{tech(wire,1)},null,null,null,null,64,16,0).withCatalystInputs(1)); diff --git a/minecraft/src/main/java/gregtech/content/recipe/ExternalOreRecipeLifecycle.java b/minecraft/src/main/java/gregtech/content/recipe/ExternalOreRecipeLifecycle.java index c03164858..0155fcc60 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/ExternalOreRecipeLifecycle.java +++ b/minecraft/src/main/java/gregtech/content/recipe/ExternalOreRecipeLifecycle.java @@ -35,7 +35,7 @@ public static void stopped(ServerStoppedEvent event) { SharedOreSiftingRows.clear(); SharedOreCrushingRows.clear(); SharedOilSandRows.clear(); - SharedPurifiedAcidRows.clear(); + SharedSpecialProcessRows.clear(); SharedThermalInputRows.clear(); SharedThermalRecyclingRows.clear(); MoltenMetalUnitRecipes.clear(); diff --git a/minecraft/src/main/java/gregtech/content/recipe/GenerifierRecipeFamily.java b/minecraft/src/main/java/gregtech/content/recipe/GenerifierRecipeFamily.java index 59cc4eec0..4277bd323 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/GenerifierRecipeFamily.java +++ b/minecraft/src/main/java/gregtech/content/recipe/GenerifierRecipeFamily.java @@ -4,6 +4,7 @@ import gregtech.content.block.MaterialBlockLike; import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTBlocks; import gregtech.content.registry.GTItems; import gregtech.engine.material.GTMaterialRegistry; @@ -152,7 +153,9 @@ private static ItemStack vanillaOutput(String formName, String materialName) { } private static GTMaterial target(GTMaterial material) { - int targetId = GenerifyingRules.target(material.getId()); + int targetId = MaterialFactKeys.value(material, MaterialFactKeys.GENERIFICATION_TARGET) + .map(MaterialFactKeys.GenerificationTarget::materialId) + .orElse(material.getId()); if (targetId == material.getId()) return null; GTMaterial target = GTMaterialRegistry.get(targetId); return target.isValid() ? target : null; diff --git a/minecraft/src/main/java/gregtech/content/recipe/LaserStoneRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/LaserStoneRecipes.java index 7f1219c33..7f3a99887 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/LaserStoneRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/LaserStoneRecipes.java @@ -3,6 +3,7 @@ import gregtech.content.block.stone.StoneType; import gregtech.content.block.stone.StoneVariant; import gregtech.content.data.MachineRecipeMaps; +import gregtech.content.material.catalog.SourceLensMaterialFacts.Color; import gregtech.content.recipe.generated.GeneratedRecipeResolver; import gregtech.content.registry.GTBlocks; import gregtech.engine.recipe.Recipe; @@ -14,7 +15,7 @@ /** BlockStones and Loader_Recipes_OreDict, native stone and generator engravings. */ public final class LaserStoneRecipes { - public record Entry(String family, StoneType stone, SourceLensRoles.Color color, Recipe recipe) {} + public record Entry(String family, StoneType stone, Color color, Recipe recipe) {} private static final List ENTRIES = new ArrayList<>(); private static boolean registered; @@ -25,7 +26,7 @@ public static List entries() { return Collections.unmodifiableList(ENTRIES); } - public static StoneVariant output(SourceLensRoles.Color color) { + public static StoneVariant output(Color color) { return switch (color) { case WHITE -> StoneVariant.BRICKS_CHISELED; case RED -> StoneVariant.TILES; @@ -42,29 +43,21 @@ public static int register() { if (registered) return 0; registered = true; for (var stone : StoneType.values()) - for (var color : SourceLensRoles.Color.values()) - for (var lens : SourceLensRoles.lenses(color)) { + for (var color : Color.values()) + for (var lens : SourceLensRecipeItems.lenses(color)) { var inputBlock = GTBlocks.getStone(stone, StoneVariant.SMOOTH); var outputBlock = GTBlocks.getStone(stone, output(color)); if (inputBlock == null || outputBlock == null) throw new IllegalStateException("Missing native laser stone " + stone + "/" + color); var input = new ItemStack(inputBlock); var output = new ItemStack(outputBlock); - add( - "stone", - stone, - color, - input, - lens, - output, - color == SourceLensRoles.Color.WHITE ? 64 : 16, - false); + add("stone", stone, color, input, lens, output, color == Color.WHITE ? 64 : 16, false); } - for (var lens : SourceLensRoles.lenses(SourceLensRoles.Color.WHITE)) { + for (var lens : SourceLensRecipeItems.lenses(Color.WHITE)) { add( "vanilla", null, - SourceLensRoles.Color.WHITE, + Color.WHITE, new ItemStack(Items.STONE), lens, new ItemStack(Items.CHISELED_STONE_BRICKS), @@ -83,13 +76,13 @@ private static void module(String id, ItemStack output, ItemStack lens) { var input = GeneratedRecipeResolver.resolveSpec("tech:" + id + ":1"); if (input == null || input.isEmpty()) throw new IllegalStateException("Missing source laser generator module " + id); - add("module", null, SourceLensRoles.Color.WHITE, input, lens, output, 128, true); + add("module", null, Color.WHITE, input, lens, output, 128, true); } private static void add( String family, StoneType stone, - SourceLensRoles.Color color, + Color color, ItemStack input, ItemStack lens, ItemStack output, diff --git a/minecraft/src/main/java/gregtech/content/recipe/MachineRecipeOverlay.java b/minecraft/src/main/java/gregtech/content/recipe/MachineRecipeOverlay.java index 7f387eead..0293003ef 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/MachineRecipeOverlay.java +++ b/minecraft/src/main/java/gregtech/content/recipe/MachineRecipeOverlay.java @@ -144,7 +144,7 @@ private static Result applyGeneration(RecipeManager manager, long current) { SharedOreCrushingRows.rebuild(); SharedOilSandRows.rebuild(); // New purified-acid calls do not displace the earlier imported/static Bath producers. - SharedPurifiedAcidRows.rebuild(); + SharedSpecialProcessRows.rebuild(); MoltenMetalUnitRecipes.begin(); SharedThermalInputRows.rebuild(); SharedThermalRecyclingRows.rebuild(); @@ -168,7 +168,7 @@ private static Result applyGeneration(RecipeManager manager, long current) { baselineRows(), restoreMillis, producersMillis, moved, tally.removed, removeMillis, tally.added, installMillis, tally.priority, tally.rejected); if (generation != current) return lastResult; - lastPublication = MaterialPublication.platformGenerationPublished( + lastPublication = MaterialPublication.candidatePlatformGeneration( ItemMaterialRegistry.compositionRevision(), current); lastResult = new Result(tally.removed, tally.added, tally.rejected, restoreMillis, baselineRows(), false, false); applications++; @@ -195,7 +195,7 @@ private static void recover(ItemMaterialRegistry.TagGenerationCheckpoint checkpo SharedOreSiftingRows.clear(); SharedOreCrushingRows.clear(); SharedOilSandRows.clear(); - SharedPurifiedAcidRows.clear(); + SharedSpecialProcessRows.clear(); SharedThermalInputRows.clear(); SharedThermalRecyclingRows.clear(); MoltenMetalUnitRecipes.clear(); @@ -289,7 +289,7 @@ private static void ensureBaseline() { exclude.addAll(SharedOreSiftingRows.owned()); exclude.addAll(SharedOreCrushingRows.baselineExcluded()); exclude.addAll(SharedOilSandRows.baselineExcluded()); - exclude.addAll(SharedPurifiedAcidRows.owned()); + exclude.addAll(SharedSpecialProcessRows.owned()); exclude.addAll(SharedThermalInputRows.owned()); exclude.addAll(SharedThermalRecyclingRows.owned()); // Maps created after the first reload still get one baseline. A captured map keeps its first snapshot. diff --git a/minecraft/src/main/java/gregtech/content/recipe/MaterialFormConversionRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/MaterialFormConversionRecipes.java index f6e08505d..015d36ad4 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/MaterialFormConversionRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/MaterialFormConversionRecipes.java @@ -5,6 +5,7 @@ import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; import gregtech.content.data.generated.MaterialWorkability; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.material.Materials; import gregtech.content.registry.GTBlocks; import gregtech.content.registry.GTItems; @@ -107,7 +108,9 @@ private static void compressor(GTMaterial material, boolean easy, int quality) { || has(MaterialPrefix.gemExquisite, material) || has(MaterialPrefix.gemFlawless, material) || has(MaterialPrefix.bouleGt, material); - if (!gemLike && !"Ice".equals(material.getName())) { + if (!gemLike + && MaterialFactKeys.value(material, MaterialFactKeys.COMPRESSOR_DUST_TO_GEM_PLATE) + .orElse(true)) { compressing(material, easy ? 16 : 256L * (quality + 1), MaterialPrefix.dust, 1, MaterialPrefix.plateGem, 1); } // 9 material units of plate -> 1 dense plate. plate 9, plateTriple 3, blockPlate 1 and diff --git a/minecraft/src/main/java/gregtech/content/recipe/NonOreContinuationEvidence.java b/minecraft/src/main/java/gregtech/content/recipe/NonOreContinuationEvidence.java index 204e365a6..db3866c2a 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/NonOreContinuationEvidence.java +++ b/minecraft/src/main/java/gregtech/content/recipe/NonOreContinuationEvidence.java @@ -2,6 +2,7 @@ import gregtech.api.material.*; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTItems; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.*; @@ -60,7 +61,9 @@ public static Snapshot startupSnapshot(Collection reviewed) { Set defer = Collections.newSetFromMap(new IdentityHashMap<>()); Set triggers = triggers(); for (var material : candidates) { - if (ReviewedOreInputProfile.decision(material) != ReviewedOreInputProfile.Evidence.NO) defer.add(material); + if (MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_ORE_INPUT) + .orElse(MaterialFactKeys.Decision.UNKNOWN) + != MaterialFactKeys.Decision.NO) defer.add(material); // Explicit startup request is material-wide defer, even when only one intermediate requested. if (AddonMaterials.acceptedForms().stream() .anyMatch(f -> f.materialName().equals(material.getName()) && triggers.contains(f.prefixName()))) @@ -78,7 +81,6 @@ public static Snapshot startupSnapshot(Collection reviewed) { var data = ItemMaterialRegistry.base(stack.getItem()).orElse(null); if (data != null && (data.prefix() != prefix - || !data.bulkRecoveryAllowed() || data.components().size() != 1 || data.material().resolve() != material || data.amount() != prefix.getMaterialWeight())) defer.add(material); @@ -91,7 +93,6 @@ public static Snapshot startupSnapshot(Collection reviewed) { GTMaterial material = part.material().resolve(); if (!candidates.contains(material)) continue; if (!canonicalSelf(entry.getKey(), data.prefix(), material) - || !data.bulkRecoveryAllowed() || data.components().size() != 1 || data.amount() != data.prefix().getMaterialWeight()) defer.add(material); } diff --git a/minecraft/src/main/java/gregtech/content/recipe/NonOreMacerationRows.java b/minecraft/src/main/java/gregtech/content/recipe/NonOreMacerationRows.java index 8d0c12cb5..98eabff27 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/NonOreMacerationRows.java +++ b/minecraft/src/main/java/gregtech/content/recipe/NonOreMacerationRows.java @@ -4,6 +4,7 @@ import gregtech.engine.recipe.Recipe; import gregtech.engine.recipe.RecipeMap; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import net.minecraft.world.item.ItemStack; //? if >=1.21.1 { /*import net.neoforged.neoforge.fluids.FluidStack; @@ -23,7 +24,9 @@ public static void begin(){ } public static boolean reviewed(GTMaterial material){ if(startup==null)throw new IllegalStateException("Nonore definitions not initialized"); - return ReviewedOreInputProfile.decision(material)==ReviewedOreInputProfile.Evidence.NO&&!startup.active(material); + return MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_ORE_INPUT) + .orElse(MaterialFactKeys.Decision.UNKNOWN)==MaterialFactKeys.Decision.NO + &&!startup.active(material); } public static void register(GTMaterial material,MaterialPrefix prefix,String producer,RecipeMap map, boolean optimize,ItemStack input,ItemStack[] outputs,long[] chances,FluidStack[] fluids,long duration,long eu){ diff --git a/minecraft/src/main/java/gregtech/content/recipe/OreFluidBindingAdapter.java b/minecraft/src/main/java/gregtech/content/recipe/OreFluidBindingAdapter.java index 1486c477c..4e082c6a7 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/OreFluidBindingAdapter.java +++ b/minecraft/src/main/java/gregtech/content/recipe/OreFluidBindingAdapter.java @@ -1,6 +1,8 @@ package gregtech.content.recipe; import gregtech.api.material.GTMaterial; +import gregtech.content.material.catalog.MaterialFluidUnitFacts; import gregtech.engine.addon.AddonMaterials; +import gregtech.engine.material.GTMaterialRegistry; import gregtech.content.registry.GTFluids; import net.minecraft.core.registries.BuiltInRegistries; //? if >=1.21.1 { @@ -20,23 +22,26 @@ public static FluidStack liquid(GTMaterial material,long sourceAmount,boolean ro * Only the reviewed ID/name binding table can resolve here; never infer an arbitrary fluid alias. */ static FluidStack sourceLiquid(int sourceId,String sourceName,long sourceAmount,boolean roundUp) { - var b=ReviewedOreFluidBindings.liquid(sourceId,sourceName); - int mb=ReviewedOreFluidBindings.amount(b,sourceAmount,roundUp); + var material=GTMaterialRegistry.get(sourceId); + if(!material.isValid()||!material.getName().equals(sourceName))return FluidStack.EMPTY; + var b=MaterialFluidUnitFacts.binding(material,"liquid"); + int mb=b==null?-1:MaterialFluidUnitFacts.millibuckets( + sourceAmount,b.referenceSourceUnits(),b.referenceMillibuckets(),roundUp); if(b==null||mb<=0)return FluidStack.EMPTY; - var stack=GTFluids.stack(b.field(),mb); + var stack=GTFluids.stack(b.fluidField(),mb); if(stack==null||stack.isEmpty())return FluidStack.EMPTY; var key=BuiltInRegistries.FLUID.getKey(stack.getFluid()); - String nativePath=switch(b.field()) { + String nativePath=switch(b.fluidField()) { case "GenMolten_Wax" -> "molten_wax"; case "GenMolten_WaxBee" -> "molten_waxbee"; case "GenMolten_WaxParaffin" -> "molten_waxparaffin"; case "GenMolten_WaxPlant" -> "molten_waxplant"; case "GenLiquid_Mercury" -> "mercury"; - default -> throw new IllegalStateException("No reviewed native identity: "+b.field()); + default -> throw new IllegalStateException("No reviewed native identity: "+b.fluidField()); }; - var entry=gregtech.content.data.RegisteredFluids.get(b.field()); + var entry=gregtech.content.data.RegisteredFluids.get(b.fluidField()); if(entry==null||!(gregtech.content.data.RegisteredFluids.isBuiltInDefinition(entry) - || (b.field().equals("GenLiquid_Mercury") && ReviewedOreGeneratedFluids.mercury(entry)))||!entry.registryName().equals(b.registryPath())) + || (b.fluidField().equals("GenLiquid_Mercury") && SourceGeneratedFluidAdapter.mercury(entry)))||!entry.registryName().equals(b.registryName())) throw new IllegalStateException("Reviewed source catalog identity mismatch: "+b); if(!key.getNamespace().equals(gregtech.engine.mod.GregTechIdentity.REGISTRY_NAMESPACE)||!key.getPath().equals(nativePath)) throw new IllegalStateException("Reviewed source fluid binding identity mismatch: "+b+" -> "+key); diff --git a/minecraft/src/main/java/gregtech/content/recipe/OreProcessingRecipeLoader.java b/minecraft/src/main/java/gregtech/content/recipe/OreProcessingRecipeLoader.java index 9c7db1077..583ffe1fb 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/OreProcessingRecipeLoader.java +++ b/minecraft/src/main/java/gregtech/content/recipe/OreProcessingRecipeLoader.java @@ -6,6 +6,7 @@ import gregtech.engine.material.*; import gregtech.engine.recipe.RecipeMap; import gregtech.content.data.*; +import gregtech.content.material.MaterialFactKeys; import gregtech.bootstrap.InitializationStep; import gregtech.content.registry.GTFluids; import gregtech.content.registry.RegisteredBlock; @@ -68,7 +69,7 @@ public void run() { SharedPurifiedCentrifugeRows.initialize(); SharedOreMagneticRows.initialize(); SharedOreSiftingRows.initialize(); - SharedPurifiedAcidRows.initialize(); + SharedSpecialProcessRows.initialize(); SharedThermalInputRows.initialize(); SharedThermalRecyclingRows.initialize(); SharedMineralSteamCrackingRows.initialize(); @@ -161,8 +162,11 @@ private void registerSmelting(GTMaterial material, GTMaterial crushing, ItemStac long smeltAmount = material.getTargetSmeltingAmount(); GTMaterial smeltTarget = material.getTargetSmeltingMaterial(); if (smeltTarget == null || !smeltTarget.isValid() || smeltAmount <= 0) return; - if (!ReviewedOreSourceProfile.decision(material, ReviewedOreSourceProfile.Rule.FURNACE) - .orLegacy(material.has(MaterialProperty.MELTING))) return; + var furnace = MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_FURNACE) + .orElse(MaterialFactKeys.Decision.UNKNOWN); + if (!(furnace == MaterialFactKeys.Decision.YES + || furnace == MaterialFactKeys.Decision.UNKNOWN + && material.has(MaterialProperty.MELTING))) return; ItemStack smeltOutput = OM.dustOrIngot(smeltTarget, smeltAmount); if (smeltOutput.isEmpty()) { @@ -307,9 +311,9 @@ private void registerOreEntryRecipes(GTMaterial material, ItemStack oreInput, in } else { // Unreviewed/external/startup overrides retain original direct admission and ordering. // GT6 crusher has two guaranteed primary outputs; hammer has one. - if (ReviewedCinnabarFacts.supports(material) + if (SourceCinnabarFollowonAdapter.supports(material) && oreInput.getItem()==mat(MaterialPrefix.oreRaw,material,1).getItem()) { - SourceOreFollowonRows.rawCrusher(material,ReviewedCinnabarFacts.INSTANCE); + SourceOreFollowonRows.rawCrusher(material,SourceCinnabarFollowonAdapter.INSTANCE); } else SharedOreCrushingRows.capture(crushing, MachineRecipeMaps.Crusher, MachineRecipeMaps.Crusher.addRecipe1(true, EU_TIER, 128L * count * quality, oreInput, out, out.copy())); SharedOreCrushingRows.capture(crushing, MachineRecipeMaps.Hammer, @@ -356,9 +360,9 @@ private void processMaceration() { if (pulverizeOne(MaterialPrefix.crushedPurifiedTiny, material, 1, MaterialPrefix.dustTiny, U9)) claimed.add(MaterialPrefix.crushedPurifiedTiny); // Hand off only unclaimed shapes to the previous reviewed producer, not duplicate registrations. if (claimed.size() < SourceOreShreddingRules.shapes().size()) { - if (ReviewedCinnabarFacts.supports(material)) SourceOreFollowonRows.shredder(material,ReviewedCinnabarFacts.INSTANCE,claimed); - else if (ReviewedOreShredderFacts.supports(material)) - SourceOreFollowonRows.shredder(material, ReviewedOreShredderFacts.INSTANCE,claimed); + if (SourceCinnabarFollowonAdapter.supports(material)) SourceOreFollowonRows.shredder(material,SourceCinnabarFollowonAdapter.INSTANCE,claimed); + else if (SourceOreFollowonAdapter.supports(material)) + SourceOreFollowonRows.shredder(material, SourceOreFollowonAdapter.INSTANCE,claimed); } } } @@ -373,7 +377,7 @@ private boolean pulverizeOne(MaterialPrefix inputPref, GTMaterial material, int if (!inputPref.isValidFor(material) || input.isEmpty()) return false; ItemStack output = stackFor(outputPref, material, outAmount); if (output.isEmpty()) return false; - if (ReviewedCinnabarFacts.supports(material) || ReviewedOreShredderFacts.supports(material)) { + if (SourceCinnabarFollowonAdapter.supports(material) || SourceOreFollowonAdapter.supports(material)) { // Unsupported contexts preserve the former reviewed Crusher/follow-on split. MachineRecipeMaps.Crusher.addRecipe1(true,16,64,new long[]{CHANCE_100,CHANCE_10,CHANCE_10},input,output,ItemStack.EMPTY,ItemStack.EMPTY); } else if (NonOreMacerationRows.reviewed(material)) { @@ -402,7 +406,7 @@ private boolean pulverizeMulti(MaterialPrefix inputPref, GTMaterial material, in return false; } MachineRecipeMaps.Crusher .addRecipe1(true, EU_TIER, 32, input, multiOut); - if (!ReviewedCinnabarFacts.supports(material) && !ReviewedOreShredderFacts.supports(material)) { + if (!SourceCinnabarFollowonAdapter.supports(material) && !SourceOreFollowonAdapter.supports(material)) { var recipe = RecipeMap.make( true, new ItemStack[] {input}, @@ -491,7 +495,7 @@ private void processRecycling() { GTMaterial material = mat.resolve(); if (!material.isValid()) continue; if (material.has(MaterialProperty.ANTIMATTER)) continue; - if (ReviewedCinnabarThermalRecipes.emitIfSupported(material)) continue; + if (SourceDustThermalRecipes.emitIfSupported(material)) continue; ItemStack recyclableInput = OM.dustOrIngot(material, U); var thermal = SourceThermalNativeAdapter.inspect(material, recyclableInput, thermalSnapshot); diff --git a/minecraft/src/main/java/gregtech/content/recipe/PartRecipeLoader.java b/minecraft/src/main/java/gregtech/content/recipe/PartRecipeLoader.java index 66c2d49ae..6867a97c7 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/PartRecipeLoader.java +++ b/minecraft/src/main/java/gregtech/content/recipe/PartRecipeLoader.java @@ -217,7 +217,7 @@ private static boolean verifiedSolidBlock(ItemStack stack, GTMaterial material) || block.prefix() != prefix || block.material().resolve() != material) return false; long units = 9 * GTValues.U; var data = gregtech.engine.material.ItemMaterialRegistry.base(stack.getItem()).orElse(null); - if (data != null) return data.bulkRecoveryAllowed() && data.prefix() == null + if (data != null) return data.prefix() == null && data.components().size() == 1 && data.material().resolve() == material && data.amount() == units; // Forge has no general block composition registration; inspect the actual known block. diff --git a/minecraft/src/main/java/gregtech/content/recipe/RecipePublication.java b/minecraft/src/main/java/gregtech/content/recipe/RecipePublication.java index eccb0871b..de6ca8c27 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/RecipePublication.java +++ b/minecraft/src/main/java/gregtech/content/recipe/RecipePublication.java @@ -44,7 +44,11 @@ public static void publish(MinecraftServer server) { RecipeManager manager = server.getRecipeManager(); Collection current = manager.getRecipes(); var applied = APPLIED.get(manager); - if (applied != null && applied.size() == current.size() && applied.containsAll(current)) return; + if (applied != null && applied.size() == current.size() && applied.containsAll(current)) { + if (MachineRecipeOverlay.generation() > 0 && !MachineRecipeOverlay.lastResult().failed()) + gregtech.engine.material.MaterialPublication.commit(MachineRecipeOverlay.lastPublication()); + return; + } RegistryAccess access = server.registryAccess(); //? if >=1.21.1 { /*var working = new RecipeManager(access); @@ -57,6 +61,8 @@ public static void publish(MinecraftServer server) { OvenRecipeBridge.apply(working, access); dedup(working, access); manager.replaceRecipes(working.getRecipes()); + if (MachineRecipeOverlay.generation() > 0 && !MachineRecipeOverlay.lastResult().failed()) + gregtech.engine.material.MaterialPublication.commit(MachineRecipeOverlay.lastPublication()); //? if >=1.21.1 { /*ShapelessRecipeTooltipIndex.rebuild(manager, access); *///?} else { diff --git a/minecraft/src/main/java/gregtech/content/recipe/RegisteredWoodSurvivalRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/RegisteredWoodSurvivalRecipes.java index 63a5ab97e..73abe0b38 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/RegisteredWoodSurvivalRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/RegisteredWoodSurvivalRecipes.java @@ -14,68 +14,6 @@ public final class RegisteredWoodSurvivalRecipes extends OriginalRecipeBatch { public static final RegisteredWoodSurvivalRecipes INSTANCE = new RegisteredWoodSurvivalRecipes(); - public static void registerMaterials() { - // PlankEntry binds the actual wood species, not the generic Wood fallback. Keep this - // available before recipe generation, including shaped wooden-tool material matching. - for (String wood : WoodSlabCatalog.WOODS) { - var material = material(wood); - ItemMaterialRegistry.register( - item("gt6ce:planks_" + wood, 1).getItem(), MaterialPrefix.plate, material, GTValues.U); - ItemMaterialRegistry.register(item("gt6ce:slab_" + wood, 1).getItem(), null, material, GTValues.U / 2); - } - for (var species : WoodSpecies.values()) { - var material = material(species.id()); - var bark = GTMaterialRegistry.get(species == WoodSpecies.CINNAMON ? "Cinnamon" : "Bark"); - ItemMaterialRegistry.register( - GTWoods.log(species).asItem(), - new ItemComposition( - null, - java.util.List.of( - MaterialComponent.of(material, 8 * GTValues.U), - MaterialComponent.of(bark, GTValues.U)), - material, - java.util.List.of(new ItemCompositionSource( - ItemCompositionSource.Kind.EXPLICIT, - "gt6ce:wood-log/" + species.id(), - "GT6 WoodEntry", - species.id(), - "")), - true), - ItemCompositionSource.Kind.EXPLICIT, - "gt6ce:wood-log/" + species.id(), - "GT6 WoodEntry"); - ItemMaterialRegistry.register(GTWoods.strippedLog(species).asItem(), null, material, 8 * GTValues.U); - } - for (var wood : NaturalWoodCraftingRows.SPECIES) { - var material = gregtech.engine.material.GTMaterialRegistry.get(wood.material()); - var bark = gregtech.engine.material.GTMaterialRegistry.get(wood.barkMaterial()); - long unit = gregtech.api.material.GTValues.U; - var components = java.util.List.of( - gregtech.api.material.MaterialComponent.of(material, 5 * unit), - gregtech.api.material.MaterialComponent.of(bark, unit)); - // WoodEntry upgrades the original generic 4U log to 5U wood + 1U bark, - // or 6U of the same material for rotten/mossy wood. PlankEntry contributes 1U. - gregtech.engine.material.ItemMaterialRegistry.register( - item("gt6ce:log_" + wood.kind(), 1).getItem(), - new gregtech.engine.material.ItemComposition( - null, - components, - material, - java.util.List.of(new gregtech.engine.material.ItemCompositionSource( - gregtech.engine.material.ItemCompositionSource.Kind.EXPLICIT, - "gt6ce:wood-log/" + wood.kind(), - "GT6 WoodEntry Log1", - wood.kind(), - "")), - true), - gregtech.engine.material.ItemCompositionSource.Kind.EXPLICIT, - "gt6ce:wood-log/" + wood.kind(), - "GT6 WoodEntry Log1"); - gregtech.engine.material.ItemMaterialRegistry.register( - item("gt6ce:planks_" + wood.kind(), 1).getItem(), MaterialPrefix.plate, material, unit); - } - } - public static int register() { for (var species : WoodSpecies.values()) INSTANCE.wood(species); for (String species : new String[] {"crimson", "warped"}) INSTANCE.netherWood(species); @@ -113,8 +51,6 @@ private void slabUses(String wood) { var material = gregtech.engine.material.GTMaterialRegistry.get(name); var slab = item("gt6ce:slab_" + wood, 1); pulverize(item("gt6ce:planks_" + wood, 1), wood, GTValues.U); - gregtech.engine.material.ItemMaterialRegistry.register( - slab.getItem(), null, material, gregtech.api.material.GTValues.U / 2); var dust = MortarGrindingRecipes.pulverize(material, gregtech.api.material.GTValues.U / 2); // pulverizing registers both the crusher and the shredder, as in the original helper. if (dust.isEmpty()) throw new IllegalStateException("Missing wood slab pulverization material " + name); diff --git a/minecraft/src/main/java/gregtech/content/recipe/ReviewedOreFluidBindings.java b/minecraft/src/main/java/gregtech/content/recipe/ReviewedOreFluidBindings.java deleted file mode 100644 index c98b50beb..000000000 --- a/minecraft/src/main/java/gregtech/content/recipe/ReviewedOreFluidBindings.java +++ /dev/null @@ -1,30 +0,0 @@ -package gregtech.content.recipe; -/** Bounded original liquid-unit bindings, NOT a replacement for legacy materialFluid(). - * Source Loader_Fluids132 (Petrotheum),131 (Cryotheum),205-212 (wax),618 (Hg). - * FL.createMolten1074-1077:144 mB/U. Explicit liquids may use250 or1000, never infer by flag. - */ -public final class ReviewedOreFluidBindings { - public record Binding(int materialId, String materialName, String field, String registryPath, long mbPerU) {} - - private static final Binding[] VALUES = { - new Binding(800, "Mercury", "GenLiquid_Mercury", "mercury", 144), - new Binding(8235, "Wax", "GenMolten_Wax", "molten.wax", 144), - new Binding(8236, "WaxBee", "GenMolten_WaxBee", "molten.waxbee", 144), - new Binding(8238, "WaxParaffin", "GenMolten_WaxParaffin", "molten.waxparaffin", 144), - new Binding(8239, "WaxPlant", "GenMolten_WaxPlant", "molten.waxplant", 144), - }; - - private ReviewedOreFluidBindings() {} - - public static Binding liquid(int id, String name) { - for (var row : VALUES) if (row.materialId == id && row.materialName.equals(name)) return row; - return null; // Unknown is unsupported, not a 144/1000 guess. - } - - public static int amount(Binding binding, long sourceAmount, boolean roundUp) { - return binding == null - ? -1 - : OriginalMaterialFluidUnits.millibuckets( - sourceAmount, OriginalMaterialFluidUnits.SOURCE_UNIT, binding.mbPerU, roundUp); - } -} diff --git a/minecraft/src/main/java/gregtech/content/recipe/ReviewedOreInputProfile.java b/minecraft/src/main/java/gregtech/content/recipe/ReviewedOreInputProfile.java deleted file mode 100644 index ccc5177d1..000000000 --- a/minecraft/src/main/java/gregtech/content/recipe/ReviewedOreInputProfile.java +++ /dev/null @@ -1,83 +0,0 @@ -package gregtech.content.recipe; - -import gregtech.api.material.GTMaterial; -import gregtech.engine.addon.AddonMaterials; -import gregtech.engine.material.GTMaterialRegistry; - -/** Bounded baseline ORES-property proof. Not a universal recipe or external-form prohibition. - * 53 reviewed negatives from54 target-link candidates; Sand and all other identities UNKNOWN. - * Evidence: docs/integration/nonore-input-source-profile.json; paired declaration references and source hashes. - * Factory/group/postmutation tracing, never table absence, establishes these bounded decisions. - */ -public final class ReviewedOreInputProfile { - public enum Evidence { - YES, - NO, - UNKNOWN - } - - private ReviewedOreInputProfile() {} - - public static Evidence decision(GTMaterial material) { - if (material == null) return Evidence.UNKNOWN; - material = material.resolve(); - if (!material.isValid() || !GTMaterialRegistry.isCoreMaterial(material) || AddonMaterials.owns(material)) - return Evidence.UNKNOWN; - String name = material.getName(); - // A supported ore-form request changes this material's baseline. Defer, do not infer ORES YES. - // Otherwise allowing only the requested crushed input could strand its old purified outputs. - if (AddonMaterials.acceptedForms().stream() - .anyMatch(f -> f.materialName().equals(name) - && java.util.Set.of( - "oreRaw", - "crushed", - "crushedTiny", - "crushedPurified", - "crushedPurifiedTiny", - "crushedCentrifuged", - "crushedCentrifugedTiny") - .contains(f.prefixName()))) return Evidence.UNKNOWN; - return switch (material.getId()) { - case 8418 -> name.equals("Bamboo") ? Evidence.NO : Evidence.UNKNOWN; - case 8275 -> name.equals("Bark") ? Evidence.NO : Evidence.UNKNOWN; - case 8620 -> name.equals("Brass") ? Evidence.NO : Evidence.UNKNOWN; - case 8610 -> name.equals("Bronze") ? Evidence.NO : Evidence.UNKNOWN; - case 8501 -> name.equals("Concrete") ? Evidence.NO : Evidence.UNKNOWN; - case 8290 -> name.equals("Dreamwood") ? Evidence.NO : Evidence.UNKNOWN; - case 8751 -> name.equals("Duranium") ? Evidence.NO : Evidence.UNKNOWN; - case 8504 -> name.equals("Endstone") ? Evidence.NO : Evidence.UNKNOWN; - case 8035 -> name.equals("FerricOxyhydroxide") ? Evidence.NO : Evidence.UNKNOWN; - case 8698 -> name.equals("Fireleaf") ? Evidence.NO : Evidence.UNKNOWN; - case 9712 -> name.equals("FishRaw") ? Evidence.NO : Evidence.UNKNOWN; - case 8002 -> name.equals("Flint") ? Evidence.NO : Evidence.UNKNOWN; - case 90 -> name.equals("Fluorine") ? Evidence.NO : Evidence.UNKNOWN; - case 9175 -> name.equals("Graphene") ? Evidence.NO : Evidence.UNKNOWN; - case 8296 -> name.equals("Greatwood") ? Evidence.NO : Evidence.UNKNOWN; - case 9802 -> name.equals("Ice") ? Evidence.NO : Evidence.UNKNOWN; - case 8645 -> name.equals("IronMagnetic") ? Evidence.NO : Evidence.UNKNOWN; - case 8241 -> name.equals("Leather") ? Evidence.NO : Evidence.UNKNOWN; - case 9189 -> name.equals("Limestone") ? Evidence.NO : Evidence.UNKNOWN; - case 8289 -> name.equals("Livingwood") ? Evidence.NO : Evidence.UNKNOWN; - case 8506 -> name.equals("Marble") ? Evidence.NO : Evidence.UNKNOWN; - case 9700 -> name.equals("MeatRaw") ? Evidence.NO : Evidence.UNKNOWN; - case 8647 -> name.equals("NeodymiumMagnetic") ? Evidence.NO : Evidence.UNKNOWN; - case 8502 -> name.equals("Netherrack") ? Evidence.NO : Evidence.UNKNOWN; - case 8214 -> name.equals("Obsidian") ? Evidence.NO : Evidence.UNKNOWN; - case 8218 -> name.equals("Plastic") ? Evidence.NO : Evidence.UNKNOWN; - case 8197 -> name.equals("PVC") ? Evidence.NO : Evidence.UNKNOWN; - case 8104 -> name.equals("RedSand") ? Evidence.NO : Evidence.UNKNOWN; - case 8217 -> name.equals("Rubber") ? Evidence.NO : Evidence.UNKNOWN; - case 8297 -> name.equals("Silverwood") ? Evidence.NO : Evidence.UNKNOWN; - case 9801 -> name.equals("Snow") ? Evidence.NO : Evidence.UNKNOWN; - case 8673 -> name.equals("Steeleaf") ? Evidence.NO : Evidence.UNKNOWN; - case 8651 -> name.equals("SteelGalvanized") ? Evidence.NO : Evidence.UNKNOWN; - case 8646 -> name.equals("SteelMagnetic") ? Evidence.NO : Evidence.UNKNOWN; - case 8196 -> name.equals("Teflon") ? Evidence.NO : Evidence.UNKNOWN; - case 8752 -> name.equals("Tritanium") ? Evidence.NO : Evidence.UNKNOWN; - case 8027 -> name.equals("TungsticAcid") ? Evidence.NO : Evidence.UNKNOWN; - case 8221 -> name.equals("Wood") ? Evidence.NO : Evidence.UNKNOWN; - case 8224 -> name.equals("WoodRubber") ? Evidence.NO : Evidence.UNKNOWN; - default -> Evidence.UNKNOWN; - }; - } -} diff --git a/minecraft/src/main/java/gregtech/content/recipe/SharedMineralSteamCrackingRows.java b/minecraft/src/main/java/gregtech/content/recipe/SharedMineralSteamCrackingRows.java index 536b79d10..ea07dc02d 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SharedMineralSteamCrackingRows.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SharedMineralSteamCrackingRows.java @@ -31,6 +31,12 @@ public final class SharedMineralSteamCrackingRows { private static final Set OWNED = Collections.newSetFromMap(new IdentityHashMap<>()); private static final Map STATUS = new IdentityHashMap<>(); + private record SourceWax(int id, String name) {} + private static final List SOURCE_WAXES = List.of( + new SourceWax(8235, "Wax"), + new SourceWax(8236, "WaxBee"), + new SourceWax(8238, "WaxParaffin"), + new SourceWax(8239, "WaxPlant")); private static boolean initialized; private SharedMineralSteamCrackingRows() {} @@ -65,7 +71,7 @@ public static void rebuild() { var snapshot = new Snapshot(); // These are source ANY.Wax factory members, not a mineral admission whitelist. // The original source binds each to 144 mB/U; unavailable wax fluids are skipped. - var waxes = ReviewedCinnabarFacts.sourceWaxes(); + var waxes = sourceWaxes(); for (GTMaterial alias : GTMaterialRegistry.allMaterials()) { GTMaterial material = alias.resolve(); if (!seen.add(material)) continue; @@ -93,8 +99,8 @@ public static void rebuild() { if (environment.kind() == SourcePurifiedCentrifugePlan.EnvironmentKind.FLUID) { var binding = environment.binding(); // Original first rounds U/18 UP, then multiplies that result by nine. - millibuckets[index] = OriginalMaterialFluidUnits.millibuckets( - OriginalMaterialFluidUnits.SOURCE_UNIT / 18, + millibuckets[index] = gregtech.content.material.catalog.MaterialFluidUnitFacts.millibuckets( + gregtech.content.material.catalog.MaterialFluidUnitFacts.SOURCE_UNIT / 18, binding.referenceSourceUnits(), binding.referenceMillibuckets(), true); if (millibuckets[index] < 0) { statuses.put(material, "UNRESOLVED:byproduct-volume-" + index); @@ -107,8 +113,8 @@ public static void rebuild() { int count = 0; for (GTMaterial wax : waxes) for (int scale : new int[]{9, 1}) { FluidStack waxFluid = OreFluidBindingAdapter.liquid(wax, - scale == 9 ? OriginalMaterialFluidUnits.SOURCE_UNIT - : OriginalMaterialFluidUnits.SOURCE_UNIT / 9, true); + scale == 9 ? gregtech.content.material.catalog.MaterialFluidUnitFacts.SOURCE_UNIT + : gregtech.content.material.catalog.MaterialFluidUnitFacts.SOURCE_UNIT / 9, true); if (waxFluid.isEmpty()) continue; FluidStack steam = GTFluids.stack("Steam", 160 * scale); FluidStack water = GTFluids.stack("Water", scale); @@ -146,6 +152,19 @@ public static void rebuild() { } } + private static List sourceWaxes() { + var values = new ArrayList(4); + for (SourceWax source : SOURCE_WAXES) { + var material = GTMaterialRegistry.get(source.name()); + if (material.isValid() + && !gregtech.engine.addon.AddonMaterials.owns(material) + && GTMaterialRegistry.isCoreMaterial(material) + && material.resolve().getId() == source.id + && material.resolve().getName().equals(source.name)) values.add(material.resolve()); + } + return List.copyOf(values); + } + private static final class Snapshot { final SharedPurifiedCentrifugeRows.Snapshot phases = new SharedPurifiedCentrifugeRows.Snapshot(); final Map>> explicit = new IdentityHashMap<>(); diff --git a/minecraft/src/main/java/gregtech/content/recipe/SharedOilSandRows.java b/minecraft/src/main/java/gregtech/content/recipe/SharedOilSandRows.java index eda8f691c..e20a186dd 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SharedOilSandRows.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SharedOilSandRows.java @@ -27,7 +27,7 @@ import static gregtech.content.recipe.SourceOreCrushingAdapter.Candidate; import static gregtech.content.recipe.SourceOreCrushingAdapter.NativeKind; import static gregtech.content.recipe.SourceOreCrushingAdapter.Domain; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; +import static gregtech.content.material.MaterialFactKeys.Decision; import static gregtech.content.recipe.SourceOilSandRules.*; /** The OilSand ore-registration Centrifuge event, independent of the Crusher/Hammer handlers. diff --git a/minecraft/src/main/java/gregtech/content/recipe/SharedOreCrushingRows.java b/minecraft/src/main/java/gregtech/content/recipe/SharedOreCrushingRows.java index d54a8f861..7bb1b1c15 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SharedOreCrushingRows.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SharedOreCrushingRows.java @@ -50,7 +50,7 @@ static void begin() { static Candidate candidate(GTMaterial material, ItemStack input, boolean raw) { if (startup == null || sealed) throw new IllegalStateException("Crushing capture is not open"); // Preserve the already reviewed raw Cinnabar helper and its baseline Recipe identity. - if (raw && ReviewedCinnabarFacts.supports(material)) return null; + if (raw && SourceCinnabarFollowonAdapter.supports(material)) return null; return SourceOreCrushingAdapter.candidate(material, input, raw, startup); } diff --git a/minecraft/src/main/java/gregtech/content/recipe/SharedOreWashingRows.java b/minecraft/src/main/java/gregtech/content/recipe/SharedOreWashingRows.java index d5df5995e..81b78feff 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SharedOreWashingRows.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SharedOreWashingRows.java @@ -6,6 +6,9 @@ import gregtech.content.data.FluidCatalog; import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; +import gregtech.content.material.catalog.MaterialFluidUnitFacts; +import gregtech.content.material.catalog.SourceWashingMaterialFacts; import gregtech.content.registry.GTBlocks; import gregtech.content.registry.GTFluids; import gregtech.content.registry.GTItems; @@ -29,6 +32,7 @@ import java.util.*; import java.util.function.BiFunction; import static gregtech.api.material.GTValues.U; +import static gregtech.content.material.MaterialFactKeys.Decision; import static gregtech.content.recipe.SourceOreWashingRules.*; /** Original Ores Bath/water Sluice, Handlers Petrotheum and explicit Cryotheum rows. @@ -140,11 +144,11 @@ private static void ores(GTMaterial m,Snapshot s,List out){ new FluidStack[]{sluice.copy()},size.ticks(),SLUICE_POWER)); } } - for(var tag:SourceOreWashingData.Tag.values()){ + for(var tag:SourceWashingMaterialFacts.Tag.values()){ var selection=selectByproduct(m,by,candidate->s.tag(candidate,tag),candidate->s.purified(Size.TINY,candidate,1).availability()); if(!s.ready(m,"bath/"+tag,selection.availability()))continue; GTMaterial product=selection.material(); - if(tag==SourceOreWashingData.Tag.MERCURY){ + if(tag==SourceWashingMaterialFacts.Tag.MERCURY){ for(Size size:Size.values()){ var outputs=bathOutputs(m,product,size,s);if(outputs==null)continue; var mercury=s.fluid("GenLiquid_Mercury",size.mercuryMb());if(!s.fluidReady(m,"mercury/"+size,mercury))continue; @@ -153,7 +157,7 @@ private static void ores(GTMaterial m,Snapshot s,List out){ } }else{ // Loader_Recipes_Ores names Firestone first; a retired reagent material is skipped, not fatal. - String[] reagents=tag==SourceOreWashingData.Tag.PERSULFATE?new String[]{"SodiumPersulfate","PotassiumPersulfate"} + String[] reagents=tag==SourceWashingMaterialFacts.Tag.PERSULFATE?new String[]{"SodiumPersulfate","PotassiumPersulfate"} :new String[]{"Firestone","Pyrotheum","Octine"}; for(String reagentName:reagents)for(BathShape shape:bathShapes()){ String route="bath/"+tag+"/"+reagentName+"/"+shape; @@ -161,7 +165,7 @@ private static void ores(GTMaterial m,Snapshot s,List out){ if(!s.ready(m,route,reagent.availability()))continue; var outputs=bathOutputs(m,product,shape.outputSize(),s);if(outputs==null)continue; FluidStack[] steam=new FluidStack[0]; - if(tag==SourceOreWashingData.Tag.FIRESTONE){ + if(tag==SourceWashingMaterialFacts.Tag.FIRESTONE){ var fluid=s.fluid("Steam",shape.outputSize().steamMb());if(!s.fluidReady(m,route,fluid))continue;steam=new FluidStack[]{fluid}; } var input=s.input(shape.input(),m,shape.inputCount());if(!s.ready(m,route,input.availability()))continue; @@ -252,7 +256,7 @@ NativeForm output(MaterialPrefix prefix,GTMaterial m,int count){ if(direct.availability()==Availability.UNKNOWN)return direct; ItemStack canonical=GTItems.getStack(prefix,m,count); ItemStack reviewed=SourceOreOutputRows.resolvingOutputs(()->SourceOreInputForms.reviewedOreOutput(prefix,m,count)); - if(ReviewedCrushedFormGeneration.excludedBuiltin(m,prefix,canonical)){ + if(SourceCrushedFormAdapter.excludedBuiltin(m,prefix,canonical)){ // That helper returns the canonical legacy stack only for ambiguous/unsupported aliases. if(!canonical.isEmpty()&&ItemStack.matches(canonical,reviewed))return NativeForm.unknown(); return reviewed.isEmpty()?NativeForm.absent():NativeForm.present(reviewed); @@ -279,10 +283,12 @@ NativeForm blockDust(GTMaterial m,int count){ ||form.material().resolve()!=m.resolve())return NativeForm.unknown(); stack.setCount(count);return NativeForm.present(stack); } - SourceOreWashingData.Decision tag(GTMaterial m,SourceOreWashingData.Tag tag){ + Decision tag(GTMaterial m,SourceWashingMaterialFacts.Tag tag){ if(m==null||!m.isValid()||!GTMaterialRegistry.isCoreMaterial(m.resolve())||AddonMaterials.owns(m.resolve())) - return SourceOreWashingData.Decision.UNKNOWN; - return SourceOreWashingData.decision(m.getId(),m.getName(),tag); + return Decision.UNKNOWN; + var rule=MaterialFactKeys.value(m,MaterialFactKeys.SOURCE_WASHING).orElse(null); + if(rule==null)return Decision.UNKNOWN; + return rule.tags().contains(tag)?Decision.YES:Decision.NO; } FluidStack fluid(String field,int amount){return checkedFluid(field,amount,definitions,fluidLookup);} } @@ -300,14 +306,15 @@ static FluidStack checkedFluid(String field,int amount,MapFluidCatalog.DistW;case "Sluice"->FluidCatalog.Sluice; case "Steam"->FluidCatalog.Steam;default->null;}; if(field.equals("GenLiquid_Mercury")){ - if(!ReviewedOreGeneratedFluids.mercury(entry))return FluidStack.EMPTY; + if(!SourceGeneratedFluidAdapter.mercury(entry))return FluidStack.EMPTY; }else if(entry!=builtin||!FluidCatalog.isBuiltInDefinition(entry))return FluidStack.EMPTY; // Reviewed original material identities determine unit conversion; names alone do not establish it. - var binding=switch(field){case "GenLiquid_Mercury"->ReviewedOreFluidBindings.liquid(800,"Mercury"); + var binding=switch(field){case "GenLiquid_Mercury"->MaterialFluidUnitFacts.binding( + GTMaterialRegistry.get("Mercury"),"liquid"); default->null;}; boolean materialLiquid=field.equals("GenLiquid_Mercury"); - if(materialLiquid&&(binding==null||!binding.field().equals(field) - ||!binding.registryPath().equals(entry.registryName())))return FluidStack.EMPTY; + if(materialLiquid&&(binding==null||!binding.fluidField().equals(field) + ||!binding.registryName().equals(entry.registryName())))return FluidStack.EMPTY; var stack=lookup.apply(field,amount);if(stack==null||stack.isEmpty()||stack.getAmount()!=amount)return FluidStack.EMPTY; String expected="gt6ce:"+FluidCatalog.sanitizePath(entry.registryName()); if(!BuiltInRegistries.FLUID.getKey(stack.getFluid()).toString().equals(expected))return FluidStack.EMPTY; diff --git a/minecraft/src/main/java/gregtech/content/recipe/SharedPurifiedAcidRows.java b/minecraft/src/main/java/gregtech/content/recipe/SharedPurifiedAcidRows.java deleted file mode 100644 index fd8a75277..000000000 --- a/minecraft/src/main/java/gregtech/content/recipe/SharedPurifiedAcidRows.java +++ /dev/null @@ -1,245 +0,0 @@ -package gregtech.content.recipe; - -import gregtech.api.material.GTMaterial; -import gregtech.api.material.MaterialProperty; -import gregtech.content.data.FluidCatalog; -import gregtech.content.data.MachineRecipeMaps; -import gregtech.content.data.MaterialPrefix; -import gregtech.content.registry.GTFluids; -import gregtech.engine.addon.AddonMaterials; -import gregtech.engine.material.GTMaterialRegistry; -import gregtech.engine.recipe.Recipe; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.material.Fluids; -//? if >=1.21.1 { -/*import net.neoforged.neoforge.fluids.FluidStack; -*///?} else { -import net.minecraftforge.fluids.FluidStack; -//?} -import java.util.*; -import java.util.function.BiFunction; -import static gregtech.content.recipe.SharedOreWashingRows.NativeForm; -import static gregtech.content.recipe.SourceOreWashingRules.Availability; -import static gregtech.content.recipe.SourcePurifiedAcidData.*; -import static gregtech.content.recipe.SourcePurifiedAcidRules.*; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; -import static gregtech.content.recipe.SourceRecyclingFacts.Identity; - -/** Source Ores108-159 purified acid Bath calls, independent of ordinary ore washing gates. - * First admission is deliberately after existing static/imported producers. Ownership is only - * the object returned by ordinary addRecipe; no legacy signatures or unrelated rows are removed. - */ -public final class SharedPurifiedAcidRows { - private SharedPurifiedAcidRows() {} - private static final Set OWNED = Collections.newSetFromMap(new IdentityHashMap<>()); - private static final List DEFERRED = new ArrayList<>(); - private static final List ADMISSIONS = new ArrayList<>(); - private static List materials = List.of(); - private static boolean initialized; - - public record Deferred(String material, String producer, String reason) {} - public record Admission(String material, String producer, Shape shape, boolean accepted) {} - public static Set owned() { - var result = Collections.newSetFromMap(new IdentityHashMap()); - result.addAll(OWNED); return Collections.unmodifiableSet(result); - } - public static List deferred() { return List.copyOf(DEFERRED); } - public static List admissions() { return List.copyOf(ADMISSIONS); } - - /** Capture only the bounded source identity scope, not dynamic byproduct membership or forms. */ - public static void initialize() { - if (initialized) throw new IllegalStateException("Purified acid rows initialized twice"); - initialized = true; - Set seen = Collections.newSetFromMap(new IdentityHashMap<>()); - var selected = new ArrayList(); - for (var value : GTMaterialRegistry.allMaterials()) { - GTMaterial material = value.resolve(); - if (sourceIdentity(material) && seen.add(material)) selected.add(material); - } - selected.sort(Comparator.comparingInt(GTMaterial::getId)); - materials = List.copyOf(selected); - // No early rebuild: the existing ten imported acid calls and foreign producers retain - // their normal priority before the first overlay admits this new producer. - } - private static void clearOwned() { - OWNED.forEach(MachineRecipeMaps.Bath::unlink); OWNED.clear(); - } - /** Keep initialized identities for a subsequent server in the same JVM. */ - public static void clear() { clearOwned(); DEFERRED.clear(); ADMISSIONS.clear(); } - public static void rebuild() { - if (!initialized) return; - var snapshot = new Snapshot(); - var planned = definitions(materials, snapshot); - clearOwned(); DEFERRED.clear(); DEFERRED.addAll(snapshot.deferred); ADMISSIONS.clear(); - try { - for (var definition : planned) { - Recipe accepted = definition.admit(); - ADMISSIONS.add(new Admission(definition.material().name(), definition.producer(), - definition.shape(), accepted != null)); - if (accepted != null) OWNED.add(accepted); - } - } catch (RuntimeException | Error failure) { clear(); throw failure; } - } - - record Definition(Identity material, String producer, Shape shape, Result result, ItemStack input, - ItemStack[] outputs, FluidStack[] fluidInputs, FluidStack[] fluidOutputs) { - Recipe admit() { - // RecipeMap removes EMPTY fluids; unresolved source-positive phases must never reach it. - if (input.isEmpty() || fluidInputs.length != 1) return null; - for (var fluid : fluidInputs) if (fluid == null || fluid.isEmpty()) return null; - for (var fluid : fluidOutputs) if (fluid == null || fluid.isEmpty()) return null; - long[] chances = result.outputs().stream().mapToLong(Slot::chance).toArray(); - return MachineRecipeMaps.Bath.addRecipe(result.optimize(), new ItemStack[]{input.copy()}, - Arrays.stream(outputs).map(ItemStack::copy).toArray(ItemStack[]::new), null, chances, - Arrays.stream(fluidInputs).map(FluidStack::copy).toArray(FluidStack[]::new), - Arrays.stream(fluidOutputs).map(FluidStack::copy).toArray(FluidStack[]::new), - result.ticks(), result.power(), 0); - } - } - - static List definitions(Collection selected, Snapshot snapshot) { - var out = new ArrayList(); - var candidates = new ArrayList(); - Set seen = Collections.newSetFromMap(new IdentityHashMap<>()); - for (var material : selected) if (material != null && seen.add(material)) candidates.add(material); - // Literal family/member/shape order is significant; fixed families precede the dynamic loop. - for (var candidate : fixedCandidates()) for (var material : candidates) { - if (!candidate.material().matches(material.getId(), material.getName())) continue; - String producer = "fixed/" + candidate.family().sourceLine(); - if (!snapshot.context(material)) { - snapshot.note(material, producer, "unverified-source-material/" + candidate.shape()); continue; - } - var resolution = new Resolution(snapshot); - var result = fixedPlan(candidate.family(), candidate.material(), candidate.shape(), resolution); - add(material, producer, candidate.shape(), result, resolution, snapshot, out); - } - candidates.sort(Comparator.comparingInt(GTMaterial::getId)); - for (var material : candidates) { - Decision selector = snapshot.dynamicDecision(material); - if (selector == Decision.NO) continue; - for (var shape : Shape.values()) { - var resolution = new Resolution(snapshot); - var result = manganesePlan(identity(material), shape, selector, resolution); - add(material, "manganese", shape, result, resolution, snapshot, out); - } - } - return List.copyOf(out); - } - private static void add(GTMaterial material, String producer, Shape shape, Result result, - Resolution resolution, Snapshot snapshot, List out) { - if (result.status() != Status.ROW) { - if (result.status() == Status.UNSUPPORTED) - snapshot.note(material, producer, shape + ":" + result.reason() + resolution.problem); - return; - } - ItemStack[] outputs = result.outputs().stream().map(slot -> slot.item() == null - ? ItemStack.EMPTY : resolution.items.get(slot.item()).stack().copy()).toArray(ItemStack[]::new); - FluidStack[] inputs = result.fluidInputs().stream().map(fluid -> resolution.fluids.get(fluid).stack().copy()) - .toArray(FluidStack[]::new); - FluidStack[] fluids = result.fluidOutputs().stream().map(fluid -> resolution.fluids.get(fluid).stack().copy()) - .toArray(FluidStack[]::new); - out.add(new Definition(identity(material), producer, shape, result, - resolution.items.get(result.input()).stack().copy(), outputs, inputs, fluids)); - } - /** Cache exactly the objects proved during one plan; do not re-resolve an output after planning. */ - private static final class Resolution implements Resolver { - final Snapshot snapshot; - final Map items = new HashMap<>(); - final Map fluids = new HashMap<>(); - String problem = ""; - Resolution(Snapshot snapshot) { this.snapshot = snapshot; } - @Override public Availability item(MaterialPrefix prefix, Identity material, int count) { - var key = new SourcePurifiedAcidRules.Item(prefix, material, count); - var result = items.computeIfAbsent(key, ignored -> snapshot.item(prefix, material, count)); - if (result.availability() == Availability.UNKNOWN) problem = "/form:" + material.name() + "/" + prefix.getName(); - return result.availability(); - } - @Override public Availability fluid(Phase phase, long amount) { - var key = new SourcePurifiedAcidData.Fluid(phase, amount); - var result = fluids.computeIfAbsent(key, ignored -> snapshot.fluid(phase, amount)); - if (result.availability() == Availability.UNKNOWN) problem = "/phase:" + phase.nativeField(); - return result.availability(); - } - } - private static Identity identity(GTMaterial material) { return new Identity(material.getId(), material.getName()); } - private static boolean canonical(GTMaterial material) { - return material != null && material.isValid() && material.resolve() == material - && GTMaterialRegistry.get(material.getName()).resolve() == material - && GTMaterialRegistry.isCoreMaterial(material) && !AddonMaterials.owns(material); - } - private static boolean sourceIdentity(GTMaterial material) { - // This table supplies identity evidence only, never thermal target/flag permissions. - return canonical(material) && (SourceRecyclingFacts.find(material.getId(), material.getName()) != null - || reviewedIdentity(identity(material))); - } - record NativeFluid(Availability availability, FluidStack stack) { - static NativeFluid unknown() { return new NativeFluid(Availability.UNKNOWN, FluidStack.EMPTY); } - static NativeFluid present(FluidStack stack) { return new NativeFluid(Availability.PRESENT, stack.copy()); } - } - static class Snapshot { - final List deferred = new ArrayList<>(); - private final SharedOreWashingRows.Snapshot forms = new SharedOreWashingRows.Snapshot(); - private final Map fluidDefinitions; - private final BiFunction lookup; - Snapshot() { this(FluidCatalog.all(), GTFluids::stack); } - Snapshot(Map definitions, BiFunction lookup) { - this.fluidDefinitions = Map.copyOf(definitions); this.lookup = lookup; - } - void note(GTMaterial material, String producer, String reason) { - deferred.add(new Deferred(material.getName(), producer, reason)); - } - boolean context(GTMaterial material) { return sourceIdentity(material); } - boolean anti(GTMaterial material) { return material.has(MaterialProperty.ANTIMATTER); } - List directByproducts(GTMaterial material) { - var result = new ArrayList(); - for (var byproduct : material.getByProducts()) { - GTMaterial value = byproduct == null ? null : byproduct.resolve(); - result.add(sourceIdentity(value) ? identity(value) : null); - } - return Collections.unmodifiableList(result); - } - Decision dynamicDecision(GTMaterial material) { - if (!context(material)) return Decision.UNKNOWN; - if (anti(material)) return Decision.NO; - return manganeseSelector(material.isValid(), false, directManganeseMembership(directByproducts(material))); - } - NativeForm item(MaterialPrefix prefix, Identity identity, int count) { - GTMaterial material = material(identity); - if (material == null) return NativeForm.unknown(); - // Direct forms only: no ORES/generation gate, continuation policy, or OM main fallback. - return forms.direct(prefix, material, count); - } - GTMaterial material(Identity identity) { - if (identity == null) return null; - GTMaterial material = GTMaterialRegistry.get(identity.name()).resolve(); - return canonical(material) && identity.matches(material.getId(), material.getName()) ? material : null; - } - NativeFluid fluid(Phase phase, long amount) { - if (phase == null || amount <= 0 || amount > Integer.MAX_VALUE || material(phase.material()) == null) - return NativeFluid.unknown(); - // Water is vanilla water; it has no GT catalog entry. - if (phase == Phase.WATER) return NativeFluid.present(new FluidStack(Fluids.WATER, (int) amount)); - String field = phase.nativeField(); - var entry = fluidDefinitions.get(field); - if (entry == null || !FluidCatalog.canonicalField(field).equals(field) || FluidCatalog.get(field) != entry - || entry.gas() != (phase.state() == State.GAS)) return NativeFluid.unknown(); - if (phase == Phase.HYDROGEN) { - if (entry != FluidCatalog.Hydrogen || !FluidCatalog.isBuiltInDefinition(entry)) return NativeFluid.unknown(); - if (!phase.material().name().equals(FluidCatalog.boundMaterial(entry.registryName()))) - return NativeFluid.unknown(); - } else if (!FluidCatalog.isGeneratedGasLiquidDefinition(field, entry) - || !phase.material().name().equals(entry.materialKey())) return NativeFluid.unknown(); - String expectedPath = "gt6ce:" + FluidCatalog.sanitizePath(entry.registryName()); - if (!phase.registryId().equals(expectedPath)) return NativeFluid.unknown(); - var stack = lookup.apply(field, (int)amount); - if (stack == null || stack.isEmpty() || stack.getAmount() != amount - || !BuiltInRegistries.FLUID.getKey(stack.getFluid()).toString().equals(phase.registryId())) - return NativeFluid.unknown(); - if (GTFluids.entryForFluid(stack.getFluid()) != entry) return NativeFluid.unknown(); - // All eighteen source phases are positively evidenced. A missing native output holder - // is UNKNOWN too, never source ABSENT that could silently discard a vitriol/gas product. - return NativeFluid.present(stack); - } - } -} diff --git a/minecraft/src/main/java/gregtech/content/recipe/SharedPurifiedCentrifugeRows.java b/minecraft/src/main/java/gregtech/content/recipe/SharedPurifiedCentrifugeRows.java index 3741e9db4..d38046664 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SharedPurifiedCentrifugeRows.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SharedPurifiedCentrifugeRows.java @@ -6,6 +6,8 @@ import gregtech.engine.recipe.Recipe; import gregtech.engine.recipe.RecipeMap; import gregtech.content.data.*; +import gregtech.content.material.MaterialFactKeys; +import gregtech.content.material.catalog.MaterialFluidUnitFacts; import gregtech.content.registry.GTItems; import gregtech.content.registry.GTFluids; import gregtech.util.OM; @@ -157,21 +159,19 @@ private boolean defaultNoneCompatible(GTMaterial m,NoPhaseBinding source){ } } - // Source DATA only, not recipe/material admission: explicit fluids and default gas registrations - // cover the six ambient positive bindings in current539 input observations. Other phases defer. private record PhaseBinding(int id,String name,String phase,String field,String nativeId,int mb,int melting,int boiling){} - private static final List PHASES=List.of( - new PhaseBinding(21,"Helium3","gas","GenGas_Helium3","gt6ce:helium3",1000,1,4), - new PhaseBinding(90,"Fluorine","gas","GenGas_Fluorine","gt6ce:fluorine",1000,53,85), - new PhaseBinding(800,"Mercury","liquid","GenLiquid_Mercury","gt6ce:mercury",144,234,629), - new PhaseBinding(9791,"Honey","liquid","Honey","gt6ce:honey",1000,273,373), - new PhaseBinding(9793,"Honeydew","liquid","Honeydew","gt6ce:honeydew",1000,273,373), - new PhaseBinding(9802,"Ice","liquid","Ice","gt6ce:ice",1000,273,373)); - private static PhaseBinding binding(GTMaterial m,String phase){for(var b:PHASES)if(b.id==m.getId()&&b.name.equals(m.getName())&&(phase==null||b.phase.equals(phase)))return b;return null;} + private static PhaseBinding binding(GTMaterial m,String phase){ + var value=MaterialFactKeys.value(m,MaterialFactKeys.SOURCE_PURIFIED_CENTRIFUGE_PHASE).orElse(null); + if(value==null||(phase!=null&&!value.phase().equals(phase)))return null; + var unit=MaterialFluidUnitFacts.binding(m,value.phase()); + if(unit==null)return null; + return new PhaseBinding(m.getId(),m.getName(),value.phase(),unit.fluidField(), + "gt6ce:"+unit.registryName(),(int)unit.referenceMillibuckets(),value.meltingKelvin(),value.boilingKelvin()); + } private static boolean sourceBindingOwned(PhaseBinding binding){ var entry=FluidCatalog.get(binding.field); if(entry==null||!FluidCatalog.canonicalField(binding.field).equals(binding.field))return false; - if(binding.id==800)return ReviewedOreGeneratedFluids.mercury(entry); + if(binding.id==800)return SourceGeneratedFluidAdapter.mercury(entry); if(binding.id==21||binding.id==90)return FluidCatalog.isGeneratedGasLiquidDefinition(binding.field,entry) &&binding.name.equals(entry.materialKey())&&entry.gas() &&entry.registryName().equals(binding.nativeId.substring("gt6ce:".length())); @@ -196,16 +196,11 @@ static boolean sourceNoneMaterialCompatible(NoPhaseBinding source,SourceNoneFact return source.phase.equals("gas")?!facts.properties.contains(MaterialProperty.GAS) :!facts.properties.contains(MaterialProperty.LIQUID)&&!facts.properties.contains(MaterialProperty.MOLTEN); } - private static final List DEFAULT_NONE=List.of( - new NoPhaseBinding(1120,"Copernicium","liquid",150,357), - new NoPhaseBinding(1180,"Oganesson","gas",258,263), - - new NoPhaseBinding(9110,"Celestine","liquid",275,455), - new NoPhaseBinding(9199,"DuraniumHexafluoride","liquid",216,428), - new NoPhaseBinding(9801,"Snow","liquid",273,373), - new NoPhaseBinding(9851,"OilSand","liquid",100,400), - new NoPhaseBinding(9852,"CrudeOil","liquid",100,400)); - static NoPhaseBinding defaultNone(GTMaterial m){for(var d:DEFAULT_NONE)if(d.id==m.getId()&&d.name.equals(m.getName()))return d;return null;} + static NoPhaseBinding defaultNone(GTMaterial m){ + var value=MaterialFactKeys.value(m,MaterialFactKeys.SOURCE_PURIFIED_CENTRIFUGE_NO_DEFAULT).orElse(null); + return value==null?null:new NoPhaseBinding(m.getId(),m.getName(),value.phase(), + value.meltingKelvin(),value.boilingKelvin()); + } private static Definition legacy(GTMaterial m){ if(!m.isValid()||!MaterialPrefix.crushed.isValidFor(m)||!MaterialPrefix.crushedCentrifuged.isValidFor(m))return null; // Preserve old producer suppression decisions only in its unresolved compatibility branch. diff --git a/minecraft/src/main/java/gregtech/content/recipe/SharedSpecialProcessRows.java b/minecraft/src/main/java/gregtech/content/recipe/SharedSpecialProcessRows.java new file mode 100644 index 000000000..b1ee65fb2 --- /dev/null +++ b/minecraft/src/main/java/gregtech/content/recipe/SharedSpecialProcessRows.java @@ -0,0 +1,292 @@ +package gregtech.content.recipe; + +import static gregtech.content.recipe.SharedOreWashingRows.NativeForm; +import static gregtech.content.recipe.SourceOreWashingRules.Availability; + +import gregtech.api.addon.material.FormKey; +import gregtech.api.addon.material.MaterialFormKind; +import gregtech.api.addon.material.MaterialFormsView; +import gregtech.api.addon.material.MaterialKey; +import gregtech.api.addon.material.MaterialProcessKey; +import gregtech.api.addon.material.SpecialProcessMethod; +import gregtech.api.addon.material.SpecialProcessValue; +import gregtech.engine.material.GTMaterialRegistry; +import gregtech.engine.material.MaterialViews; +import gregtech.engine.prefix.PrefixRegistry; +import gregtech.engine.recipe.Recipe; +import gregtech.engine.recipe.RecipeMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.IdentityHashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.material.Fluids; +//? if >=1.21.1 { +/*import net.neoforged.neoforge.fluids.FluidStack; +*///?} else { +import net.minecraftforge.fluids.FluidStack; +//?} + +/** Generic producer for declarative special-process targets and reagents. */ +public final class SharedSpecialProcessRows { + private static final Set OWNED = Collections.newSetFromMap(new IdentityHashMap<>()); + private static boolean initialized; + + private SharedSpecialProcessRows() {} + + public static void initialize() { + initialized = true; + } + + public static void clear() { + OWNED.forEach(recipe -> RecipeMap.RECIPE_MAP_LIST.forEach(map -> { + map.unlink(recipe); + })); + OWNED.clear(); + } + + public static Set owned() { + var result = Collections.newSetFromMap(new IdentityHashMap()); + result.addAll(OWNED); + return Collections.unmodifiableSet(result); + } + + public static void rebuild() { + if (!initialized) return; + clear(); + var catalog = MaterialViews.catalog(); + var methods = methodRules(catalog); + var resolver = new Resolver(); + var omitted = new LinkedHashMap(); + for (var methodRules : methods) { + var method = methodRules.method(); + RecipeMap map = RecipeMap.RECIPE_MAP_LIST.stream() + .filter(candidate -> candidate.mNameInternal.equals(method.recipeMap())) + .findFirst() + .orElse(null); + if (map == null) { + com.mojang.logging.LogUtils.getLogger().warn( + "[gregtech] Skipping special process {} with unknown recipe map {}", + method.process().id(), method.recipeMap()); + continue; + } + if (methodRules.reagents().isEmpty()) continue; + for (var target : methodRules.targets()) { + for (var inputEntry : target.inputCounts().entrySet().stream() + .sorted(Map.Entry.comparingByKey(Comparator.comparing(FormKey::name))) + .toList()) { + for (var reagent : methodRules.reagents()) { + var built = build( + target.material(), inputEntry.getKey(), inputEntry.getValue(), target.plan(), + reagent, resolver); + if (built.recipe() == null) { + omitted.merge(built.reason(), 1, Integer::sum); + com.mojang.logging.LogUtils.getLogger().debug( + "[gregtech] Omitted special process {} for {}/{} with {}: {}", + method.process().id(), target.material().name(), inputEntry.getKey().name(), + reagent.material().name(), built.reason()); + continue; + } + Recipe accepted = map.addRecipe(built.recipe()); + if (accepted != null) { + OWNED.add(accepted); + } + } + } + } + } + if (!omitted.isEmpty()) + com.mojang.logging.LogUtils.getLogger() + .warn("[gregtech] Omitted special-process rows by unresolved requirement: {}", + omitted); + } + + record BuildResult(Recipe recipe, String reason) {} + + static BuildResult build( + MaterialKey target, + FormKey inputForm, + int inputCount, + SpecialProcessValue.Target plan, + ReagentSelector reagent, + Resolver resolver) { + ItemStack input = resolver.item(target, inputForm, inputCount); + if (input.isEmpty()) return new BuildResult(null, "input-form"); + var itemInputs = new ArrayList(); + itemInputs.add(input); + var fluidInputs = new ArrayList(); + if (!addReagent(reagent, plan.reagentAmount(), itemInputs, fluidInputs, resolver)) + return new BuildResult(null, "reagent"); + + var itemOutputs = new ArrayList(); + var chances = new ArrayList(); + for (var output : plan.itemOutputs()) { + ItemStack stack = firstItem(output, resolver); + if (stack.isEmpty()) return new BuildResult(null, "item-output"); + itemOutputs.add(stack); + chances.add((long) output.chance()); + } + var fluidOutputs = new ArrayList(); + for (var output : plan.fluidOutputs()) { + FluidStack stack = firstFluid(output, resolver); + if (stack.isEmpty()) return new BuildResult(null, "fluid-output"); + fluidOutputs.add(stack); + } + if (itemOutputs.isEmpty() && fluidOutputs.isEmpty()) return new BuildResult(null, "empty-outputs"); + return new BuildResult(new Recipe( + itemInputs.toArray(ItemStack[]::new), + itemOutputs.toArray(ItemStack[]::new), + null, + chances.stream().mapToLong(Long::longValue).toArray(), + fluidInputs.toArray(FluidStack[]::new), + fluidOutputs.toArray(FluidStack[]::new), + plan.duration(), + plan.euPerTick(), + 0), null); + } + + private static boolean addReagent( + ReagentSelector reagent, + long amount, + List itemInputs, + List fluidInputs, + Resolver resolver) { + var forms = reagent.forms().isEmpty() + ? resolver.bindings.find(reagent.material()).stream() + .map(binding -> binding.form()).collect(java.util.stream.Collectors.toSet()) + : reagent.forms(); + for (var form : forms.stream() + .sorted(Comparator.comparing(FormKey::name)) + .toList()) { + if (isFluid(form)) { + FluidStack fluid = resolver.fluid(reagent.material(), form, amount); + if (!fluid.isEmpty()) { + fluidInputs.add(fluid); + return true; + } + } else { + if (amount > Integer.MAX_VALUE) return false; + ItemStack stack = resolver.item(reagent.material(), form, Math.toIntExact(amount)); + if (!stack.isEmpty()) { + itemInputs.add(stack); + return true; + } + } + } + return false; + } + + private static ItemStack firstItem(SpecialProcessValue.ItemOutput output, Resolver resolver) { + for (var candidate : output.forms()) { + ItemStack stack = resolver.item(output.material(), candidate.form(), candidate.count()); + if (!stack.isEmpty()) return stack; + } + return ItemStack.EMPTY; + } + + private static FluidStack firstFluid(SpecialProcessValue.FluidOutput output, Resolver resolver) { + for (var candidate : output.forms()) { + if (!isFluid(candidate.form())) continue; + FluidStack stack = resolver.fluid(output.material(), candidate.form(), output.millibuckets()); + if (!stack.isEmpty()) return stack; + } + return FluidStack.EMPTY; + } + + private static boolean isFluid(FormKey form) { + return form.name().equals("liquid") || form.name().equals("gas") || form.name().equals("molten"); + } + + private record TargetSelector(MaterialKey material, Map inputCounts, SpecialProcessValue.Target plan) {} + + record ReagentSelector(MaterialKey material, Set forms) {} + + private record MethodRules( + SpecialProcessMethod method, List targets, List reagents) {} + + private static List methodRules(gregtech.api.addon.material.MaterialCatalogView catalog) { + var targets = new LinkedHashMap, List>(); + var reagents = new LinkedHashMap, List>(); + for (var material : catalog.materials()) { + for (var key : catalog.processes().keys(material.key())) { + for (var rule : catalog.processes().find(material.key(), key)) { + if (rule.value() instanceof SpecialProcessValue.Target plan) { + targets.computeIfAbsent(key, ignored -> new ArrayList<>()) + .add(new TargetSelector(material.key(), plan.inputCounts(), plan)); + } else if (rule.value() instanceof SpecialProcessValue.Reagent) { + reagents.computeIfAbsent(key, ignored -> new ArrayList<>()) + .add(new ReagentSelector(material.key(), rule.forms())); + } + } + } + } + return catalog.specialProcesses().methods().stream() + .map(method -> new MethodRules( + method, + List.copyOf(targets.getOrDefault(method.process(), List.of())), + List.copyOf(reagents.getOrDefault(method.process(), List.of())))) + .toList(); + } + + private record ItemKey(MaterialKey material, FormKey form, int count) {} + + private record FluidKey(MaterialKey material, FormKey form, long amount) {} + + static final class Resolver { + private final MaterialFormsView bindings; + + Resolver() { + this(MaterialViews.catalog().formBindings()); + } + + Resolver(MaterialFormsView bindings) { + this.bindings = bindings; + } + + private final SharedOreWashingRows.Snapshot forms = new SharedOreWashingRows.Snapshot(); + private final Map items = new HashMap<>(); + private final Map fluids = new HashMap<>(); + + private ItemStack item(MaterialKey materialKey, FormKey form, int count) { + var key = new ItemKey(materialKey, form, count); + return items.computeIfAbsent(key, ignored -> resolveItem(materialKey, form, count)).copy(); + } + + private FluidStack fluid(MaterialKey materialKey, FormKey form, long amount) { + var key = new FluidKey(materialKey, form, amount); + FluidStack value = fluids.computeIfAbsent(key, ignored -> resolveFluid(materialKey, form, amount)); + return value.copy(); + } + + private ItemStack resolveItem(MaterialKey materialKey, FormKey form, int count) { + if (isFluid(form) || count < 1) return ItemStack.EMPTY; + var material = GTMaterialRegistry.get(materialKey.name()).resolve(); + var prefix = PrefixRegistry.byName(form.name()); + if (material == null || !material.isValid() || prefix == null) return ItemStack.EMPTY; + NativeForm nativeForm = forms.direct(prefix, material, count); + return nativeForm.availability() == Availability.PRESENT ? nativeForm.stack().copy() : ItemStack.EMPTY; + } + + private FluidStack resolveFluid(MaterialKey materialKey, FormKey form, long amount) { + if (!isFluid(form) || amount < 1 || amount > Integer.MAX_VALUE) return FluidStack.EMPTY; + // Special-process quantities are already mB; material-unit conversion is unrelated. + for (var binding : bindings.find(materialKey, form).stream() + .filter(value -> value.kind() == MaterialFormKind.FLUID) + .sorted(Comparator.comparing(value -> value.id())) + .toList()) { + var id = ResourceLocation.tryParse(binding.id()); + if (id == null) continue; + var fluid = BuiltInRegistries.FLUID.get(id); + if (fluid != Fluids.EMPTY) return new FluidStack(fluid, (int) amount); + } + return FluidStack.EMPTY; + } + } +} diff --git a/minecraft/src/main/java/gregtech/content/recipe/SharedThermalRecyclingRows.java b/minecraft/src/main/java/gregtech/content/recipe/SharedThermalRecyclingRows.java index 7950410ed..8f664ec2e 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SharedThermalRecyclingRows.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SharedThermalRecyclingRows.java @@ -6,6 +6,8 @@ import gregtech.api.material.SmeltingMaterialHelper; import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; +import gregtech.content.material.catalog.SourceRecyclingMaterialFacts; import gregtech.content.registry.GTFluids; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.GTMaterialRegistry; @@ -36,7 +38,8 @@ import java.util.Map; import java.util.Set; -import static gregtech.content.recipe.SourceRecyclingFacts.*; +import static gregtech.content.material.MaterialFactKeys.Decision; +import static gregtech.content.material.catalog.SourceRecyclingMaterialFacts.*; /** * The general source {@code RecyclingProcessing} listener for every admitted recyclable item @@ -57,7 +60,8 @@ */ final class SharedThermalRecyclingRows { private static final Logger LOGGER = LogUtils.getLogger(); - private static final long SOURCE_UNIT = gregtech.content.recipe.OriginalMaterialFluidUnits.SOURCE_UNIT; + private static final long SOURCE_UNIT = + gregtech.content.material.catalog.MaterialFluidUnitFacts.SOURCE_UNIT; private static final Map> OWNED = new IdentityHashMap<>(); private static final List DEFERRED = new ArrayList<>(); private static boolean initialized; @@ -197,7 +201,7 @@ private static List candidates() { for (var entry : materialItems) { Item item = entry.getKey(); ItemComposition data = entry.getValue(); - if (data == null || !data.bulkRecoveryAllowed() || data.components().isEmpty()) continue; + if (data == null || data.components().isEmpty()) continue; MaterialPrefix prefix = data.prefix(); if (prefix != null && ownedByAuditedProducer(prefix, data)) continue; if (!allows(prefix)) continue; @@ -231,14 +235,14 @@ private static Outcome plan(Candidate candidate, SourceThermalNativeAdapter.Snap .map(component -> component.material().resolve()) .anyMatch(AddonMaterials::owns)) return planDeclared(candidate); var targetUnits = new java.util.LinkedHashMap(); - var factsByTarget = new java.util.LinkedHashMap(); + var factsByTarget = new java.util.LinkedHashMap(); double weight = 0; try { for (MaterialComponent component : candidate.components()) { GTMaterial material = component.material().resolve(); if (!valid(material)) return Outcome.deferred(Reason.UNKNOWN_SOURCE_IDENTITY); - var facts = find(material.getId(), material.getName()); - if (facts == null) return Outcome.deferred(Reason.UNKNOWN_SOURCE_FACT); + var facts = MaterialFactKeys.sourceRecycling(material).orElse(null); + if (facts == null || !facts.inputEligible()) return Outcome.deferred(Reason.UNKNOWN_SOURCE_FACT); if (snapshot.materialOverride(material, facts) != null) return Outcome.deferred(Reason.MATERIAL_OVERRIDE); weight += SourceRecyclingMath.materialWeight(material.getDensity(), component.amount(), SOURCE_UNIT); @@ -249,7 +253,7 @@ private static Outcome plan(Candidate candidate, SourceThermalNativeAdapter.Snap || facts.blacklistedSmelter() != Decision.NO || facts.targetUnitsPerU() < 0) return Outcome.deferred(Reason.UNKNOWN_SOURCE_FACT); GTMaterial target = GTMaterialRegistry.get(facts.target().name()).resolve(); - var resolvedTargetFacts = find(facts.target().id(), facts.target().name()); + var resolvedTargetFacts = MaterialFactKeys.sourceRecycling(target).orElse(null); if (!valid(target) || target.getId() != facts.target().id() || !target.getName().equals(facts.target().name()) || resolvedTargetFacts == null) return Outcome.deferred(Reason.TARGET_IDENTITY_OVERRIDE); @@ -277,7 +281,7 @@ private static Outcome plan(Candidate candidate, SourceThermalNativeAdapter.Snap var chosen = phases.get(0); int millibuckets; try { - millibuckets = gregtech.content.recipe.OriginalMaterialFluidUnits.millibuckets( + millibuckets = gregtech.content.material.catalog.MaterialFluidUnitFacts.millibuckets( chosen.targetUnits(), chosen.phase().binding().referenceMaterialUnits(), chosen.phase().binding().millibuckets(), false); } catch (ArithmeticException invalid) { @@ -351,7 +355,7 @@ private static Outcome planDeclared(Candidate candidate) { int millibuckets; long ticks; try { - millibuckets = gregtech.content.recipe.OriginalMaterialFluidUnits.millibuckets( + millibuckets = gregtech.content.material.catalog.MaterialFluidUnitFacts.millibuckets( chosen.getValue(), binding.referenceUnits(), binding.referenceMillibuckets(), @@ -386,8 +390,8 @@ private static Outcome planDeclared(Candidate candidate) { * BLACKLISTED_SMELTER flag. */ private static boolean declaredMeltable(GTMaterial material) { - var facts = find(material.getId(), material.getName()); - if (facts != null) + var facts = MaterialFactKeys.sourceRecycling(material).orElse(null); + if (facts != null && facts.inputEligible()) return facts.melting() == Decision.YES && facts.blacklistedSmelter() == Decision.NO; return AddonMaterials.owns(material); } @@ -396,14 +400,14 @@ private record PhaseCandidate( GTMaterial target, long targetUnits, ResolvedPhase phase, - SourceRecyclingFacts.Facts targetFacts) {} + SourceRecyclingMaterialFacts.Facts targetFacts) {} private record ResolvedPhase( - SourceRecyclingFacts.Binding binding, FluidStack fluid, int temperature, boolean lava) {} + SourceRecyclingMaterialFacts.Binding binding, FluidStack fluid, int temperature, boolean lava) {} /** Mirrors the audited adapter's phase proof; a target without a phase is skipped by the source. */ private static ResolvedPhase resolvePhase( - GTMaterial target, SourceRecyclingFacts.Facts facts, SourceThermalNativeAdapter.Snapshot snapshot) { + GTMaterial target, SourceRecyclingMaterialFacts.Facts facts, SourceThermalNativeAdapter.Snapshot snapshot) { Phase phase = facts.phase(); if (phase.kind() == PhaseKind.UNKNOWN || phase.kind() == PhaseKind.OPTIONAL_EXTERNAL) return null; if (phase.kind() == PhaseKind.NO_DEFAULT_PHASE) return null; diff --git a/minecraft/src/main/java/gregtech/content/recipe/SingleItemSourceRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/SingleItemSourceRecipes.java index 949321a7b..f8751ab0c 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SingleItemSourceRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SingleItemSourceRecipes.java @@ -31,8 +31,6 @@ public static int register() { if (!INSTANCE.entries().isEmpty()) throw new IllegalStateException("Single-item source recipes registered twice"); INSTANCE.compounds(); - ItemMaterialRegistry.register( - own("dry_bark", 1).getItem(), null, GTMaterialRegistry.get("Bark"), GTValues.U / 2); INSTANCE.animalParts(); INSTANCE.meat(); INSTANCE.remains(); @@ -43,8 +41,6 @@ private void compounds() { for (var row : OriginalSingleItemCatalog.COMPOUNDS) { var input = own(row.item(), 1); var material = GTMaterialRegistry.get(row.material()); - // MultiItemRandomTools: each compound contains 1/9 U and fires into one nugget. - ItemMaterialRegistry.register(input.getItem(), null, material, GTValues.U / 9); smelt(row.item(), mat(MaterialPrefix.nugget, row.material(), 1), false); var target = material.getTargetSmeltingMaterial(); var output = gregtech.util.OM.ingotOrDust(target, material.getTargetSmeltingAmount() / 9); @@ -93,9 +89,6 @@ private void animalParts() { } private void meat() { - // MultiItemFood and Loader_Recipes_Food preserve the 2U scrap-meat payload. - ItemMaterialRegistry.register( - own("scrap_meat", 1).getItem(), null, GTMaterialRegistry.get("MeatRaw"), 2 * GTValues.U); add( "scrap_meat/grind", MachineRecipeMaps.Mortar, @@ -118,8 +111,6 @@ private void meat() { for (String state : List.of("raw", "cooked")) { String material = state.equals("raw") ? "MeatRaw" : "MeatCooked"; String id = state + "_meat_bar"; - ItemMaterialRegistry.register( - own(id, 1).getItem(), MaterialPrefix.ingot, GTMaterialRegistry.get(material), GTValues.U); add( id + "/compress", MachineRecipeMaps.Compressor, diff --git a/minecraft/src/main/java/gregtech/content/recipe/ReviewedCinnabarFacts.java b/minecraft/src/main/java/gregtech/content/recipe/SourceCinnabarFollowonAdapter.java similarity index 65% rename from minecraft/src/main/java/gregtech/content/recipe/ReviewedCinnabarFacts.java rename to minecraft/src/main/java/gregtech/content/recipe/SourceCinnabarFollowonAdapter.java index eed574ea9..593d5adb4 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/ReviewedCinnabarFacts.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceCinnabarFollowonAdapter.java @@ -5,6 +5,7 @@ import gregtech.api.material.*; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTItems; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.*; @@ -19,33 +20,26 @@ * Source MT3709/w3803; Ores generic loop; Handlers145-150; reviewed oracle48fe504f. * No recipe is registered here; no list removal and no item/fluid ID changes. */ -public final class ReviewedCinnabarFacts implements SourceOreFollowonRows.Facts { - public static final ReviewedCinnabarFacts INSTANCE = new ReviewedCinnabarFacts(); +public final class SourceCinnabarFollowonAdapter implements SourceOreFollowonRows.Facts { + public static final SourceCinnabarFollowonAdapter INSTANCE = new SourceCinnabarFollowonAdapter(); - private ReviewedCinnabarFacts() {} + private SourceCinnabarFollowonAdapter() {} - private record Identity(int id, String name) {} - - private static final Identity CINNABAR = new Identity(9114, "Cinnabar"); - private static final Identity[] BYPRODUCTS = { - new Identity(8333, "Redstone"), - new Identity(160, "Sulfur"), - new Identity(8341, "Glowstone"), - new Identity(340, "Selenium") - }; - - private static boolean identity(GTMaterial m, Identity i) { + private static boolean identity(GTMaterial m, MaterialFactKeys.Identity i) { return m != null && m.isValid() && !AddonMaterials.owns(m) && GTMaterialRegistry.isCoreMaterial(m.resolve()) - && m.resolve().getId() == i.id - && m.resolve().getName().equals(i.name); + && m.resolve().getId() == i.id() + && m.resolve().getName().equals(i.name()); } - private static boolean hasExternalFormProfile() { + private static boolean hasExternalFormProfile(MaterialFactKeys.CinnabarFollowonRule rule) { // This bounded adapter is not an external unifier. Defer instead of manufacturing builtin replacements. - Set names = Set.of("Cinnabar", "Redstone", "Sulfur", "Glowstone", "Selenium", "SluiceSand"); + Set names = new HashSet<>(); + names.add(rule.cinnabar().name()); + rule.byproducts().forEach(value -> names.add(value.name())); + names.add(rule.sluiceSand().name()); if (AddonMaterials.acceptedForms().stream().anyMatch(f -> names.contains(f.materialName()))) return true; for (var item : gregtech.engine.material.ItemMaterialRegistry.entries().keySet()) { String ns = BuiltInRegistries.ITEM.getKey(item).getNamespace(); @@ -56,25 +50,37 @@ private static boolean hasExternalFormProfile() { return false; } + private static MaterialFactKeys.CinnabarFollowonRule cinnabarRule() { + var material = GTMaterialRegistry.get(9114); + if (!material.isValid() + || !material.getName().equals("Cinnabar") + || !GTMaterialRegistry.isCoreMaterial(material) + || AddonMaterials.owns(material)) return null; + return MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_CINNABAR_FOLLOWON) + .orElse(null); + } + public static boolean supports(GTMaterial m) { return INSTANCE.eligible(m) == YES; } @Override public SourceOreFollowonRows.Evidence eligible(GTMaterial m) { - if (!identity(m, CINNABAR) || hasExternalFormProfile()) return UNKNOWN; + var rule = cinnabarRule(); + if (rule == null || !identity(m, rule.cinnabar()) || hasExternalFormProfile(rule)) return UNKNOWN; m = m.resolve(); if (m.has(MaterialProperty.ANTIMATTER) || m.getToolQuality() != 0 || m.getOreMultiplier() != 1 || m.getOreProcessingMultiplier() != 1 - || !identity(m.getTargetCrushingMaterial(), CINNABAR) + || !identity(m.getTargetCrushingMaterial(), rule.cinnabar()) || m.getTargetCrushingAmount() != U - || !identity(m.getTargetPulverMaterial(), CINNABAR) + || !identity(m.getTargetPulverMaterial(), rule.cinnabar()) || m.getTargetPulverAmount() != U) return UNKNOWN; var by = m.getByProducts(); - if (by.size() != BYPRODUCTS.length) return UNKNOWN; - for (int i = 0; i < by.size(); i++) if (!identity(by.get(i), BYPRODUCTS[i])) return UNKNOWN; + if (by.size() != rule.byproducts().size()) return UNKNOWN; + for (int i = 0; i < by.size(); i++) + if (!identity(by.get(i), rule.byproducts().get(i))) return UNKNOWN; return YES; // proof is this source profile, not missing flags or current generated-form presence } @@ -90,10 +96,14 @@ public SourceOreFollowonRows.Evidence pulverizingCinnabar(GTMaterial m) { @Override public SourceOreFollowonRows.Environment environment(GTMaterial m, long units) { + var rule = cinnabarRule(); + if (rule == null || rule.byproducts().size() < 3) return new SourceOreFollowonRows.Environment(UNKNOWN, null); // Baseline source DEF_ENV_TEMP293 < melting500/388/500. Never infer from missing molten fluid. - int melt = identity(m, BYPRODUCTS[0]) + int melt = identity(m, rule.byproducts().get(0)) ? 500 - : identity(m, BYPRODUCTS[1]) ? 388 : identity(m, BYPRODUCTS[2]) ? 500 : -1; + : identity(m, rule.byproducts().get(1)) + ? 388 + : identity(m, rule.byproducts().get(2)) ? 500 : -1; if (melt < 0 || m.resolve().getMeltingPoint() != melt) return new SourceOreFollowonRows.Environment(UNKNOWN, null); return new SourceOreFollowonRows.Environment(YES, null); @@ -102,10 +112,12 @@ public SourceOreFollowonRows.Environment environment(GTMaterial m, long units) { @Override public ItemStack direct(MaterialPrefix p, GTMaterial m, int n) { if (m == null || n < 1) return ItemStack.EMPTY; + var rule = cinnabarRule(); + if (rule == null) return ItemStack.EMPTY; // Source-backed forms used by this bounded rule slice; allow no arbitrary legacy-only graded form. - boolean base = identity(m, CINNABAR); + boolean base = identity(m, rule.cinnabar()); boolean by = false; - for (var id : BYPRODUCTS) by |= identity(m, id); + for (var id : rule.byproducts()) by |= identity(m, id); boolean ore = p == MaterialPrefix.crushed || p == MaterialPrefix.crushedTiny || p == MaterialPrefix.crushedPurified @@ -117,7 +129,7 @@ public ItemStack direct(MaterialPrefix p, GTMaterial m, int n) { || p == MaterialPrefix.dustSmall || p == MaterialPrefix.dustDiv72; boolean grade = p == MaterialPrefix.gem || p == MaterialPrefix.gemFlawless || p == MaterialPrefix.gemExquisite; - boolean sand = identity(m, new Identity(8102, "SluiceSand")); + boolean sand = identity(m, rule.sluiceSand()); if (!((base && (ore || dust || grade || p == MaterialPrefix.oreRaw)) || (by && (ore || dust)) || (sand && dust))) return ItemStack.EMPTY; @@ -126,13 +138,10 @@ public ItemStack direct(MaterialPrefix p, GTMaterial m, int n) { @Override public ItemStack blockDust(GTMaterial m, int n) { - if (!identity(m, CINNABAR)) return ItemStack.EMPTY; + var rule = cinnabarRule(); + if (rule == null || !identity(m, rule.cinnabar())) return ItemStack.EMPTY; var block = BuiltInRegistries.BLOCK.get( ResourceLocation.parse("gt6ce:" + BlockMaterialPrefix.blockDust.getBlockId(m.resolve()))); return block == Blocks.AIR ? ItemStack.EMPTY : new ItemStack(block, n); } - - public static List sourceWaxes() { - return SourceWaxMaterials.materials(); - } } diff --git a/minecraft/src/main/java/gregtech/content/recipe/ReviewedCrushedFormGeneration.java b/minecraft/src/main/java/gregtech/content/recipe/SourceCrushedFormAdapter.java similarity index 69% rename from minecraft/src/main/java/gregtech/content/recipe/ReviewedCrushedFormGeneration.java rename to minecraft/src/main/java/gregtech/content/recipe/SourceCrushedFormAdapter.java index 964fd2573..5eec76cce 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/ReviewedCrushedFormGeneration.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceCrushedFormAdapter.java @@ -2,6 +2,7 @@ import gregtech.api.material.*; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTItems; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.*; @@ -12,36 +13,17 @@ * Recipe-local only: existing registry IDs and logical prefix validity remain unchanged. * This is NOT ORES-property evidence; oreRaw, rock and dust are never excluded here. */ -public final class ReviewedCrushedFormGeneration { - private ReviewedCrushedFormGeneration() {} +public final class SourceCrushedFormAdapter { + private SourceCrushedFormAdapter() {} public static boolean sourceExcluded(GTMaterial material, MaterialPrefix prefix) { - if (material == null || !excludedPrefix(prefix)) return false; + if (material == null || prefix == null) return false; material = material.resolve(); if (!material.isValid() || !GTMaterialRegistry.isCoreMaterial(material) || AddonMaterials.owns(material)) return false; - String expected = switch (material.getId()) { - case 2220 -> "Adamantium"; - case 260 -> "Iron"; - case 140 -> "Silicon"; - case 130 -> "Aluminium"; - case 220 -> "Titanium"; - case 740 -> "Tungsten"; - case 90 -> "Fluorine"; - case 730 -> "Tantalum"; - case 410 -> "Niobium"; - default -> null; - }; - return expected != null && expected.equals(material.getName()); - } - - public static boolean excludedPrefix(MaterialPrefix prefix) { - return prefix == MaterialPrefix.crushed - || prefix == MaterialPrefix.crushedTiny - || prefix == MaterialPrefix.crushedPurified - || prefix == MaterialPrefix.crushedPurifiedTiny - || prefix == MaterialPrefix.crushedCentrifuged - || prefix == MaterialPrefix.crushedCentrifugedTiny; + return MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_CRUSHED_EXCLUSIONS) + .map(rule -> rule.excludes(prefix.getName())) + .orElse(false); } /** Conservative builtin ownership check. External/accepted/changed metadata are UNKNOWN. @@ -66,7 +48,6 @@ public static boolean excludedBuiltin(GTMaterial material, MaterialPrefix prefix var explicit = ItemMaterialRegistry.base(canonical.getItem()).orElse(null); if (explicit != null && (explicit.prefix() != prefix - || !explicit.bulkRecoveryAllowed() || explicit.components().size() != 1 || explicit.material().resolve() != material || explicit.amount() != prefix.getMaterialWeight())) return false; diff --git a/minecraft/src/main/java/gregtech/content/recipe/ReviewedCinnabarThermalRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/SourceDustThermalRecipes.java similarity index 96% rename from minecraft/src/main/java/gregtech/content/recipe/ReviewedCinnabarThermalRecipes.java rename to minecraft/src/main/java/gregtech/content/recipe/SourceDustThermalRecipes.java index 3853e8bd4..1a6c67838 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/ReviewedCinnabarThermalRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceDustThermalRecipes.java @@ -18,8 +18,8 @@ //?} import static gregtech.api.material.GTValues.U; /** Bounded source thermal adapter for whole dust metal and reviewed Ti/Fe dust fractions. */ -public final class ReviewedCinnabarThermalRecipes { - private ReviewedCinnabarThermalRecipes(){} +public final class SourceDustThermalRecipes { + private SourceDustThermalRecipes(){} private record MetalFraction(MaterialPrefix prefix,long amount,int millibuckets,long titaniumTicks,long ironTicks){} private static final MetalFraction[] METAL_FRACTIONS={ new MetalFraction(MaterialPrefix.dustSmall,U/4,36,129,207), @@ -34,7 +34,7 @@ public static boolean emitIfSupported(GTMaterial material){ private static boolean emitWholeDustMetal(GTMaterial material){ if(material==null||!material.isValid())return false; material=material.resolve();String field="GenMolten_"+material.getName(); - if(!ReviewedOreGeneratedFluids.wholeDustMetal(material,RegisteredFluids.get(field)))return false; + if(!SourceGeneratedFluidAdapter.wholeDustMetal(material,RegisteredFluids.get(field)))return false; var input=GTItems.getStack(MaterialPrefix.dust,material,1); // Both native registrars install an explicit self/dust/U composition for every material item. // Exact equivalent compositions are harmless; changed/mixed/unrecoverable bindings still defer. diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceExtruderRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/SourceExtruderRecipes.java index af22330d2..317101406 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceExtruderRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceExtruderRecipes.java @@ -280,7 +280,8 @@ public static int register(GTMaterial material) { // no original eligibility or low-heat permission is fabricated for them. if (profile == null) { if (!material.has(MaterialProperty.SMITHABLE)) return 0; - profile = new SourceExtrusionRules.Profile(true, false, true, "", GTValues.U); + profile = new gregtech.content.material.catalog.SourceExtrusionMaterialFacts.Profile( + true, false, true, "", GTValues.U); } if (!profile.extrudable() || profile.forgingAmount() < GTValues.U) return 0; GTMaterial target = SourceExtrusionRules.target(material, profile); diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceFurnaceNativeAdapter.java b/minecraft/src/main/java/gregtech/content/recipe/SourceFurnaceNativeAdapter.java index 293662a0a..5fc9cd338 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceFurnaceNativeAdapter.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceFurnaceNativeAdapter.java @@ -8,6 +8,7 @@ import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; import gregtech.content.data.generated.MaterialWorkability; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTBlocks; import gregtech.engine.material.MaterialFormItem; import gregtech.engine.prefix.BlockMaterialPrefix; @@ -21,7 +22,7 @@ import java.util.Map; import java.util.Optional; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; +import static gregtech.content.material.MaterialFactKeys.Decision; /** The native block branch of Loader_OreProcessing, not the oreRaw form listener. * Source permissions govern only this producer; they grant no authority to delete cooking rows. @@ -51,9 +52,12 @@ static boolean earlyFormAllowed(MaterialPrefix prefix, GTMaterial material, Item if (material == null || !material.isValid() || input == null || input.isEmpty()) return false; if (nativeForm(prefix, material, input)) return OreSourcePolicy.furnaceInput(material) && !OreSourcePolicy.usesReviewedFurnaceListener(material); - var old = ReviewedOreSourceProfile.decision(material, ReviewedOreSourceProfile.Rule.FURNACE); - return old.orLegacy(material.has(MaterialProperty.MELTING)) - && !(old == ReviewedOreSourceProfile.Decision.YES && FurnaceSmeltingRules.legacyAllows(material)); + var decision = MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_FURNACE) + .orElse(MaterialFactKeys.Decision.UNKNOWN); + return (decision == Decision.UNKNOWN + ? material.has(MaterialProperty.MELTING) + : decision == Decision.YES) + && !(decision == Decision.YES && FurnaceSmeltingRules.legacyAllows(material)); } static boolean listenerAllows(MaterialPrefix prefix, GTMaterial material, ItemStack input) { diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceGemGradeResolver.java b/minecraft/src/main/java/gregtech/content/recipe/SourceGemGradeResolver.java index 49b040807..7fb0a1c04 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceGemGradeResolver.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceGemGradeResolver.java @@ -2,6 +2,7 @@ import gregtech.api.material.GTMaterial; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTItems; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.ItemMaterialRegistry; @@ -49,10 +50,13 @@ public static ItemStack gradeOrGem( external = stack; } if (!external.isEmpty()) return external; - var decision = ReviewedSiftingGemForms.decision(material, prefix); - if (decision == ReviewedOreSourceProfile.Decision.UNKNOWN) - decision = ReviewedOreSourceProfile.decision(material, ReviewedOreSourceProfile.Rule.GRADED_GEM); - if (decision != ReviewedOreSourceProfile.Decision.NO && !canonical.isEmpty()) return canonical; + var exclusions = MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_SIFTING_EXCLUSIONS) + .orElse(new MaterialFactKeys.PrefixExclusions(java.util.Set.of())); + var decision = exclusions.excludes(prefix.getName()) + ? MaterialFactKeys.Decision.NO + : MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_GRADED_GEM) + .orElse(MaterialFactKeys.Decision.UNKNOWN); + if (decision != MaterialFactKeys.Decision.NO && !canonical.isEmpty()) return canonical; return copyAmount(ordinaryGem, fallbackCount); } diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceGeneratedFluidAdapter.java b/minecraft/src/main/java/gregtech/content/recipe/SourceGeneratedFluidAdapter.java new file mode 100644 index 000000000..b612b9187 --- /dev/null +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceGeneratedFluidAdapter.java @@ -0,0 +1,63 @@ +package gregtech.content.recipe; + +import gregtech.api.material.GTMaterial; +import gregtech.api.material.MaterialProperty; +import gregtech.content.data.FluidCatalog; +import gregtech.content.material.MaterialFactKeys; +import gregtech.engine.addon.AddonMaterials; +import gregtech.engine.material.GTMaterialRegistry; + +/** Native fingerprint checks for generated fluids declared by material facts. */ +public final class SourceGeneratedFluidAdapter { + private SourceGeneratedFluidAdapter() {} + + public static boolean mercury(FluidCatalog.FluidEntry entry) { + return checked(GTMaterialRegistry.get("Mercury"), entry, false); + } + + public static boolean wholeDustMetal(GTMaterial material, FluidCatalog.FluidEntry entry) { + return checked(material, entry, true); + } + + private static boolean checked(GTMaterial material, FluidCatalog.FluidEntry entry, boolean wholeDust) { + if (material == null || !material.isValid() || entry == null) return false; + material = material.resolve(); + if (!GTMaterialRegistry.isCoreMaterial(material) || AddonMaterials.owns(material)) return false; + var rule = MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_GENERATED_FLUID) + .flatMap(rules -> rules.rules().stream() + .filter(value -> value.wholeDustMetal() == wholeDust) + .findFirst()) + .orElse(null); + if (rule == null + || !FluidCatalog.canonicalField(rule.field()).equals(rule.field()) + || !entry.registryName().equals(rule.registryPath()) + || !material.getName().equals(entry.materialKey()) + || entry.temperature() != rule.temperature() + || entry.density() != 0 + || entry.glint() + || entry.gas()) return false; + if (wholeDust) { + var target = material.getTargetSmeltingMaterial(); + if (target == null + || target.resolve() != material + || material.getTargetSmeltingAmount() != gregtech.api.material.GTValues.U + || material.getMeltingPoint() != rule.temperature() + || material.getDensity() != rule.materialDensity() + || !material.has(MaterialProperty.MELTING) + || material.has(MaterialProperty.ANTIMATTER) + || !FluidCatalog.isGeneratedMoltenDefinition(rule.field(), entry) + || entry.textureMode() != FluidCatalog.FluidTextureMode.GENERIC_MOLTEN + || !entry.tintTexture() + || entry.viscosity() != 0 + || entry.luminosity() != 10 + || entry.flags() != FluidCatalog.FluidFlags.LIQUID) return false; + } else if (!FluidCatalog.isGeneratedGasLiquidDefinition(rule.field(), entry) + || entry.textureMode() != FluidCatalog.FluidTextureMode.DEDICATED + || entry.tintArgb() != 0 + || !entry.tintTexture() + || entry.viscosity() != 0 + || entry.luminosity() != 0 + || entry.flags() != FluidCatalog.FluidFlags.LIQUID) return false; + return true; + } +} diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceLensRecipeItems.java b/minecraft/src/main/java/gregtech/content/recipe/SourceLensRecipeItems.java new file mode 100644 index 000000000..b5cc6db12 --- /dev/null +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceLensRecipeItems.java @@ -0,0 +1,22 @@ +package gregtech.content.recipe; + +import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.catalog.SourceLensMaterialFacts.Color; +import gregtech.content.registry.GTItems; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.world.item.ItemStack; + +/** Native lens holders selected from material-owned lens roles. */ +public final class SourceLensRecipeItems { + private SourceLensRecipeItems() {} + + public static List lenses(Color color) { + var result = new ArrayList(); + for (var material : SourceLensRoles.materials(color)) { + var lens = GTItems.getStack(MaterialPrefix.lens, material, 1); + if (!lens.isEmpty()) result.add(lens); + } + return List.copyOf(result); + } +} diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceOreCrushingAdapter.java b/minecraft/src/main/java/gregtech/content/recipe/SourceOreCrushingAdapter.java index 4588ec760..2564382b0 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceOreCrushingAdapter.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceOreCrushingAdapter.java @@ -3,7 +3,9 @@ import gregtech.api.material.GTMaterial; import gregtech.api.material.MaterialProperty; import gregtech.content.block.*; +import gregtech.content.block.stone.OreHostFacts; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTBlocks; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.GTMaterialRegistry; @@ -31,8 +33,8 @@ import static gregtech.content.recipe.SharedOreWashingRows.NativeForm; import static gregtech.content.recipe.SourceOreWashingRules.Availability; import static gregtech.content.recipe.SourceOreCrushingRules.*; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; -import static gregtech.content.recipe.SourceRecyclingFacts.Identity; +import static gregtech.content.material.MaterialFactKeys.Decision; +import static gregtech.content.material.MaterialFactKeys.Identity; /** Native ownership and host decoding for the source ore handlers, not a global ore unifier. */ final class SourceOreCrushingAdapter { @@ -100,12 +102,12 @@ static Outcome definitions(Candidate candidate, Machine machine, Snapshot s) { // example); one row with a host-set predicate covers all of them, as the source does. var hostsByProfile = new LinkedHashMap>(); for (OreHostStone host : OreHostStone.values()) { - if (SourceOreCrushingFacts.hostDecision(host.id()) != Decision.YES) continue; - var profile = SourceOreCrushingFacts.hostProfile(host.id()); + if (OreHostFacts.hostDecision(host.id()) != Decision.YES) continue; + var profile = OreHostFacts.hostProfile(host.id()); hostsByProfile.computeIfAbsent(profile.sourcePrefix(), ignored -> new ArrayList<>()).add(host); } for (var hosts : hostsByProfile.values()) { - var profile = SourceOreCrushingFacts.hostProfile(hosts.get(0).id()); + var profile = OreHostFacts.hostProfile(hosts.get(0).id()); var gangue = s.gangueList(profile); if (gangue == null) return none(Action.LEGACY_UNSUPPORTED, "gangue-provenance:" + hosts.get(0).id()); @@ -123,7 +125,7 @@ static Outcome definitions(Candidate candidate, Machine machine, Snapshot s) { }; Recipe row = make(machine, representative, result, matches, s); if (row == null) return none(Action.DEFERRED_NO_ROW, "native-normalization"); - if (SourceOreCrushingFacts.hasBrokenSourcePair(hosts.get(0).id())) { + if (OreHostFacts.hasBrokenSourcePair(hosts.get(0).id())) { var alternatives = new ArrayList(); for (OreHostStone host : hosts) { alternatives.add(OreBlock.withStone(candidate.input(), block.stateFor(host))); @@ -143,7 +145,7 @@ static Outcome definitions(Candidate candidate, Machine machine, Snapshot s) { if (candidate.kind() == NativeKind.FIXED_STONE) { String host = s.vanillaHost(candidate.input()); if (!"none".equals(host)) { - var profile = SourceOreCrushingFacts.hostProfile(host); + var profile = OreHostFacts.hostProfile(host); Gangue fixed = profile == null ? null : s.gangue(profile); if (fixed == null) return none(Action.LEGACY_UNSUPPORTED, "stone-gangue-provenance"); gangue.add(fixed); @@ -214,10 +216,10 @@ private static ItemStack[] copies(ItemStack[] stacks) { /** Strict evidence reader, intentionally not OreHostStone.byId's unknown-to-STONE convenience. */ static HostSelection classifyHost(ItemStack stack) { HostData data = hostData(stack); - Decision host = SourceOreCrushingFacts.hostDecision(data.host()); + Decision host = OreHostFacts.hostDecision(data.host()); if (host == Decision.NO) return new HostSelection(Domain.SOURCE_NO, data.host(), data.broken()); if (!data.knownMode() || host == Decision.UNKNOWN - || data.broken() && !SourceOreCrushingFacts.hasBrokenSourcePair(data.host())) + || data.broken() && !OreHostFacts.hasBrokenSourcePair(data.host())) return new HostSelection(Domain.UNKNOWN_HOST, data.host(), data.broken()); return new HostSelection(Domain.SOURCE_PROFILE, data.host(), data.broken()); } @@ -260,7 +262,7 @@ private record FormKey(Form form, GTMaterial material) {} @Override boolean identity(GTMaterial material) { return material != null && material.isValid() && material.resolve() == material && GTMaterialRegistry.isCoreMaterial(material) && !AddonMaterials.owns(material) - && SourceOreCrushingFacts.pulverizingCinnabar(material.getId(), material.getName()) != Decision.UNKNOWN; + && MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_ORE_CRUSHING).isPresent(); } boolean context(GTMaterial material) { // OilSand's Centrifuge event does not disable these independent source handlers. @@ -314,7 +316,7 @@ private static boolean special(net.minecraft.world.level.block.Block block) { } private static boolean composition(ItemStack input, MaterialPrefix prefix, GTMaterial material, long amount, boolean optional) { var data = ItemMaterialRegistry.base(input.getItem()).orElse(null); - return data == null ? optional : data.bulkRecoveryAllowed() && data.prefix() == prefix && data.components().size() == 1 + return data == null ? optional : data.prefix() == prefix && data.components().size() == 1 && data.material().resolve() == material && data.amount() == amount; } @Override GTMaterial target(GTMaterial material) { @@ -325,22 +327,22 @@ private static boolean composition(ItemStack input, MaterialPrefix prefix, GTMat int processingMultiplier(GTMaterial material) { return material.getOreProcessingMultiplier(); } Input input(GTMaterial material, GTMaterial target) { return new Input(id(material), id(target), amount(material), oreMultiplier(material), processingMultiplier(material), - quality(material), new Bonus(SourceOreCrushingFacts.pulverizingCinnabar(material.getId(), material.getName()), + quality(material), new Bonus(crushing(material).pulverizing(), byproduct(material, 800, "Mercury"), byproduct(material, 9114, "Cinnabar"), byproduct(material, 8333, "Redstone")), - SourceOreCrushingFacts.hexorium(material.getId(), material.getName())); + crushing(material).hexorium()); } private boolean byproduct(GTMaterial material, int id, String name) { return material.getByProducts().stream().map(GTMaterial::resolve) .anyMatch(m -> identity(m) && m.getId() == id && m.getName().equals(name)); } /** Null is an unresolved gangue identity; an empty list is a source host without gangue. */ - List gangueList(SourceOreCrushingFacts.HostProfile profile) { + List gangueList(OreHostFacts.HostProfile profile) { if (!profile.hasGangue()) return List.of(); Gangue gangue = gangue(profile); return gangue == null ? null : List.of(gangue); } - Gangue gangue(SourceOreCrushingFacts.HostProfile profile) { + Gangue gangue(OreHostFacts.HostProfile profile) { GTMaterial material = profile.gangueMaterial() == null ? null : material(profile.gangueMaterial()); GTMaterial target = material == null ? null : target(material); return !identity(material) || !identity(target) ? null @@ -352,6 +354,9 @@ GTMaterial material(Identity identity) { && identity(material) ? material : null; } Availability available(Form form, Identity material, int count) { return resolve(form, material).availability(); } + private MaterialFactKeys.OreCrushingFact crushing(GTMaterial material) { + return MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_ORE_CRUSHING).orElseThrow(); + } ItemStack stack(Stack stack) { NativeForm resolved = resolve(stack.form(), stack.material()); if (resolved.availability() != Availability.PRESENT) return ItemStack.EMPTY; diff --git a/minecraft/src/main/java/gregtech/content/recipe/ReviewedOreShredderFacts.java b/minecraft/src/main/java/gregtech/content/recipe/SourceOreFollowonAdapter.java similarity index 77% rename from minecraft/src/main/java/gregtech/content/recipe/ReviewedOreShredderFacts.java rename to minecraft/src/main/java/gregtech/content/recipe/SourceOreFollowonAdapter.java index 060f53cb3..f8af0eb3d 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/ReviewedOreShredderFacts.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceOreFollowonAdapter.java @@ -5,6 +5,7 @@ import gregtech.api.material.*; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTItems; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.*; @@ -16,25 +17,11 @@ * The roster is independently reviewed; Centrifuge byproducts and ambient phases do not own these rows. * No claims for foreign/unknown forms, non-self targets, other input families or other machines. */ -public final class ReviewedOreShredderFacts implements SourceOreFollowonRows.Facts { - public static final ReviewedOreShredderFacts INSTANCE = new ReviewedOreShredderFacts(); - - private ReviewedOreShredderFacts() {} - - private record Profile(int id, String name, int quality, boolean mortar) {} - - private static final List PROFILES = List.of( - new Profile(290, "Copper", 0, true), - new Profile(9117, "Galena", 0, true), - new Profile(8346, "NetherQuartz", 3, true), - new Profile(9111, "Chalcopyrite", 0, true), - new Profile(9145, "Pentlandite", 0, true), - new Profile(9130, "Sphalerite", 0, true), - new Profile(9132, "Tetrahedrite", 0, true), - new Profile(9125, "Pyrite", 0, true), - new Profile(280, "Nickel", 2, true), - new Profile(9116, "Cooperite", 0, true), - new Profile(9137, "YellowLimonite", 0, true)); +public final class SourceOreFollowonAdapter implements SourceOreFollowonRows.Facts { + public static final SourceOreFollowonAdapter INSTANCE = new SourceOreFollowonAdapter(); + + private SourceOreFollowonAdapter() {} + private static final List INPUTS = List.of( MaterialPrefix.crushed, MaterialPrefix.crushedPurified, @@ -45,12 +32,11 @@ private record Profile(int id, String name, int quality, boolean mortar) {} private static final List OUTPUTS = List.of(MaterialPrefix.dust, MaterialPrefix.dustSmall, MaterialPrefix.dustTiny, MaterialPrefix.dustDiv72); - private static Profile profile(GTMaterial material) { + private static MaterialFactKeys.OreShredderProfile profile(GTMaterial material) { if (material == null || !material.isValid()) return null; var m = material.resolve(); if (!GTMaterialRegistry.isCoreMaterial(m) || AddonMaterials.owns(m)) return null; - for (var row : PROFILES) if (m.getId() == row.id() && m.getName().equals(row.name())) return row; - return null; + return MaterialFactKeys.value(m, MaterialFactKeys.SOURCE_ORE_SHREDDER).orElse(null); } private static boolean usedPrefix(String prefix) { @@ -58,15 +44,15 @@ private static boolean usedPrefix(String prefix) { || OUTPUTS.stream().anyMatch(p -> p.getName().equals(prefix)); } - private static boolean externalForms(Profile row) { + private static boolean externalForms(GTMaterial material) { if (AddonMaterials.acceptedForms().stream() - .anyMatch(f -> f.materialName().equals(row.name()) && usedPrefix(f.prefixName()))) return true; + .anyMatch(f -> f.materialName().equals(material.getName()) && usedPrefix(f.prefixName()))) return true; for (var item : ItemMaterialRegistry.entries().keySet()) { String namespace = BuiltInRegistries.ITEM.getKey(item).getNamespace(); if (namespace.equals("gt6ce") || namespace.equals("minecraft")) continue; var form = MaterialEquivalence.form(new ItemStack(item)); if (form != null - && form.material().resolve().getName().equals(row.name()) + && form.material().resolve().getName().equals(material.getName()) && usedPrefix(form.prefix().getName())) return true; } return false; @@ -98,7 +84,7 @@ public SourceOreFollowonRows.Evidence eligible(GTMaterial material) { || m.getToolQuality() != row.quality() || m.getTargetPulverMaterial().resolve() != m || m.getTargetPulverAmount() != U - || externalForms(row)) return UNKNOWN; + || externalForms(m)) return UNKNOWN; // MORTAR/ORES are positive source facts, not inferred from port item existence. for (var prefix : INPUTS) if (nativeForm(prefix, m, 1).isEmpty()) return UNKNOWN; for (var prefix : OUTPUTS) if (nativeForm(prefix, m, 1).isEmpty()) return UNKNOWN; diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceOreInputForms.java b/minecraft/src/main/java/gregtech/content/recipe/SourceOreInputForms.java index 5eff68953..1864bb8d7 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceOreInputForms.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceOreInputForms.java @@ -79,7 +79,7 @@ public static ItemStack reviewedOreOutput(MaterialPrefix prefix, GTMaterial mate material = material.resolve(); ItemStack canonical = gregtech.content.registry.GTItems.getStack(prefix, material, count); boolean excluded = SourceOreOutputRows.resolving() - && ReviewedCrushedFormGeneration.excludedBuiltin(material, prefix, canonical); + && SourceCrushedFormAdapter.excludedBuiltin(material, prefix, canonical); Evidence evidence = (material.getId() == 8500 && material.getName().equals("Stone")) || excluded ? Evidence.NO : Evidence.UNKNOWN; diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceOreMacerationAdapter.java b/minecraft/src/main/java/gregtech/content/recipe/SourceOreMacerationAdapter.java index f9f6d6a0a..a9a17a245 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceOreMacerationAdapter.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceOreMacerationAdapter.java @@ -1,13 +1,14 @@ package gregtech.content.recipe; +import static gregtech.content.material.MaterialFactKeys.Decision; import static gregtech.content.recipe.SharedOreWashingRows.NativeForm; import static gregtech.content.recipe.SourceOreWashingRules.Availability; -import static gregtech.content.recipe.SourceRecyclingFacts.Decision; import gregtech.api.material.GTMaterial; import gregtech.api.material.MaterialProperty; import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; import gregtech.content.registry.GTItems; import gregtech.engine.addon.AddonMaterials; import gregtech.engine.material.GTMaterialRegistry; @@ -133,7 +134,6 @@ static class Snapshot { for (var part : data.components()) { GTMaterial material = part.material().resolve(); if (!namespace.equals("gt6ce") - || !data.bulkRecoveryAllowed() || data.components().size() != 1 || data.amount() != data.prefix().getMaterialWeight() || !SourceFurnaceNativeAdapter.nativeForm( @@ -158,16 +158,19 @@ boolean identity(GTMaterial material) { var resolved = material.resolve(); return GTMaterialRegistry.isCoreMaterial(resolved) && !AddonMaterials.owns(resolved) - && SourceRecyclingFacts.find(resolved.getId(), resolved.getName()) != null; + && MaterialFactKeys.sourceRecycling(resolved).isPresent(); } boolean legacyContinuation(GTMaterial material) { // Preserve all existing dormant/startup/late-activation choices, not just today's inactive subset. - return ReviewedOreInputProfile.decision(material) == ReviewedOreInputProfile.Evidence.NO; + return MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_ORE_INPUT) + .orElse(MaterialFactKeys.Decision.UNKNOWN) + == MaterialFactKeys.Decision.NO; } Decision mortar(GTMaterial material) { - return SourceOreMacerationFacts.mortar(material.getId(), material.getName()); + return MaterialFactKeys.value(material, MaterialFactKeys.SOURCE_MACERATION) + .orElse(MaterialFactKeys.Decision.UNKNOWN); } GTMaterial target(GTMaterial material) { @@ -190,7 +193,6 @@ NativeForm direct(MaterialPrefix prefix, GTMaterial material) { if (!SourceFurnaceNativeAdapter.nativeForm(prefix, material, selected)) return NativeForm.unknown(); var data = ItemMaterialRegistry.base(selected.getItem()).orElse(null); if (data == null - || !data.bulkRecoveryAllowed() || data.prefix() != prefix || data.components().size() != 1 || data.material().resolve() != material.resolve() diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceOreOutputRows.java b/minecraft/src/main/java/gregtech/content/recipe/SourceOreOutputRows.java index b8549458c..633afd611 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceOreOutputRows.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceOreOutputRows.java @@ -23,7 +23,7 @@ private record Key(GTMaterial material, String producer, RecipeMap map) {} public static boolean affects(List materials) { return materials.stream() .anyMatch(material -> - ReviewedCrushedFormGeneration.sourceExcluded(material, MaterialPrefix.crushedPurifiedTiny)); + SourceCrushedFormAdapter.sourceExcluded(material, MaterialPrefix.crushedPurifiedTiny)); } public static void define(GTMaterial material, String producer, RecipeMap map, Supplier admission) { diff --git a/minecraft/src/main/java/gregtech/content/recipe/SourceThermalNativeAdapter.java b/minecraft/src/main/java/gregtech/content/recipe/SourceThermalNativeAdapter.java index cb8c6f275..9ee58ac10 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/SourceThermalNativeAdapter.java +++ b/minecraft/src/main/java/gregtech/content/recipe/SourceThermalNativeAdapter.java @@ -5,6 +5,8 @@ import gregtech.content.data.FluidCatalog; import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialFactKeys; +import gregtech.content.material.catalog.MaterialFluidUnitFacts; import gregtech.content.item.MaterialItem; import gregtech.content.registry.GTItems; import gregtech.content.registry.GTFluids; @@ -26,7 +28,9 @@ import java.util.*; import java.util.function.BiFunction; import static gregtech.api.material.GTValues.U; -import static gregtech.content.recipe.SourceRecyclingFacts.*; +import static gregtech.content.material.MaterialFactKeys.Decision; +import static gregtech.content.material.MaterialFactKeys.Identity; +import static gregtech.content.material.catalog.SourceRecyclingMaterialFacts.*; /** Shared source thermal proof for the existing OM-selected1U input and audited exact form inputs. * No registrations, material mutations, map sweeps or new global unit conventions. @@ -82,9 +86,9 @@ static Outcome inspectForm(MaterialPrefix prefix,GTMaterial raw,ItemStack select private static Outcome inspect(GTMaterial raw,ItemStack selected,Snapshot snapshot,MaterialPrefix prefix){ if(raw==null)return unsupported(Reason.UNKNOWN_SOURCE_IDENTITY); if(selected==null||selected.isEmpty())return deferred(Reason.INPUT_ABSENT); - GTMaterial material=raw.resolve();Facts source=find(material.getId(),material.getName()); + GTMaterial material=raw.resolve();Facts source=MaterialFactKeys.sourceRecycling(material).orElse(null); if(!identity(material,source==null?null:source.identity()))return unsupported(Reason.UNKNOWN_SOURCE_IDENTITY); - if(source.portDefaults()==null)return unsupported(Reason.UNKNOWN_SOURCE_FACT); // Output-only Water/Lava. + if(!source.inputEligible())return unsupported(Reason.UNKNOWN_SOURCE_FACT); Reason changed=snapshot.materialOverride(material,source); if(changed!=null)return unsupported(changed); long inputUnits=U; @@ -102,7 +106,7 @@ private static Outcome inspect(GTMaterial raw,ItemStack selected,Snapshot snapsh if(source.melting()!=Decision.YES||source.blacklistedSmelter()!=Decision.NO||source.targetUnitsPerU()<0) return unsupported(Reason.UNKNOWN_SOURCE_FACT); GTMaterial target=GTMaterialRegistry.get(source.target().name()); - Facts targetSource=find(source.target().id(),source.target().name()); + Facts targetSource=MaterialFactKeys.sourceRecycling(target).orElse(null); if(!identity(target,source.target())||targetSource==null)return unsupported(Reason.UNKNOWN_SOURCE_IDENTITY); changed=snapshot.materialOverride(target,targetSource); if(changed!=null)return unsupported(changed); @@ -153,40 +157,14 @@ private static boolean identity(GTMaterial m,Identity source){ &>MaterialRegistry.isCoreMaterial(m)&&!AddonMaterials.owns(m)&&!m.has(MaterialProperty.ANTIMATTER); } record NativeBinding(String field,String registry,FluidCatalog.FluidEntry declaration,boolean finalized) {} - private static NativeBinding declared(String field,String registry,FluidCatalog.FluidEntry declaration){ - return new NativeBinding(field,registry,declaration,false); - } - private static NativeBinding finalized(String name,FluidCatalog.FluidEntry declaration){ - return new NativeBinding("GenMolten_"+name,"molten."+name.toLowerCase(Locale.ROOT),declaration,true); - } /** Explicit native spellings are bindings, not newly registered aliases or material-name guesses. */ static NativeBinding nativeBinding(GTMaterial target,Binding source){ - NativeBinding special=switch(target.getId()){ - - case 8001->declared("Glass","glass",FluidCatalog.Glass); - case 8211->declared("Blaze","blaze",FluidCatalog.Blaze); - - case 8218->declared("Plastic","molten.plastic",FluidCatalog.Plastic); - - case 8318->declared("Ender","molten.enderpearl",FluidCatalog.Ender); - case 8333->declared("Redstone","molten.redstone",FluidCatalog.Redstone); - - - case 9810->declared("Lava","lava",FluidCatalog.Lava); - case 9883->declared("CFoam","ic2constructionfoam",FluidCatalog.CFoam); - case 8217->finalized("Rubber",FluidCatalog.Molten_Rubber); - case 8235->finalized("Wax",FluidCatalog.Molten_Wax); - case 8236->finalized("WaxBee",FluidCatalog.Molten_WaxBee); - case 8238->finalized("WaxParaffin",FluidCatalog.Molten_WaxParaffin); - case 8239->finalized("WaxPlant",FluidCatalog.Molten_WaxPlant); - case 9703->finalized("Sugar",FluidCatalog.Molten_Sugar); - case 9780->finalized("Cheese",FluidCatalog.Molten_Cheese); - case 9783->finalized("Chocolate",FluidCatalog.Molten_Chocolate); - // These original molten salts retain their established port liquid IDs, with source144/U. - case 8009,8010,8029,8033->new NativeBinding("GenLiquid_"+target.getName(),target.getName().toLowerCase(Locale.ROOT),null,false); - default->null; - }; - if(special!=null)return special; + var exact=MaterialFluidUnitFacts.binding(target,source.accessor().name().toLowerCase(Locale.ROOT)); + if(exact!=null){ + var declaration=FluidCatalog.all().get(exact.fluidField()); + return new NativeBinding(exact.fluidField(),exact.registryName(),declaration, + exact.fluidField().startsWith("GenMolten_")); + } String lower=target.getName().toLowerCase(Locale.ROOT),path=source.sourceRegistryPath(); if(path.equals("molten."+lower))return new NativeBinding("GenMolten_"+target.getName(),path,null,false); if(path.equals(lower))return new NativeBinding(FluidCatalog.canonicalField("GenLiquid_"+target.getName()),path,null,false); @@ -231,8 +209,7 @@ SourceThermalRecyclingRules.Stats stats(GTMaterial input,GTMaterial target){ return new SourceThermalRecyclingRules.Stats(input.getDensity(),target.getMeltingPoint()); } Reason materialOverride(GTMaterial material,Facts source){ - PortDefaults defaults=contextDefaults(source.identity().id(),source.identity().name()); - if(defaults==null)return Reason.UNKNOWN_SOURCE_FACT; + PortDefaults defaults=source.portDefaults(); if(material.has(MaterialProperty.MELTING)!=defaults.melting())return Reason.MATERIAL_ELIGIBILITY_OVERRIDE; var target=material.getTargetSmeltingMaterial(); if(target==null||!target.isValid())return Reason.MATERIAL_TARGET_OVERRIDE;target=target.resolve(); @@ -284,7 +261,7 @@ private long validatedUnits(GTMaterial material,ItemStack stack,Set rules.rules().stream().anyMatch(rule -> rule.wholeDustMetal())) + .orElse(false); return metal && (prefix == MaterialPrefix.dustSmall || prefix == MaterialPrefix.dustTiny diff --git a/minecraft/src/main/java/gregtech/content/recipe/TreatedWoodRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/TreatedWoodRecipes.java index 00cb725e5..0ea52db8a 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/TreatedWoodRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/TreatedWoodRecipes.java @@ -2,9 +2,9 @@ import gregtech.api.material.GTMaterial; import gregtech.api.material.GTValues; -import gregtech.api.material.MaterialProperty; import gregtech.content.block.wood.WoodSpecies; import gregtech.content.data.MachineRecipeMaps; +import gregtech.content.data.MaterialGroups; import gregtech.content.data.MaterialPrefix; import gregtech.content.registry.GTBlocks; import gregtech.content.registry.GTItems; @@ -105,8 +105,6 @@ public final class TreatedWoodRecipes extends OriginalRecipeBatch { "pipeQuadruple", "pipeNonuple" }; - /** Wood-property materials that GT6's {@code ANY.WoodUntreated} does not contain. */ - private static final Set NOT_UNTREATED_WOOD = Set.of("PetrifiedWood"); private TreatedWoodRecipes() {} @@ -131,14 +129,11 @@ public static int register() { /** Every untreated wood form GT6's Bath handler converts, scaled by the prefix's material amount. */ private void materialBath() { GTMaterial treated = GTMaterialRegistry.get("WoodTreated").resolve(); - GTMaterial polished = GTMaterialRegistry.get("WoodPolished").resolve(); // GT6 stamps one recipe per (input stack, fluid); shared items such as vanilla sticks are // reached through several wood identities and must not repeat. Set used = new HashSet<>(); - for (GTMaterial material : GTMaterialRegistry.allMaterials()) { - if (!material.isValid() || !material.has(MaterialProperty.WOOD)) continue; - if (material == treated || material == polished) continue; - if (NOT_UNTREATED_WOOD.contains(material.getName())) continue; + GTMaterial polished = GTMaterialRegistry.get("WoodPolished").resolve(); + for (GTMaterial material : MaterialGroups.members(MaterialGroups.WoodUntreated)) { for (String form : WOOD_FORM_PREFIXES) { MaterialPrefix prefix = PrefixRegistry.byName(form); if (prefix != null) diff --git a/minecraft/src/main/java/gregtech/content/recipe/VanillaRecoveryRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/VanillaRecoveryRecipes.java index 641556598..707c35f98 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/VanillaRecoveryRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/VanillaRecoveryRecipes.java @@ -36,8 +36,10 @@ public static int register() { boolean auditedMachine = originalMachine(item); boolean meatCut = gregtech.content.material.MeatItemMaterials.contains(item); if (!id.getNamespace().equals("minecraft") - && !PanelMaterialRegistration.recoveryItems().contains(item) - && !TransportMaterialRegistration.recoveryItems().contains(item) + && !gregtech.content.material.PanelMaterialCompositions.recoveryItems() + .contains(item) + && !gregtech.content.material.TransportMaterialCompositions.recoveryItems() + .contains(item) && !auditedMachine && !meatCut) continue; var stack = new ItemStack(item); diff --git a/minecraft/src/main/java/gregtech/content/recipe/VanillaWoodProcessingRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/VanillaWoodProcessingRecipes.java index 43f23940b..b92e919b4 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/VanillaWoodProcessingRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/VanillaWoodProcessingRecipes.java @@ -3,7 +3,6 @@ import gregtech.api.material.*; import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; -import gregtech.content.material.VanillaCompositionLoader; import gregtech.content.plant.WoodSlabCatalog; import gregtech.engine.material.*; import net.minecraft.world.item.ItemStack; @@ -14,45 +13,6 @@ public final class VanillaWoodProcessingRecipes extends OriginalRecipeBatch { private static final String[] WOODS = { "oak", "spruce", "birch", "jungle", "acacia", "dark_oak", "mangrove", "cherry" }; - /** WoodDictionary replaces the generic vanilla item table before dependent recipes/panels. */ - public static void registerMaterials() { - for (String wood : WOODS) registerMaterials(wood, "log", "wood"); - for (String wood : new String[] {"crimson", "warped"}) registerMaterials(wood, "stem", "hyphae"); - } - - private static void registerMaterials(String wood, String... types) { - var material = RegisteredWoodSurvivalRecipes.material(wood); - var bark = GTMaterialRegistry.get("Bark"); - for (String type : types) { - String raw = wood + "_" + type; - registerWoodComposition( - raw, - new ItemComposition( - null, - java.util.List.of( - MaterialComponent.of(material, 8 * GTValues.U), - MaterialComponent.of(bark, GTValues.U)), - material, - "GT6 WoodEntry (modern wood binding)", - true)); - registerWoodComposition("stripped_" + raw, new ItemComposition(null, material, 8 * GTValues.U)); - } - registerWoodComposition(wood + "_planks", new ItemComposition(MaterialPrefix.plate, material, GTValues.U)); - registerWoodComposition(wood + "_stairs", new ItemComposition(null, material, 3 * GTValues.U / 4)); - registerWoodComposition(wood + "_slab", new ItemComposition(null, material, GTValues.U / 2)); - } - - private static void registerWoodComposition(String path, ItemComposition composition) { - var item = mc(path, 1).getItem(); - String jsonSource = VanillaCompositionLoader.declarationId(item).orElse(null); - ItemMaterialRegistry.register( - item, - composition, - ItemCompositionSource.Kind.EXPLICIT, - "gt6ce:wood-entry/" + path, - "GT6 wood material binding", - jsonSource); - } public static int register() { for (String wood : WOODS) INSTANCE.wood(wood); diff --git a/minecraft/src/main/java/gregtech/content/recipe/generated/ChemRecipeResolver.java b/minecraft/src/main/java/gregtech/content/recipe/generated/ChemRecipeResolver.java index 7357b2411..62948ce4a 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/generated/ChemRecipeResolver.java +++ b/minecraft/src/main/java/gregtech/content/recipe/generated/ChemRecipeResolver.java @@ -6,7 +6,7 @@ import gregtech.content.data.MachineRecipeMaps; import gregtech.content.data.MaterialPrefix; import gregtech.content.data.MaterialPrefixes; -import gregtech.content.recipe.OriginalMaterialFluidUnits; +import gregtech.content.material.catalog.MaterialFluidUnitFacts; import gregtech.content.recipe.SourceCentrifugeBlockDustInputs; import gregtech.content.recipe.SourceCentrifugeItemOutputs; import gregtech.content.recipe.SourceCentrifugeOptionalBindings; @@ -426,7 +426,7 @@ private static FluidStack fluid(ChemFluid fluid, List substitutions) thr return stack; } if (fluid instanceof ChemFluid.Water water) { - int mb = OriginalMaterialFluidUnits.millibuckets(water.units().units(), GTValues.U, 1000, + int mb = MaterialFluidUnitFacts.millibuckets(water.units().units(), GTValues.U, 1000, water.rounding() == gregtech.engine.recipe.chem.Rounding.CEIL); if (mb <= 0) throw new MissingContent("water amount " + water.units(), false); return new FluidStack(Fluids.WATER, mb); diff --git a/minecraft/src/main/java/gregtech/content/recipe/generated/GTOreRecipes.java b/minecraft/src/main/java/gregtech/content/recipe/generated/GTOreRecipes.java index 82a715003..b525c00a2 100644 --- a/minecraft/src/main/java/gregtech/content/recipe/generated/GTOreRecipes.java +++ b/minecraft/src/main/java/gregtech/content/recipe/generated/GTOreRecipes.java @@ -37,8 +37,8 @@ public static void register(boolean easyU235Extraction) { } ChemRecipeResolver.exclude(SOURCE + "owned", "magnetic-separator block dust and purified sifter rows are owned by their reviewed producers"); - ChemRecipeResolver.exclude(SOURCE + "108-159", - "the purified-acid vitriol loops are owned by SharedPurifiedAcidRows"); + ChemRecipeResolver.exclude(SOURCE + "31-38/108-159", + "the purified-acid vitriol and gold/copper/tin aqua-regia rows are owned by SharedSpecialProcessRows"); ChemRecipeResolver.exclude(SOURCE + "54-57/174-190", "bedrock, moon and end rows need retired materials; Cryotheum/Pyrotheum loops need retired fluids"); ChemRecipeResolver.exclude(SOURCE + "63", @@ -85,14 +85,6 @@ private static void sourceRows(List rows) { row(SOURCE, "Centrifuge", 64, 16, 28).item(form("dust", "SoulSand", 1)).out(form("dust", "Sand", 1), 8000).out(form("dustTiny", "Niter", 1), 1000).out(form("dustTiny", "Coal", 1), 1000).out(form("dustTiny", "Bone", 1), 1000).out(nativeFluid("Oil_Soulsand", 5)).add(rows); row(SOURCE, "Centrifuge", true, 64, 144, 29).item(blockDust("Netherrack", 1)).out(form("dust", "Stone", 9), 8000).out(form("dustTiny", "S", 18), 1000).out(form("dustTiny", "Redstone", 9), 500).out(form("dustTiny", "Coal", 9), 500).out(form("dustTiny", "Au", 9), 100).add(rows); row(SOURCE, "Centrifuge", 64, 16, 30).item(form("dust", "Netherrack", 1)).out(form("dust", "Stone", 1), 8000).out(form("dustTiny", "S", 2), 1000).out(form("dustTiny", "Redstone", 1), 500).out(form("dustTiny", "Coal", 1), 500).out(form("dustTiny", "Au", 1), 100).add(rows); - row(SOURCE, "Bath", 0, 256, 31).item(form("crushedPurified", "Au", 1)).fluid(liquid("AquaRegia", thousandths(6500), CEIL)).out(form("crushedCentrifuged", "Au", 1), 10000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(liquid("ChloroauricAcid", thousandths(3000), CEIL)).out(gas("NO", thousandths(1000), CEIL)).out(water(waterUnits(3000), FLOOR)).add(rows); - row(SOURCE, "Bath", 0, 256, 32).item(form("crushedPurifiedTiny", "Au", 9)).fluid(liquid("AquaRegia", thousandths(6500), CEIL)).out(form("crushedCentrifuged", "Au", 1), 10000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(form("crushedCentrifugedTiny", "Cu", 2), 5000).out(liquid("ChloroauricAcid", thousandths(3000), CEIL)).out(gas("NO", thousandths(1000), CEIL)).out(water(waterUnits(3000), FLOOR)).add(rows); - row(SOURCE, "Bath", 0, 256, 33).item(form("crushedPurified", "Cu", 1)).fluid(liquid("AquaRegia", thousandths(6500), CEIL)).out(form("crushedCentrifuged", "Cu", 1), 10000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(liquid("ChloroauricAcid", thousandths(3000), CEIL)).out(gas("NO", thousandths(1000), CEIL)).out(water(waterUnits(3000), FLOOR)).add(rows); - row(SOURCE, "Bath", 0, 256, 34).item(form("crushedPurifiedTiny", "Cu", 9)).fluid(liquid("AquaRegia", thousandths(6500), CEIL)).out(form("crushedCentrifuged", "Cu", 1), 10000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(form("crushedCentrifugedTiny", "Co", 2), 5000).out(liquid("ChloroauricAcid", thousandths(3000), CEIL)).out(gas("NO", thousandths(1000), CEIL)).out(water(waterUnits(3000), FLOOR)).add(rows); - row(SOURCE, "Bath", 0, 256, 35).item(form("crushedPurified", "Sn", 1)).fluid(liquid("AquaRegia", thousandths(13000), CEIL)).out(form("crushedCentrifuged", "Sn", 1), 10000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(liquid("StannicChloride", thousandths(2500), CEIL)).out(gas("HCl", thousandths(4000), CEIL)).out(gas("NO2", thousandths(3000), CEIL)).add(rows); - row(SOURCE, "Bath", 0, 256, 36).item(form("crushedPurifiedTiny", "Sn", 9)).fluid(liquid("AquaRegia", thousandths(13000), CEIL)).out(form("crushedCentrifuged", "Sn", 1), 10000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(liquid("StannicChloride", thousandths(2500), CEIL)).out(gas("HCl", thousandths(4000), CEIL)).out(gas("NO2", thousandths(3000), CEIL)).add(rows); - row(SOURCE, "Bath", 0, 256, 37).item(form("crushedPurified", "Cassiterite", 1)).fluid(liquid("AquaRegia", thousandths(13000), CEIL)).out(form("crushedCentrifuged", "Cassiterite", 1), 10000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(liquid("StannicChloride", thousandths(2500), CEIL)).out(gas("HCl", thousandths(4000), CEIL)).out(gas("NO2", thousandths(3000), CEIL)).add(rows); - row(SOURCE, "Bath", 0, 256, 38).item(form("crushedPurifiedTiny", "Cassiterite", 9)).fluid(liquid("AquaRegia", thousandths(13000), CEIL)).out(form("crushedCentrifuged", "Cassiterite", 1), 10000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(form("crushedCentrifugedTiny", "Zn", 2), 5000).out(liquid("StannicChloride", thousandths(2500), CEIL)).out(gas("HCl", thousandths(4000), CEIL)).out(gas("NO2", thousandths(3000), CEIL)).add(rows); row(SOURCE, "Sifting", 16, 144, 39).item(tech("bop_grass_smoldering", 1)).out(vanilla("dirt", 1), 8000).out(dust("Ash", thousandths(250)), 2000).add(rows); row(SOURCE, "Sifting", 16, 144, 40).item(vanilla("dirt", 1)).out(dust("Sand", thousandths(1000)), 4500).out(dust("Stone", thousandths(1000)), 3000).out(dust("ClayBrown", thousandths(1000)), 250).out(tech("clay_ball_brown", 1), 100).add(rows); row(SOURCE, "Sifting", 16, 144, 41).item(tech("salt_dirt_1", 1)).out(dust("Sand", thousandths(1000)), 4500).out(dust("Stone", thousandths(1000)), 3000).out(dust("ClayBrown", thousandths(1000)), 250).out(tech("clay_ball_brown", 1), 100).out(form("dust", "NaCl", 1), 4500).add(rows); diff --git a/minecraft/src/main/java/gregtech/engine/material/MaterialFormContent.java b/minecraft/src/main/java/gregtech/engine/material/MaterialFormContent.java index 2ff944cb7..2dc09ea7a 100644 --- a/minecraft/src/main/java/gregtech/engine/material/MaterialFormContent.java +++ b/minecraft/src/main/java/gregtech/engine/material/MaterialFormContent.java @@ -75,6 +75,18 @@ public static synchronized void publish() { entry.getKey().toString(), 0)); } + // These material phases reuse vanilla fluids and have no GT fluid registration entry. + for (String name : List.of("Water", "Lava")) { + var fluid = name.equals("Water") + ? net.minecraft.world.level.material.Fluids.WATER + : net.minecraft.world.level.material.Fluids.LAVA; + bindings.add(new MaterialFormBinding( + new MaterialKey(name), + new FormKey("liquid"), + MaterialFormKind.FLUID, + BuiltInRegistries.FLUID.getKey(fluid).toString(), + 0)); + } MaterialViews.publishContent(List.copyOf(bindings)); } } diff --git a/minecraft/src/test/java/gregtech/content/recipe/SpecialProcessRecipeTests.java b/minecraft/src/test/java/gregtech/content/recipe/SpecialProcessRecipeTests.java new file mode 100644 index 000000000..ebf9a241a --- /dev/null +++ b/minecraft/src/test/java/gregtech/content/recipe/SpecialProcessRecipeTests.java @@ -0,0 +1,169 @@ +package gregtech.content.recipe; + +import gregtech.api.addon.material.FormKey; +import gregtech.api.addon.material.MaterialFormBinding; +import gregtech.api.addon.material.MaterialFormKind; +import gregtech.api.addon.material.MaterialFormsView; +import gregtech.api.addon.material.MaterialKey; +import gregtech.api.addon.material.SpecialProcessValue; +import gregtech.content.data.MachineRecipeMaps; +import gregtech.content.data.MaterialPrefix; +import gregtech.content.registry.GTItems; +import gregtech.engine.material.GTMaterialRegistry; +import gregtech.engine.material.MaterialViews; +import gregtech.engine.recipe.Recipe; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.gametest.framework.GameTest; +import net.minecraft.gametest.framework.GameTestHelper; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.level.material.Fluids; +//? if >=1.21.1 { +/*import net.neoforged.neoforge.gametest.GameTestHolder; +import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; +*///?} else { +import net.minecraftforge.gametest.GameTestHolder; +import net.minecraftforge.gametest.PrefixGameTestTemplate; +//?} + +@GameTestHolder("gt6ce") +@PrefixGameTestTemplate(false) +public final class SpecialProcessRecipeTests { + private SpecialProcessRecipeTests() {} + + @GameTest(template = "test_empty", batch = "material_baseline", timeoutTicks = 200) + public static void publishedFluidsAndAnyFormReagentsNeedNoUnitFacts(GameTestHelper helper) { + var custom = new MaterialKey("AddonProcessFluid"); + var liquid = new FormKey("liquid"); + var delegate = MaterialViews.catalog().formBindings(); + // A platform-published addon binding is sufficient; there is no internal unit-table entry. + MaterialFormsView forms = material -> material.equals(custom) + ? Set.of(new MaterialFormBinding(custom, liquid, MaterialFormKind.FLUID, "minecraft:lava", 0)) + : delegate.find(material); + var target = new MaterialKey("Gold"); + var input = new FormKey("crushedPurified"); + var itemOutput = new SpecialProcessValue.ItemOutput(target, + List.of(new SpecialProcessValue.FormCount(new FormKey("crushedCentrifuged"), 1)), 5000); + var fluidOutput = new SpecialProcessValue.FluidOutput(custom, + List.of(new SpecialProcessValue.FormCount(liquid, 1)), 123); + var plan = new SpecialProcessValue.Target(Map.of(input, 1), List.of(itemOutput), List.of(fluidOutput), 37, 256, 0); + var result = SharedSpecialProcessRows.build(target, input, 1, plan, + new SharedSpecialProcessRows.ReagentSelector(custom, Set.of()), new SharedSpecialProcessRows.Resolver(forms)); + helper.assertTrue(result.recipe() != null, "anyForm fluid reagent resolves: " + result.reason()); + var recipe = result.recipe(); + helper.assertTrue(recipe.mFluidInputs[0].getFluid() == Fluids.LAVA && recipe.mFluidInputs[0].getAmount() == 37, + "reagent uses the published identity and exact mB"); + helper.assertTrue(recipe.mFluidOutputs[0].getFluid() == Fluids.LAVA && recipe.mFluidOutputs[0].getAmount() == 123, + "output uses the published identity and exact mB"); + helper.assertTrue(recipe.mChances[0] == 5000, "item chance is preserved"); + + var missingOutput = new SpecialProcessValue.FluidOutput(custom, + List.of(new SpecialProcessValue.FormCount(new FormKey("gas"), 1)), 123); + var invalid = new SpecialProcessValue.Target(Map.of(input, 1), List.of(itemOutput), List.of(missingOutput), 37, 256, 0); + result = SharedSpecialProcessRows.build(target, input, 1, invalid, + new SharedSpecialProcessRows.ReagentSelector(custom, Set.of(liquid)), new SharedSpecialProcessRows.Resolver(forms)); + helper.assertTrue(result.recipe() == null && "fluid-output".equals(result.reason()), + "missing output rejects the whole row without substituting its phase"); + + var itemPlan = new SpecialProcessValue.Target(Map.of(input, 1), List.of(itemOutput), List.of(), 2, 256, 0); + result = SharedSpecialProcessRows.build(target, input, 1, itemPlan, + new SharedSpecialProcessRows.ReagentSelector(new MaterialKey("SodiumPersulfate"), Set.of()), + new SharedSpecialProcessRows.Resolver()); + helper.assertTrue(result.recipe() != null && result.recipe().mInputs[1].getCount() == 2, + "anyForm also resolves a registered item reagent"); + for (String name : List.of("Water", "Lava", "Mercury")) { + result = SharedSpecialProcessRows.build(target, input, 1, itemPlan, + new SharedSpecialProcessRows.ReagentSelector(new MaterialKey(name), Set.of(liquid)), + new SharedSpecialProcessRows.Resolver()); + helper.assertTrue(result.recipe() != null && result.recipe().mFluidInputs.length == 1 + && result.recipe().mFluidInputs[0].getAmount() == 2, + name + " resolves exact mB through its published native form"); + } + helper.succeed(); + } + + @GameTest(template = "test_empty", batch = "material_baseline", timeoutTicks = 200) + public static void aquaRegiaRowsHaveOneOwnerAndAllOutputs(GameTestHelper helper) { + var catalog = MaterialViews.catalog(); + for (String name : List.of("Gold", "Copper", "Tin", "Cassiterite", "Platinum", "Nickel")) { + var material = new MaterialKey(name); + var plan = (SpecialProcessValue.Target) catalog.processes().find(material, SpecialProcessMethods.AQUA_REGIA_LEACHING) + .stream().map(rule -> rule.value()).filter(SpecialProcessValue.Target.class::isInstance).findFirst().orElseThrow(); + boolean platinum = name.equals("Platinum") || name.equals("Nickel"); + boolean tin = name.equals("Tin") || name.equals("Cassiterite"); + long[] sourceFluidAmounts = platinum ? new long[] {4500, 1500, 4125} + : tin ? new long[] {2500, 4000, 3000} : new long[] {3000, 1000, 3000}; + helper.assertTrue(plan.reagentAmount() == (platinum ? 9750 : tin ? 13000 : 6500), "source acid amount"); + helper.assertTrue(plan.inputCounts().equals(Map.of(new FormKey("crushedPurified"), 1, + new FormKey("crushedPurifiedTiny"), 9)), "source purified input ratios"); + for (var input : plan.inputCounts().entrySet()) { + var result = SharedSpecialProcessRows.build(material, input.getKey(), input.getValue(), plan, + new SharedSpecialProcessRows.ReagentSelector(new MaterialKey("AquaRegia"), Set.of(new FormKey("liquid"))), + new SharedSpecialProcessRows.Resolver()); + helper.assertTrue(result.recipe() != null, name + "/" + input.getKey() + ": " + result.reason()); + var built = result.recipe(); + helper.assertTrue(built.mOutputs.length == 6 && built.mFluidOutputs.length == 3, "all aqua-regia outputs resolve"); + for (int i = 0; i < 6; i++) helper.assertTrue(built.mChances[i] == (i == 0 ? 10000 : 5000), "source output chances"); + for (int i = 0; i < 3; i++) helper.assertTrue(built.mFluidOutputs[i].getAmount() == sourceFluidAmounts[i], "source fluid amounts"); + var published = MachineRecipeMaps.Bath.mRecipeList.stream().filter(row -> sameInputs(row, built)).toList(); + helper.assertTrue(published.size() == 1, name + "/" + input.getKey() + " publishes exactly once, got " + published.size()); + helper.assertTrue(SharedSpecialProcessRows.owned().contains(published.get(0)), "declarative producer owns the published row"); + helper.assertTrue(published.get(0).mFluidOutputs.length == 3, "published row retains every fluid output"); + } + } + helper.succeed(); + } + + @GameTest(template = "test_empty", batch = "material_baseline", timeoutTicks = 200) + public static void persulfateBathKeepsSourceRatiosAndByproducts(GameTestHelper helper) { + var copper = GTMaterialRegistry.get("Copper"); + var rows = SharedOreWashingRows.definitions(List.of(copper), new SharedOreWashingRows.Snapshot()); + helper.assertTrue(SourceOreWashingRules.bathShapes().stream().map(shape -> shape.input().getName() + + "/" + shape.inputCount() + "/" + shape.reagent().getName() + "/" + shape.reagentCount()).toList() + .equals(List.of("crushed/1/dust/1", "crushedTiny/9/dust/1", "crushed/1/dustTiny/9", "crushedTiny/1/dustTiny/1")), + "all four source input/reagent ratios"); + for (String reagent : List.of("SodiumPersulfate", "PotassiumPersulfate")) { + for (var shape : SourceOreWashingRules.bathShapes()) { + var input = GTItems.getStack(shape.input(), copper, shape.inputCount()); + var dust = GTItems.getStack(shape.reagent(), GTMaterialRegistry.get(reagent), shape.reagentCount()); + var matches = rows.stream().filter(row -> row.map() == MachineRecipeMaps.Bath && row.inputs().length == 2 + && ItemStack.matches(row.inputs()[0], input) && ItemStack.matches(row.inputs()[1], dust)).toList(); + helper.assertTrue(matches.size() == 3, "each persulfate shape has three supported waters"); + for (var row : matches) { + boolean whole = shape.outputSize() == SourceOreWashingRules.Size.WHOLE; + helper.assertTrue(row.fluidInputs()[0].getAmount() == (whole ? 900 : 100), "source water amount"); + helper.assertTrue(row.duration() == (whole ? 144 : 16) && row.power() == 0, "source time and power"); + helper.assertTrue(row.fluidOutputs().length == 0, "persulfate produces no steam"); + helper.assertTrue(row.outputs().length == (whole ? 6 : 2), "source byproduct slot count"); + for (int i = 1; i < row.outputs().length; i++) helper.assertTrue(row.outputs()[i].getCount() == (whole && i < 5 ? 2 : 1), "source byproduct count"); + } + } + } + helper.succeed(); + } + + @GameTest(template = "test_empty", batch = "material_baseline", timeoutTicks = 200) + public static void woodDustsStillMakePaper(GameTestHelper helper) { + for (String name : List.of("Bamboo", "WoodRubber", "WoodTreated")) { + for (var prefix : List.of(MaterialPrefix.dust, MaterialPrefix.dustSmall, MaterialPrefix.dustTiny)) { + var stack = GTItems.getStack(prefix, GTMaterialRegistry.get(name), 1); + if (stack.isEmpty()) continue; + helper.assertTrue(MachineRecipeMaps.Bath.mRecipeList.stream().anyMatch(row -> row.mInputs.length == 1 + && row.itemTag(0) != null && stack.is(row.itemTag(0)) + && Arrays.stream(row.mOutputs).anyMatch(output -> output.is(Items.PAPER))), + name + "/" + prefix.getName() + " remains in the paper input tag"); + } + } + helper.succeed(); + } + + private static boolean sameInputs(Recipe row, Recipe expected) { + return row.mInputs.length == 1 && row.mFluidInputs.length == 1 + && ItemStack.matches(row.mInputs[0], expected.mInputs[0]) + && row.mFluidInputs[0].getFluid() == expected.mFluidInputs[0].getFluid() + && row.mFluidInputs[0].getAmount() == expected.mFluidInputs[0].getAmount(); + } +} diff --git a/minecraft/src/test/java/gregtech/gametest/MaterialBaselineAddon.java b/minecraft/src/test/java/gregtech/gametest/MaterialBaselineAddon.java deleted file mode 100644 index 355c5f937..000000000 --- a/minecraft/src/test/java/gregtech/gametest/MaterialBaselineAddon.java +++ /dev/null @@ -1,110 +0,0 @@ -package gregtech.gametest; - -import gregtech.api.addon.material.AddonMaterialContributor; -import gregtech.api.addon.material.FormKey; -import gregtech.api.addon.material.MaterialComposition; -import gregtech.api.addon.material.MaterialDeclaration; -import gregtech.api.addon.material.MaterialDecompositionRule; -import gregtech.api.addon.material.MaterialInfoTool; -import gregtech.api.addon.material.MaterialKey; -import gregtech.api.addon.material.MaterialProcessKeys; -import gregtech.api.addon.material.MaterialProcessRule; -import gregtech.api.material.GTValues; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -/** Test-source SPI contributor exercises host installation without a real optional mod. */ -public final class MaterialBaselineAddon implements AddonMaterialContributor { - record DecompositionCase(String material, String form, String fluid, boolean gas) {} - - static final List DECOMPOSITIONS = List.of( - new DecompositionCase("BaselineDustOnly", "dust", null, false), - new DecompositionCase("BaselineBlockOnly", "blockDust", null, false), - new DecompositionCase("BaselineLiquidOnly", "liquid", "material_baseline_test:baselineliquidonly", false), - new DecompositionCase("BaselineGasOnly", "gas", "material_baseline_test:baselinegasonly", true), - new DecompositionCase("BaselineLegacyFluid", "liquid", "baselinelegacyfluid", false), - new DecompositionCase("BaselineBuiltinFluid", "gas", "gt6ce:oxygen", true), - new DecompositionCase("BaselineExternalFluid", "liquid", "minecraft:flowing_water", false), - new DecompositionCase("BaselineUnknownFluid", "liquid", "missing:baselineliquidonly", false), - new DecompositionCase("BaselineInvalidFluid", "liquid", "Invalid:fluid", false)); - - @Override - public String addonId() { - return "material_baseline_test"; - } - - @Override - public List materials() { - var declarations = new ArrayList<>(List.of( - MaterialDeclaration.builder("BaselineRuntimeCompound").dust().build(), - MaterialDeclaration.builder("BaselineThermalAddon") - .dust() - .liquid() - .build())); - for (var test : DECOMPOSITIONS) { - var material = MaterialDeclaration.builder(test.material()).dust(); - if (test.gas()) material.gas(); - else material.liquid(); - if (test.material().equals("BaselineLiquidOnly")) material.meltingPointKelvin(200); - declarations.add(material.build()); - } - declarations.add( - MaterialDeclaration.builder("BaselineFluidOutput").dust().build()); - return List.copyOf(declarations); - } - - @Override - public void materialInfo(MaterialInfoTool.Registrar registrar) { - registrar.registerProcess( - new MaterialKey("BaselineRuntimeCompound"), - MaterialProcessKeys.DECOMPOSITION, - MaterialProcessRule.anyForm(new MaterialDecompositionRule( - Set.of(MaterialDecompositionRule.Route.CENTRIFUGE), List.of(), false))); - for (var test : DECOMPOSITIONS) { - var fluids = test.fluid() == null - ? List.of() - : List.of(new MaterialDecompositionRule.FluidBinding( - test.gas() ? MaterialDecompositionRule.Phase.GAS : MaterialDecompositionRule.Phase.LIQUID, - test.fluid(), - GTValues.U, - 1000)); - registrar.registerProcess( - new MaterialKey(test.material()), - MaterialProcessKeys.DECOMPOSITION, - new MaterialProcessRule<>( - Set.of(new FormKey(test.form())), - new MaterialDecompositionRule( - Set.of(MaterialDecompositionRule.Route.CENTRIFUGE), - fluids, - !test.form().equals("dust") && !test.form().equals("blockDust")))); - } - registrar.registerProcess( - new MaterialKey("BaselineFluidOutput"), - MaterialProcessKeys.DECOMPOSITION, - MaterialProcessRule.anyForm(new MaterialDecompositionRule( - Set.of(MaterialDecompositionRule.Route.CENTRIFUGE), List.of(), false))); - } - - @Override - public List compositions() { - var compositions = new ArrayList<>(List.of(new MaterialComposition( - "BaselineRuntimeCompound", - 3, - List.of( - new MaterialComposition.Part("Iron", GTValues.U * 2), - new MaterialComposition.Part("Copper", GTValues.U)), - false))); - for (var test : DECOMPOSITIONS) - compositions.add(new MaterialComposition( - test.material(), 9, List.of(new MaterialComposition.Part("Iron", GTValues.U * 9)), false)); - compositions.add(new MaterialComposition( - "BaselineFluidOutput", - 2, - List.of( - new MaterialComposition.Part("Iron", GTValues.U), - new MaterialComposition.Part("BaselineLiquidOnly", GTValues.U)), - false)); - return List.copyOf(compositions); - } -} diff --git a/minecraft/src/test/java/gregtech/gametest/MaterialBaselineTests.java b/minecraft/src/test/java/gregtech/gametest/MaterialBaselineTests.java deleted file mode 100644 index 144a9c15a..000000000 --- a/minecraft/src/test/java/gregtech/gametest/MaterialBaselineTests.java +++ /dev/null @@ -1,1033 +0,0 @@ -package gregtech.gametest; - -import gregtech.api.addon.material.MaterialInfoTool; -import gregtech.api.addon.material.GregTechMaterials; -import gregtech.api.addon.material.MaterialFormKind; -import gregtech.api.addon.material.MaterialKey; -import gregtech.api.addon.material.MaterialProcessKeys; -import gregtech.api.material.GTValues; -import gregtech.api.material.PulverizationMaterialHelper; -import gregtech.api.material.SmeltingMaterialHelper; -import gregtech.content.block.machine.MoldBlock; -import gregtech.content.block.machine.MoldItemData; -import gregtech.content.block.machine.BasicMachineBlock; -import gregtech.content.blockentity.machine.BasicMachineBlockEntity; -import gregtech.content.data.MachineRecipeMaps; -import gregtech.content.data.MaterialPrefix; -import gregtech.content.item.GTToolItem; -import gregtech.content.material.Materials; -import gregtech.content.recipe.CraftingMaterialForms; -import gregtech.content.recipe.MachineRecipeOverlay; -import gregtech.content.recipe.MaterialRecoveryRules; -import gregtech.content.registry.GTItems; -import gregtech.content.registry.GTTechnological; -import gregtech.engine.fluid.PortableFluidContainerSpec; -import gregtech.engine.machine.crucible.CrucibleItemInput; -import gregtech.engine.material.ItemComposition; -import gregtech.engine.material.ItemMaterialRegistry; -import gregtech.engine.material.ItemCompositionSource; -import gregtech.engine.material.MaterialEquivalence; -import gregtech.engine.material.MaterialPublication; -import gregtech.engine.recipe.Recipe; -import gregtech.engine.recipe.RecipeMap; -import gregtech.engine.tool.GTToolType; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.gametest.framework.GameTest; -import net.minecraft.gametest.framework.GameTestHelper; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.resources.ResourceLocation; -//? if >=1.21.1 { -/*import net.neoforged.neoforge.fluids.FluidStack; -import net.neoforged.neoforge.gametest.GameTestHolder; -import net.neoforged.neoforge.gametest.PrefixGameTestTemplate; -*///?} else { -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.gametest.GameTestHolder; -import net.minecraftforge.gametest.PrefixGameTestTemplate; -//?} - -/** Observations and correctness checks are separate; known differences are named in each assertion. */ -@GameTestHolder("gt6ce") -@PrefixGameTestTemplate(false) -public final class MaterialBaselineTests { - private static final String BATCH = "material_baseline"; - private static final AtomicBoolean RELOAD_COMPLETE = new AtomicBoolean(); - private static final AtomicReference RELOAD_FAILURE = new AtomicReference<>(); - - private MaterialBaselineTests() {} - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void materialSpiInstallsLinkedCompositionAndGeneratedForm(GameTestHelper helper) { - var material = gregtech.engine.material.GTMaterialRegistry.get("BaselineRuntimeCompound"); - helper.assertTrue(material.isValid(), "SPI material installed"); - helper.assertTrue("material_baseline_test".equals(gregtech.engine.addon.AddonMaterials.owner(material)), "SPI ownership"); - helper.assertTrue(!gregtech.engine.material.GTMaterialRegistry.isCoreMaterial(material), "addon identity is separate from core"); - helper.assertTrue(material.getCompositionComponents().size() == 2 && material.getCompositionDivider() == 3, "SPI composition linked"); - var indexed = MaterialInfoTool.composition(new MaterialKey(material.getName())).orElseThrow(); - helper.assertTrue(indexed.divider() == 3 && indexed.parts().size() == 2 && !indexed.crucible(), "legacy SPI composition reaches the frozen index"); - helper.assertTrue(indexed.parts().get(0).material().equals("Iron") && indexed.parts().get(0).amount() == GTValues.U * 2 - && indexed.parts().get(1).material().equals("Copper") && indexed.parts().get(1).amount() == GTValues.U, "indexed composition retains order and amounts"); - var iron = new MaterialKey("Iron"); - helper.assertTrue(SmeltingMaterialHelper.target(iron).equals(SmeltingMaterialHelper.target(Materials.Iron)) - && SmeltingMaterialHelper.target(iron).isPresent(), "default smelting agrees across query entries"); - helper.assertTrue(PulverizationMaterialHelper.target(iron).equals(PulverizationMaterialHelper.target(Materials.Iron)) - && PulverizationMaterialHelper.target(iron).isPresent(), "default pulverization agrees across query entries"); - var dust = GTItems.getStack(MaterialPrefix.dust, material, 3); - helper.assertFalse(dust.isEmpty(), "host generated the requested dust form"); - helper.assertTrue(find(MachineRecipeMaps.Centrifuge, List.of(dust), List.of()) != null, "SPI decomposition is queryable"); - observe(helper, "spi_dust", dust); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void addonDecompositionExecutesThroughThePublishedCentrifugeRow(GameTestHelper helper) { - var level = helper.getLevel(); - var pos = helper.absolutePos(new net.minecraft.core.BlockPos(2, 1, 2)); - var block = BuiltInRegistries.BLOCK.get( - ResourceLocation.fromNamespaceAndPath("gt6ce", "centrifuge_bronze")); - level.setBlockAndUpdate(pos, block.defaultBlockState()); - var machine = (BasicMachineBlockEntity) level.getBlockEntity(pos); - helper.assertTrue(machine != null, "centrifuge fixture is registered"); - machine.setSpec(((BasicMachineBlock) block).basicSpec()); - var material = gregtech.engine.material.GTMaterialRegistry.get("BaselineRuntimeCompound"); - var dust = GTItems.getStack(MaterialPrefix.dust, material, 3); - machine.inventory().setStackInSlot(0, dust); - machine.inventoryChanged(); - var config = new gregtech.engine.machine.RecipeProcessor.Config() { - public RecipeMap recipeMap() { - return machine.recipeMap(); - } - - public boolean searchOutputTanks() { - return false; - } - - public boolean exclusiveOutputs() { - return false; - } - - public int parallelLimit() { - return 1; - } - - public boolean parallelScalesDuration() { - return true; - } - - public boolean cheapOverclocking() { - return false; - } - - public boolean usesTimeEnergy() { - return false; - } - - public int efficiency() { - return 10_000; - } - - public long inputMinimum() { - return 16; - } - - public long inputMaximum() { - return 64; - } - - public long nominalEnergyInput() { - return 32; - } - - public long startupEnergyFor(Recipe recipe) { - return 0; - } - }; - var io = new gregtech.engine.machine.RecipeProcessor.IO() { - public gregtech.engine.machine.MachineInventory inventory() { - return machine.autoIOInventory(); - } - - public net.minecraft.world.level.Level level() { - return level; - } - - public ItemStack autocraftingProgram() { - return ItemStack.EMPTY; - } - - public void setStartupEnergy(long value) {} - - public void clearStartupEnergy() {} - - public void markJobStarted() {} - - public net.minecraft.world.level.block.entity.BlockEntity owner() { - return machine; - } - }; - var gate = new gregtech.engine.machine.RecipeProcessor.Gate() { - public boolean structureComplete() { - return true; - } - - public boolean switchesAllowRunning() { - return true; - } - - public boolean recipeStartAllowed() { - return true; - } - - public boolean lightAllowsStart() { - return true; - } - }; - var processor = new gregtech.engine.machine.RecipeProcessor(config, io, gate); - helper.assertTrue( - processor.startJob() == gregtech.engine.machine.RecipeProcessor.StartResult.STARTED, - "published decomposition row did not start through the shared recipe processor"); - helper.assertTrue( - machine.inventory().getStackInSlot(0).isEmpty(), - "centrifuge consumed its decomposition input"); - helper.assertTrue( - processor.recipeDetails() != null - && processor.recipeDetails().duration() == 876 - && processor.recipeDetails().power() == 42, - "decomposition plan supplied duration and EU/t to the machine: " + processor.recipeDetails()); - helper.assertTrue( - processor.advance(processor.totalWork()), - "centrifuge did not complete its planned work; work=" + processor.totalWork() - + ", progress=" + processor.progress()); - helper.assertTrue( - processor.flushOutputs(), - "centrifuge did not flush its planned outputs; pending=" + processor.pendingOutputs()); - var iron = machine.inventory().getStackInSlot(machine.inputSlots()); - var copper = machine.inventory().getStackInSlot(machine.inputSlots() + 1); - helper.assertTrue( - iron.is(GTItems.getStack(MaterialPrefix.dust, Materials.Iron, 1).getItem()) - && iron.getCount() == 2, - "centrifuge emitted two Iron dust"); - helper.assertTrue( - copper.is(GTItems.getStack(MaterialPrefix.dust, Materials.Copper, 1).getItem()) - && copper.getCount() == 1, - "centrifuge emitted one Copper dust"); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void registeredFormsPublishItemBlockAndFluidBindings(GameTestHelper helper) { - var iron = new MaterialKey("Iron"); - var ironBindings = GregTechMaterials.formBindings().find(iron); - helper.assertTrue( - ironBindings.stream().anyMatch(binding -> binding.kind() == MaterialFormKind.ITEM), - "iron has a registered item binding"); - helper.assertTrue( - ironBindings.stream() - .anyMatch(binding -> binding.id().equals("minecraft:iron_ingot")), - "explicit vanilla iron ingot is part of the same form inventory"); - helper.assertTrue( - ironBindings.stream().anyMatch(binding -> binding.kind() == MaterialFormKind.BLOCK), - "iron has a registered block binding"); - var hydrogenBindings = GregTechMaterials.formBindings().find(new MaterialKey("Hydrogen")); - helper.assertTrue( - hydrogenBindings.stream().anyMatch(binding -> binding.kind() == MaterialFormKind.FLUID), - "hydrogen has a registered fluid binding"); - helper.assertTrue( - GregTechMaterials.forms().rules(iron).stream() - .anyMatch(rule -> rule.kind() == MaterialFormKind.ITEM - && GregTechMaterials.formBindings() - .present(iron, rule.form())), - "allowed item rules intersect native bindings"); - helper.assertTrue( - "ores".equals(MaterialEquivalence.commonGroup("ore")) - && "raw_ore_chunks".equals(MaterialEquivalence.commonGroup("rawOreChunk")), - "external ore tag names remain mapped"); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void storageBlocksExposeCompositionAndBothAdmissions(GameTestHelper helper) { - var iron = ItemMaterialRegistry.get(new ItemStack(Items.IRON_BLOCK)).orElseThrow(); - helper.assertTrue(iron.components().size() == 1 && iron.material().resolve() == Materials.Iron.resolve() - && iron.amount() == 9 * GTValues.U, "iron block contains exactly 9U Iron"); - helper.assertTrue(CrucibleItemInput.isValid(new ItemStack(Items.IRON_BLOCK)), "crucible admits iron block"); - for (Item item : List.of(Items.IRON_BLOCK, Items.COPPER_BLOCK)) { - var stack = new ItemStack(item); - helper.assertTrue(ItemMaterialRegistry.get(stack).isPresent(), "missing composition: " + id(stack)); - helper.assertTrue(ItemMaterialRegistry.canRecover(stack), "storage block is recoverable: " + id(stack)); - observe(helper, id(stack), stack); - } - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void traversalAndSingleQueriesUseTheSameEffectiveSnapshot(GameTestHelper helper) { - long tagged = 0; - for (var entry : ItemMaterialRegistry.entries().entrySet()) { - helper.assertTrue( - ItemMaterialRegistry.base(entry.getKey()).orElseThrow().equals(entry.getValue()), - "traversal and lookup disagree for " + id(new ItemStack(entry.getKey()))); - helper.assertTrue( - ItemMaterialRegistry.get(new ItemStack(entry.getKey())).orElseThrow().equals(entry.getValue()), - "stack lookup differs from base for " + id(new ItemStack(entry.getKey()))); - helper.assertFalse(entry.getValue().sources().isEmpty(), "composition has no provenance"); - if (entry.getValue().sources().stream() - .anyMatch(source -> source.kind() == ItemCompositionSource.Kind.FORM_TAG)) tagged++; - } - helper.assertTrue(ItemMaterialRegistry.tagInputReady(), "tag input generation is ready at runtime"); - helper.assertTrue( - ItemMaterialRegistry.compositionStatus(Items.DRAGON_EGG) - != ItemMaterialRegistry.CompositionLookupState.TAG_INPUT_NOT_READY, - "completed tag input distinguishes absence from an unpublished generation"); - helper.assertTrue( - gregtech.content.recipe.ExternalOreProcessing.taggedCompositions() == 0 || tagged > 0, - "loaded common-form tags contribute effective compositions"); - helper.assertTrue(ItemMaterialRegistry.explicit(Items.IRON_BLOCK).isPresent(), "explicit diagnostics remain"); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void seventyTwoUnitsExposePlanAndQueryableOutput(GameTestHelper helper) { - var stack = new ItemStack(Items.ENCHANTED_GOLDEN_APPLE); - var data = ItemMaterialRegistry.get(stack).orElseThrow(); - helper.assertTrue(data.components().size() == 1 && data.material().resolve() == Materials.Gold.resolve() - && data.amount() == 72 * GTValues.U, "enchanted golden apple carries 72U Gold"); - var plan = MaterialRecoveryRules.dustPlan(data.amount()); - helper.assertTrue(plan.complete() && plan.representedUnits() == 72 * GTValues.U, - "72U dust planner preserves every unit"); - helper.assertTrue( - plan.stackCount() == 2 - && plan.piles().get(0).equals(new MaterialRecoveryRules.DustPile(MaterialPrefix.dust, 64)) - && plan.piles().get(1).equals(new MaterialRecoveryRules.DustPile(MaterialPrefix.dust, 8)), - "72U uses legal 64 dust plus 8 dust stacks"); - var oneSlot = gregtech.util.OM.dust(Materials.Gold, 72 * GTValues.U); - var allSlots = gregtech.util.OM.dustAll(Materials.Gold, 72 * GTValues.U); - helper.assertTrue( - oneSlot.getCount() == 64 - && allSlots.size() == 2 - && allSlots.get(0).getCount() == 64 - && allSlots.get(1).getCount() == 8, - "single-slot and complete dust adapters project the same plan"); - var recipe = find(MachineRecipeMaps.Shredder, List.of(stack), List.of()); - helper.assertTrue(recipe != null, "72U item has a queryable recycling recipe"); - helper.assertTrue( - recipe.mOutputs.length == 2 - && recipe.mOutputs[0].is(GTItems.getStack(MaterialPrefix.dust, Materials.Gold, 1) - .getItem()) - && recipe.mOutputs[0].getCount() == 64 - && recipe.mOutputs[1].is(GTItems.getStack(MaterialPrefix.dust, Materials.Gold, 1) - .getItem()) - && recipe.mOutputs[1].getCount() == 8, - "final shredder row preserves 72U Gold"); - write(helper, "72u.tsv", List.of("input\t" + describe(stack), "plan\t" + plan.piles(), - "lookup\t" + (recipe == null ? "absent" : signature(MachineRecipeMaps.Shredder, recipe)))); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void capsuleRecyclingUsesTheSharedStaticShredderPlan(GameTestHelper helper) { - var spec = Arrays.stream(PortableFluidContainerSpec.values()) - .filter(candidate -> candidate.id().equals("cell_tin")) - .findFirst() - .orElseThrow(); - var input = new ItemStack(gregtech.platform.Mc.item( - ResourceLocation.fromNamespaceAndPath("gt6ce", "fluid_" + spec.id()))); - var composition = ItemMaterialRegistry.get(input).orElseThrow(); - var expected = MaterialRecoveryRules.planShredderStatic( - composition, MachineRecipeMaps.Shredder.mOutputItemsCount); - var recipe = find(MachineRecipeMaps.Shredder, List.of(input), List.of()); - helper.assertTrue(expected.accepted() && recipe != null, "capsule Shredder recipe exists"); - helper.assertTrue(recipe.mDuration == expected.duration(), "capsule duration comes from the shared plan"); - helper.assertTrue( - recipe.mRecoveryOwnership != null - && recipe.mRecoveryOwnership.scope() - == Recipe.RecoveryOwnership.Scope.EXPLICIT - && recipe.mRecoveryOwnership.family().equals("capsule-cell"), - "capsule row carries typed explicit ownership"); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void compositeHeadKeepsEveryComponentAcrossQueries(GameTestHelper helper) { - var stack = GTItems.getStack(MaterialPrefix.toolHeadDrill, Materials.Titanium, 1); - helper.assertFalse(stack.isEmpty(), "composite drill head exists"); - var explicit = ItemMaterialRegistry.explicit(stack.getItem()).orElseThrow(); - var actual = ItemMaterialRegistry.get(stack).orElseThrow(); - helper.assertTrue(explicit.equals(actual), "registry and pristine stack agree"); - helper.assertTrue(actual.components().size() == 2, "drill head has two components"); - helper.assertTrue(actual.components().get(0).material().resolve() == Materials.Titanium.resolve() - && actual.components().get(0).amount() == 4 * GTValues.U, "primary: 4U Titanium"); - helper.assertTrue(actual.components().get(1).material().resolve() == Materials.Steel.resolve() - && actual.components().get(1).amount() == 4 * GTValues.U, "secondary: 4U Steel"); - var form = MaterialEquivalence.form(stack); - helper.assertTrue(form == null, "a composite tool head is not a pure material form"); - helper.assertTrue(explicit.components().stream() - .anyMatch(component -> component.material().resolve() == Materials.Steel.resolve()), - "equivalence rejection does not discard the secondary Steel"); - var plan = MaterialRecoveryRules.planShredder(actual, MachineRecipeMaps.Shredder.mOutputItemsCount); - helper.assertTrue(plan.accepted(), "complete composite composition has a shredder plan"); - helper.assertTrue( - plan.outputs().stream() - .map(output -> output.material().resolve()) - .toList() - .containsAll(List.of( - Materials.Titanium.getTargetPulverMaterial().resolve(), - Materials.Steel.getTargetPulverMaterial().resolve())), - "composite shredder plan converts every component through its own pulverization target"); - observe(helper, "composite_head", stack); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void damagedToolsAndContainersExposeStateAdmission(GameTestHelper helper) { - var tool = new ItemStack(Items.IRON_PICKAXE); - helper.assertTrue(ItemMaterialRegistry.get(tool).isPresent(), "iron pickaxe composition exists"); - var full = ItemMaterialRegistry.get(tool).orElseThrow(); - observe(helper, "tool_full", tool); - tool.setDamageValue(tool.getMaxDamage() / 2); - var half = ItemMaterialRegistry.get(tool).orElseThrow(); - for (int i = 0; i < full.components().size(); i++) - helper.assertTrue(half.components().get(i).amount() == full.components().get(i).amount() - * (tool.getMaxDamage() - tool.getDamageValue()) / tool.getMaxDamage(), "damage scales component " + i); - observe(helper, "tool_partial", tool); - helper.assertTrue( - ItemMaterialRegistry.recoveryRejection(tool) - == ItemMaterialRegistry.RecoveryRejection.ELIGIBLE, - "partial tools retain an eligible scaled composition"); - var expectedHalf = MaterialRecoveryRules.planShredder(half, MachineRecipeMaps.Shredder.mOutputItemsCount); - var halfRecipe = find(MachineRecipeMaps.Shredder, List.of(tool), List.of()); - helper.assertTrue( - expectedHalf.accepted() && halfRecipe != null, - "partial tools query the Shredder from their remaining composition"); - helper.assertTrue( - halfRecipe.mOutputs.length == expectedHalf.stackCount(), - "partial tools recover exactly the scaled Shredder output"); - tool.setDamageValue(tool.getMaxDamage()); - helper.assertTrue(ItemMaterialRegistry.get(tool).orElseThrow().components().isEmpty(), "exhausted tool has no positive material"); - helper.assertFalse(ItemMaterialRegistry.canRecover(tool), "no recovery from exhausted tool"); - helper.assertTrue( - ItemMaterialRegistry.recoveryRejection(tool) - == ItemMaterialRegistry.RecoveryRejection.NO_COMPONENTS, - "exhausted recovery rejection names the empty composition"); - observe(helper, "tool_exhausted", tool); - var nativeTool = GTToolItem.create(GTToolType.PICKAXE, Materials.Iron, gregtech.engine.material.GTMaterialRegistry.get("Wood")); - helper.assertFalse(nativeTool.isEmpty(), "native material tool exists"); - helper.assertTrue(ItemMaterialRegistry.get(nativeTool).isEmpty(), "observed difference: native tool instance has no registry composition"); - observe(helper, "native_tool", nativeTool); - var empty = new ItemStack(Items.BUCKET); - var filled = new ItemStack(Items.WATER_BUCKET); - helper.assertTrue(CrucibleItemInput.isValid(empty), "empty bucket is meltable"); - helper.assertFalse(CrucibleItemInput.isValid(filled), "filled bucket is protected"); - observe(helper, "bucket_empty", empty); - observe(helper, "bucket_filled", filled); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void shapedMoldsExposeShapeCompositionAndRejection(GameTestHelper helper) { - var block = BuiltInRegistries.BLOCK.get(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("gt6ce", "mold_stone")); - helper.assertTrue(block instanceof MoldBlock, "stone casting mold is registered on both nodes"); - var empty = new ItemStack(block); - int mask = gregtech.content.blockentity.machine.MoldBlockEntity.randomDungeonShape(net.minecraft.util.RandomSource.create(0)); - var shaped = MoldItemData.withShape(empty.copy(), mask); - var composition = ItemMaterialRegistry.get(empty).orElseThrow(); - helper.assertTrue(composition.components().size() == 1 && composition.amount() == 45 * GTValues.U, - "stone mold carries its 45U construction composition"); - helper.assertTrue(ItemMaterialRegistry.canRecover(empty), "plain stone mold is admitted for recovery"); - helper.assertTrue(MoldItemData.shape(shaped) == mask, "casting cavity survives on the item"); - helper.assertTrue(ItemMaterialRegistry.get(empty).equals(ItemMaterialRegistry.get(shaped)), "shape keeps composition"); - helper.assertFalse(ItemMaterialRegistry.hasStoredContents(shaped), "a casting cavity is shape state, not inventory"); - helper.assertTrue(CrucibleItemInput.isValid(shaped), "a shaped casting mold remains meltable"); - helper.assertTrue(ItemMaterialRegistry.canRecover(shaped), "a shaped casting mold keeps bulk recovery"); - observe(helper, "casting_mold_empty", empty); - observe(helper, "casting_mold_shaped", shaped); - var press = GTTechnological.get("press_bullet_casing_shape_small"); - helper.assertTrue(press != null, "press mold is registered"); - helper.assertTrue(ItemMaterialRegistry.get(new ItemStack(press)).isEmpty(), - "observed difference: registered press mold has no composition (#350)"); - observe(helper, "press_mold", new ItemStack(press)); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void solidAndFluidDecompositionAreQueryable(GameTestHelper helper) { - var salt = GTItems.getStack(MaterialPrefix.dust, gregtech.engine.material.GTMaterialRegistry.get("Powellite"), 6); - var solid = find(MachineRecipeMaps.Electrolyzer, - List.of(new ItemStack(GTTechnological.selectorTag(0)), salt), List.of()); - helper.assertTrue(solid != null, "Powellite decomposition is queryable with mode 0 (accepted #318 rule)"); - helper.assertTrue( - solid.isCatalystInput(0) && Arrays.equals(solid.explicitCatalystInputs(), new int[] {0}), - "the electrolyser selector is an explicit presence-only catalyst"); - helper.assertTrue( - solid.mDuration == 1752 && solid.mEUt == 84, - "Powellite decomposition retains its planned duration and EU/t"); - helper.assertTrue( - solid.mOutputs.length == 2 - && solid.mOutputs[0].is(GTItems.getStack(MaterialPrefix.dust, Materials.Calcium, 1) - .getItem()) - && solid.mOutputs[0].getCount() == 1 - && solid.mOutputs[1].is(GTItems.getStack(MaterialPrefix.dust, Materials.Molybdenum, 1) - .getItem()) - && solid.mOutputs[1].getCount() == 1, - "Powellite solid outputs retain declaration order and quantities"); - helper.assertTrue( - Arrays.stream(solid.mFluidOutputs) - .anyMatch(output -> output != null - && output.getAmount() == 4000 - && "oxygen".equals(BuiltInRegistries.FLUID - .getKey(output.getFluid()) - .getPath())), - "Powellite oxygen output uses the declared gas conversion"); - var water = new FluidStack(net.minecraft.world.level.material.Fluids.WATER, 3000); - var liquid = find(MachineRecipeMaps.Electrolyzer, - List.of(new ItemStack(GTTechnological.selectorTag(0))), List.of(water)); - helper.assertTrue(liquid != null, "water decomposition is queryable with fluid input"); - var alloy = gregtech.engine.material.GTMaterialRegistry.get("AluminiumAlloy"); - var alloyDust = GTItems.getStack(MaterialPrefix.dust, alloy, 45); - var alloyBlock = gregtech.content.registry.GTBlocks.getStack( - gregtech.engine.prefix.BlockMaterialPrefix.blockDust, alloy); - alloyBlock.setCount(5); - helper.assertTrue( - find(MachineRecipeMaps.Centrifuge, List.of(alloyDust), List.of()) != null - && find(MachineRecipeMaps.Centrifuge, List.of(alloyBlock), List.of()) != null, - "AluminiumAlloy without a fluid binding retains both solid decomposition inputs"); - helper.assertTrue(Arrays.stream(solid.mOutputs).anyMatch(s -> s != null && !s.isEmpty()) - || Arrays.stream(solid.mFluidOutputs).anyMatch(s -> s != null && !s.isEmpty()), "solid decomposition has outputs"); - helper.assertTrue(Arrays.stream(liquid.mFluidOutputs).anyMatch(s -> s != null && !s.isEmpty()), "water decomposition has fluid outputs"); - write(helper, "decomposition.tsv", List.of(signature(MachineRecipeMaps.Electrolyzer, solid), signature(MachineRecipeMaps.Electrolyzer, liquid))); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void decompositionRespectsFormsAndExactFluidIdentities(GameTestHelper helper) { - var owned = gregtech.content.recipe.DecompositionRecipeLoader.owned(); - for (var test : MaterialBaselineAddon.DECOMPOSITIONS) { - var material = gregtech.engine.material.GTMaterialRegistry.get(test.material()); - var key = new MaterialKey(material.getName()); - helper.assertTrue(MaterialInfoTool.currentProcess(key, MaterialProcessKeys.DECOMPOSITION) - .equals(GregTechMaterials.processes().findSingle(key, MaterialProcessKeys.DECOMPOSITION)), - test.material() + " process queries agree"); - var dust = GTItems.getStack(MaterialPrefix.dust, material, 9); - var block = gregtech.content.registry.GTBlocks.getStack( - gregtech.engine.prefix.BlockMaterialPrefix.blockDust, material); - helper.assertFalse(dust.isEmpty() || block.isEmpty(), test.material() + " solid fixtures registered"); - boolean dustRow = owned.stream().anyMatch(row -> Arrays.stream(row.mInputs) - .anyMatch(input -> input != null && input.is(dust.getItem()))); - boolean blockRow = owned.stream().anyMatch(row -> Arrays.stream(row.mInputs) - .anyMatch(input -> input != null && input.is(block.getItem()))); - helper.assertTrue(dustRow == test.form().equals("dust"), test.material() + " dust permission"); - helper.assertTrue(blockRow == test.form().equals("blockDust"), test.material() + " block permission"); - String fluidId = test.fluid() == null || !test.fluid().contains(":") - ? "material_baseline_test:" + test.material().toLowerCase(java.util.Locale.ROOT) - : test.fluid(); - var id = ResourceLocation.tryParse(fluidId); - boolean registered = id != null && BuiltInRegistries.FLUID.containsKey(id); - boolean allowsFluid = test.form().equals("liquid") || test.form().equals("gas"); - Recipe row = null; - if (registered) { - var fluid = BuiltInRegistries.FLUID.get(id); - row = owned.stream().filter(candidate -> Arrays.stream(candidate.mFluidInputs) - .anyMatch(input -> input != null && input.getFluid() == fluid)).findFirst().orElse(null); - } - helper.assertTrue((row != null) == (registered && allowsFluid), test.material() + " fluid permission and identity"); - if (row != null) { - helper.assertTrue(row.mFluidInputs.length == 1 && row.mFluidInputs[0].getAmount() == 1000, - test.material() + " exact fluid conversion after recipe reduction"); - helper.assertTrue(row.mOutputs.length == 1 && row.mOutputs[0].getCount() == 1 - && row.mOutputs[0].is(GTItems.getStack(MaterialPrefix.dust, Materials.Iron, 1).getItem()), - test.material() + " complete solid output"); - helper.assertTrue(row.mDuration == 292 && row.mEUt == 126, - test.material() + " reduced duration and unchanged EU/t"); - } - } - var outputMaterial = gregtech.engine.material.GTMaterialRegistry.get("BaselineFluidOutput"); - var outputRow = find(MachineRecipeMaps.Centrifuge, - List.of(GTItems.getStack(MaterialPrefix.dust, outputMaterial, 2)), List.of()); - helper.assertTrue(outputRow != null && outputRow.mFluidOutputs.length == 1, - "namespaced fluid output does not discard the entire decomposition plan"); - helper.assertTrue(outputRow.mFluidOutputs[0].getAmount() == 1000 - && BuiltInRegistries.FLUID.getKey(outputRow.mFluidOutputs[0].getFluid()).toString() - .equals("material_baseline_test:baselineliquidonly"), - "namespaced addon fluid output retains identity and quantity"); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void compositionAdmissionAndCookingPolicyStayIndependent(GameTestHelper helper) { - var descriptive = ItemMaterialRegistry.entries().entrySet().stream() - .filter(entry -> entry.getValue().sources().stream() - .anyMatch(source -> source.kind() == ItemCompositionSource.Kind.VANILLA_JSON)) - .findFirst() - .orElseThrow(); - var stack = new ItemStack(descriptive.getKey()); - helper.assertTrue(ItemMaterialRegistry.get(stack).isPresent(), "descriptive composition is queryable"); - helper.assertTrue(ItemMaterialRegistry.canMelt(stack), "composition existence remains independently meltable"); - helper.assertTrue( - ItemMaterialRegistry.canRecover(stack), - "GT6 has no separate item-level bulk recovery authorization"); - helper.assertTrue( - ItemMaterialRegistry.recoveryRejection(stack) - == ItemMaterialRegistry.RecoveryRejection.ELIGIBLE, - "composition admission remains independent of the selected process"); - helper.assertFalse( - ItemMaterialRegistry.hasMaterialProcessingRule(stack), - "descriptive vanilla data does not delete material cooking rules"); - var materialItem = GTItems.getStack(MaterialPrefix.ingot, Materials.Iron, 1); - helper.assertTrue( - ItemMaterialRegistry.hasMaterialProcessingRule(materialItem), - "native material forms retain material cooking policy"); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void addonThermalRecoveryUsesDeclaredTargetAndPhase(GameTestHelper helper) { - var material = gregtech.engine.material.GTMaterialRegistry.get("BaselineThermalAddon"); - var dust = GTItems.getStack(MaterialPrefix.dust, material, 1); - helper.assertFalse(dust.isEmpty(), "addon dust form is registered"); - var smelting = GregTechMaterials.processes() - .findSingle(new MaterialKey(material.getName()), MaterialProcessKeys.SMELTING) - .filter(rule -> rule.value().amount() > 0) - .orElseThrow(); - helper.assertTrue( - material.getName().equals(smelting.value().material().name()), - "addon smelting target is its declared material"); - helper.assertTrue( - gregtech.engine.recipe.chem.MaterialFluidBinding.findAll(material.getName()).size() == 1, - "addon has one declared thermal phase"); - var composition = ItemMaterialRegistry.base(dust.getItem()).orElseThrow(); - helper.assertTrue( - composition.prefix() == MaterialPrefix.dust - && composition.material().resolve() == material - && composition.components().size() == 1, - "addon dust uses its authoritative composition"); - helper.assertTrue(ItemMaterialRegistry.canRecover(dust), "addon dust is recoverable"); - var recipe = find(MachineRecipeMaps.Smelter, List.of(dust), List.of()); - var matchingRows = MachineRecipeMaps.Smelter.mRecipeList.stream() - .filter(row -> row.mInputs.length == 1 - && !row.mInputs[0].isEmpty() - && row.mInputs[0].getItem() == dust.getItem()) - .toList(); - helper.assertTrue( - recipe != null, - "addon material participates in thermal recovery; matching-row-count=" - + matchingRows.size() - + "; input-matches=" - + matchingRows.stream().anyMatch(row -> row.matchesItemInput(0, dust))); - helper.assertTrue( - Arrays.stream(recipe.mFluidOutputs) - .anyMatch(output -> output != null && !output.isEmpty()), - "addon thermal row uses its declared native phase"); - helper.assertTrue( - Arrays.stream(recipe.mFluidOutputs).anyMatch(output -> output.getAmount() == 1000), - "one addon material unit uses its declared 1000 mB phase scale"); - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void tagCandidateReplacementIsAtomicAndRemovalIsObservable(GameTestHelper helper) { - var item = Items.DRAGON_EGG; - helper.assertTrue(ItemMaterialRegistry.explicit(item).isEmpty(), "tag probe item has no explicit composition"); - var first = taggedComposition(Materials.Copper, 4); - try { - ItemMaterialRegistry.publishTagCandidates(Map.of(item, List.of(first))); - var effective = ItemMaterialRegistry.base(item).orElseThrow(); - var diagnosis = ItemMaterialRegistry.compositionDiagnosis(item).orElseThrow(); - helper.assertTrue( - effective.equals(diagnosis.selected()), - "composition diagnosis exposes the effective selection"); - helper.assertTrue( - diagnosis.decisions().stream() - .anyMatch(decision -> decision.status() - == gregtech.engine.material.ItemCompositionDecision.Status.SELECTED), - "composition diagnosis records the selected source"); - long revision = ItemMaterialRegistry.compositionRevision(); - var generation = ItemMaterialRegistry.compositionState(); - - ItemMaterialRegistry.beginTagGeneration(); - var pending = ItemMaterialRegistry.compositionState(); - helper.assertFalse(pending.tagInputReady(), "a new tag generation starts before its input is ready"); - helper.assertTrue( - pending.tagGeneration() == generation.tagGeneration() + 1, - "starting a session advances the tag generation exactly once"); - helper.assertTrue( - ItemMaterialRegistry.base(item).isEmpty(), - "a new generation does not expose the previous server's tag candidates"); - helper.assertTrue(pending.explicitClosed(), "explicit definitions remain process-static"); - ItemMaterialRegistry.publishTagCandidates(Map.of(item, List.of(first))); - revision = ItemMaterialRegistry.compositionRevision(); - - IllegalStateException conflict = null; - try { - ItemMaterialRegistry.publishTagCandidates(Map.of( - item, - List.of(taggedComposition(Materials.Iron, 1), taggedComposition(Materials.Gold, 2)))); - } catch (IllegalStateException failure) { - conflict = failure; - } - helper.assertTrue(conflict != null, "conflicting tag candidates must fail"); - helper.assertTrue( - effective.equals(ItemMaterialRegistry.base(item).orElseThrow()), - "failed tag publication preserves the previous effective composition"); - helper.assertTrue( - ItemMaterialRegistry.compositionRevision() == revision, - "failed tag publication does not advance the composition revision"); - - ItemMaterialRegistry.publishTagCandidates(Map.of(item, List.of())); - helper.assertTrue( - ItemMaterialRegistry.base(item).isEmpty(), - "removed tag candidates drop the effective composition"); - helper.assertTrue( - ItemMaterialRegistry.compositionDiagnosis(item).isEmpty(), - "removed tag candidates also withdraw their diagnosis"); - - var descriptive = ItemMaterialRegistry.entries().entrySet().stream() - .filter(entry -> entry.getValue().sources().stream() - .anyMatch(source -> source.kind() == ItemCompositionSource.Kind.VANILLA_JSON)) - .findFirst() - .orElseThrow(); - var declaredItem = descriptive.getKey(); - ItemMaterialRegistry.publishTagCandidates( - Map.of(declaredItem, List.of(taggedComposition(MaterialPrefix.ingot, Materials.Iron, GTValues.U)))); - helper.assertTrue( - ItemMaterialRegistry.base(declaredItem).orElseThrow().sources().stream() - .allMatch(source -> source.kind() == ItemCompositionSource.Kind.VANILLA_JSON), - "explicit JSON remains the selected composition over a tag fallback"); - helper.assertFalse( - ItemMaterialRegistry.hasMaterialProcessingRule(new ItemStack(declaredItem)), - "a discarded lower-priority tag does not authorize cooking rules"); - - boolean closed = false; - try { - ItemMaterialRegistry.register( - Items.DRAGON_EGG, - new ItemComposition(null, Materials.Copper, 4), - ItemCompositionSource.Kind.VANILLA_JSON, - "gt6ce:test/closed-explicit", - "GameTest closed explicit registration"); - } catch (IllegalStateException expected) { - closed = expected.getMessage().contains("closed"); - } - helper.assertTrue(closed, "explicit item composition registration closes after final validation"); - } finally { - ItemMaterialRegistry.publishTagCandidates(Map.of(item, List.of())); - } - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void failedTagGenerationRestoresThePreviousPublicationState(GameTestHelper helper) { - var item = Items.DRAGON_EGG; - var previous = taggedComposition(Materials.Copper, 4); - try { - ItemMaterialRegistry.publishTagCandidates(Map.of(item, List.of(previous))); - var previousComposition = ItemMaterialRegistry.base(item).orElseThrow(); - var previousDiagnosis = ItemMaterialRegistry.compositionDiagnosis(item).orElseThrow(); - var previousState = ItemMaterialRegistry.compositionState(); - var previousPublication = MaterialPublication.current(); - - var checkpoint = ItemMaterialRegistry.beginTagGeneration(); - ItemMaterialRegistry.publishTagCandidates( - Map.of(item, List.of(taggedComposition(Materials.Iron, GTValues.U)))); - helper.assertFalse( - previousComposition.equals(ItemMaterialRegistry.base(item).orElseThrow()), - "a pending tag generation can replace the effective composition"); - - ItemMaterialRegistry.restoreTagGeneration(checkpoint); - helper.assertTrue( - previousComposition.equals(ItemMaterialRegistry.base(item).orElseThrow()), - "rolling back a failed generation restores the previous effective composition"); - helper.assertTrue( - previousDiagnosis.equals(ItemMaterialRegistry.compositionDiagnosis(item).orElseThrow()), - "rolling back a failed generation restores the previous composition diagnosis"); - helper.assertTrue( - previousState.equals(ItemMaterialRegistry.compositionState()), - "rolling back a failed generation restores readiness, generation and revision state"); - helper.assertTrue( - previousPublication == MaterialPublication.current(), - "rolling back a failed generation leaves the last successful publication untouched"); - } finally { - ItemMaterialRegistry.publishTagCandidates(Map.of(item, List.of())); - } - helper.succeed(); - } - - @GameTest(template = "test_empty", batch = BATCH, timeoutTicks = 200) - public static void tagDrivenShredderRowsFollowTheEffectiveSnapshot(GameTestHelper helper) { - var item = Items.CARROT_ON_A_STICK; - var stack = new ItemStack(item); - helper.assertTrue(ItemMaterialRegistry.explicit(item).isEmpty(), "probe item starts without explicit material"); - var cachedSnapshot = ItemMaterialRegistry.entries(); - helper.assertTrue( - cachedSnapshot == ItemMaterialRegistry.entries(), - "unchanged composition revision reuses the traversal snapshot"); - try { - ItemMaterialRegistry.publishTagCandidates( - Map.of(item, List.of(taggedComposition(MaterialPrefix.ingot, Materials.Copper, GTValues.U)))); - helper.assertFalse( - cachedSnapshot == ItemMaterialRegistry.entries(), - "published tag changes invalidate the traversal snapshot"); - gregtech.content.recipe.ShredderRecyclingRecipes.rebuildTagRows(); - var recipe = find(MachineRecipeMaps.Shredder, List.of(stack), List.of()); - helper.assertTrue(recipe != null, "tag-derived composition creates a Shredder row"); - helper.assertTrue(recipe.mMaterialRecovery, "tag-derived Shredder row uses recovery admission"); - helper.assertTrue( - Arrays.stream(recipe.mOutputs) - .anyMatch(output -> output.is(GTItems.getStack(MaterialPrefix.dust, Materials.Copper, 1) - .getItem())), - "tag-derived Shredder row uses the resolved composition"); - var damaged = stack.copy(); - damaged.setDamageValue(1); - helper.assertTrue( - find(MachineRecipeMaps.Shredder, List.of(damaged), List.of()) != null, - "tag-derived Shredder row rebuilds output from damaged input"); - CraftingMaterialForms.rebuild(true); - var resolvedForm = CraftingMaterialForms.form(stack); - helper.assertTrue( - resolvedForm != null - && resolvedForm.prefix().equals("ingot") - && resolvedForm.material().equals("Copper"), - "form consumers read the resolved tag composition"); - gregtech.engine.material.MaterialFormContent.publish(); - helper.assertTrue( - GregTechMaterials.formBindings().find(new MaterialKey("Copper")).stream() - .anyMatch(binding -> binding.id().equals("minecraft:carrot_on_a_stick")), - "published form bindings include the tag-derived item"); - - ItemMaterialRegistry.publishTagCandidates(Map.of()); - gregtech.content.recipe.ShredderRecyclingRecipes.rebuildTagRows(); - helper.assertTrue( - ItemMaterialRegistry.compositionStatus(item) - == ItemMaterialRegistry.CompositionLookupState.ABSENT, - "cleared tag generation remains distinct from an unpublished generation"); - helper.assertTrue( - find(MachineRecipeMaps.Shredder, List.of(stack), List.of()) == null, - "removing the tag composition withdraws its Shredder row"); - gregtech.engine.material.MaterialFormContent.publish(); - helper.assertFalse( - GregTechMaterials.formBindings().find(new MaterialKey("Copper")).stream() - .anyMatch(binding -> binding.id().equals("minecraft:carrot_on_a_stick")), - "removing the tag composition withdraws its public form binding"); - } finally { - ItemMaterialRegistry.publishTagCandidates(Map.of()); - gregtech.content.recipe.ShredderRecyclingRecipes.clearTagRows(); - CraftingMaterialForms.rebuild(); - } - helper.succeed(); - } - - // GameTest runs batches sequentially, so the asynchronous reload cannot overlap other tests. - @GameTest(template = "test_empty", batch = "material_baseline_reload", timeoutTicks = 6000) - public static void realResourceReloadDoesNotAccumulateRules(GameTestHelper helper) { - var server = helper.getLevel().getServer(); - var packs = List.copyOf(server.getPackRepository().getSelectedIds()); - int applications = MachineRecipeOverlay.applications(); - long compositionRevision = ItemMaterialRegistry.compositionRevision(); - var compositions = compositionSnapshot(); - capture(helper, "startup"); - var before = ownedCounts(); - var sample = describe(new ItemStack(Items.IRON_BLOCK)); - RELOAD_COMPLETE.set(false); - RELOAD_FAILURE.set(null); - server.reloadResources(packs).thenCompose(ignored -> server.reloadResources(packs)).whenComplete((ignored, failure) -> { - RELOAD_FAILURE.set(failure); - RELOAD_COMPLETE.set(true); - }); - awaitReload(helper, applications, compositionRevision, compositions, before, sample); - } - - private static void awaitReload( - GameTestHelper helper, - int applications, - long compositionRevision, - Map compositions, - List before, - String sample) { - if (!RELOAD_COMPLETE.get()) { - helper.runAfterDelay( - 1, () -> awaitReload(helper, applications, compositionRevision, compositions, before, sample)); - return; - } - var failure = RELOAD_FAILURE.get(); - if (failure != null) { - helper.fail("resource reload failed: " + failure); - return; - } - helper.assertTrue( - MachineRecipeOverlay.applications() >= applications + 2, - "both real reloads applied the overlay"); - helper.assertTrue( - before.equals(ownedCounts()), "owned rules do not accumulate: " + before + " -> " + ownedCounts()); - helper.assertTrue( - sample.equals(describe(new ItemStack(Items.IRON_BLOCK))), - "fixed composition is stable after reload"); - helper.assertTrue( - ItemMaterialRegistry.compositionRevision() >= compositionRevision, - "reload invalidates composition-dependent caches"); - helper.assertTrue( - MachineRecipeOverlay.lastPublication().recipeRevision() == MachineRecipeOverlay.generation(), - "the successful recipe overlay publishes one stable material/composition/recipe stamp"); - helper.assertTrue( - MachineRecipeOverlay.lastPublication().compositionRevision() - == ItemMaterialRegistry.compositionRevision(), - "the publication stamp names the composition snapshot used by the recipe overlay"); - helper.assertTrue( - compositions.equals(compositionSnapshot()), - "repeat reload preserves effective composition membership and values"); - capture(helper, "reload"); - var reloadedRecipe = find(MachineRecipeMaps.Shredder, List.of(new ItemStack(Items.IRON_INGOT)), List.of()); - helper.assertTrue( - reloadedRecipe != null, - "iron ingot recycling remains queryable after reload"); - var powellite = - GTItems.getStack(MaterialPrefix.dust, gregtech.engine.material.GTMaterialRegistry.get("Powellite"), 6); - var reloadedDecomposition = find( - MachineRecipeMaps.Electrolyzer, - List.of(new ItemStack(GTTechnological.selectorTag(0)), powellite), - List.of()); - helper.assertTrue(reloadedDecomposition != null, "decomposition row is rebuilt after reload"); - helper.succeed(); - } - - private static List ownedCounts() { - return List.of(gregtech.content.recipe.ExternalOreProcessing.owned().size(), - gregtech.content.recipe.DecompositionRecipeLoader.owned().size(), - gregtech.content.recipe.ShredderRecyclingRecipes.owned().size(), - gregtech.content.recipe.SharedThermalInputRows.owned().size()); - } - - private static Recipe find(RecipeMap map, List items, List fluids) { - return map.findRecipe(items, fluids, false, map.mInputItemsCount, map.mOutputItemsCount); - } - - private static String id(ItemStack stack) { return BuiltInRegistries.ITEM.getKey(stack.getItem()).toString(); } - - private static ItemComposition taggedComposition(gregtech.api.material.GTMaterial material, long amount) { - return taggedComposition(null, material, amount); - } - - private static ItemComposition taggedComposition( - MaterialPrefix prefix, gregtech.api.material.GTMaterial material, long amount) { - return new ItemComposition( - prefix, - List.of(gregtech.api.material.MaterialComponent.of(material, amount)), - material, - List.of(new ItemCompositionSource(ItemCompositionSource.Kind.FORM_TAG, "probe", "test", "", "")), - true); - } - - private static Map compositionSnapshot() { - var entries = new TreeMap(); - for (var entry : ItemMaterialRegistry.entries().entrySet()) - entries.put(id(new ItemStack(entry.getKey())), entry.getValue()); - return Map.copyOf(entries); - } - - private static String describe(ItemStack stack) { - var data = ItemMaterialRegistry.get(stack).orElse(null); - String state = "\tdamage=" + stack.getDamageValue() + "/" + stack.getMaxDamage() + "\tshape=" + MoldItemData.shape(stack); - if (data == null) return id(stack) + "\tabsent" + state; - return id(stack) + "\t" + (data.prefix() == null ? "-" : data.prefix().getName()) - + "\t" + data.material().resolve().getName() + "\t" + data.components().stream() - .map(c -> c.material().resolve().getName() + "=" + c.amount()).sorted().collect(Collectors.joining(",")) - + "\t" + data.bulkRecoveryAllowed() + "\t" + ItemMaterialRegistry.canRecover(stack) - + "\t" + ItemMaterialRegistry.canMelt(stack) + "\t" + ItemMaterialRegistry.hasStoredContents(stack) - + "\t" + CrucibleItemInput.parse(stack).stream().map(c -> c.material.getName() + "=" + c.amount).sorted().collect(Collectors.joining(",")) - + "\t" + data.source() + state; - } - - private static void observe(GameTestHelper helper, String name, ItemStack stack) { - write(helper, name.replace(':', '_') + ".tsv", List.of(describe(stack))); - } - - private static String signature(RecipeMap map, Recipe row) { - var slots = new ArrayList(); - for (int i = 0; i < row.mInputs.length; i++) { - var unit = row.materialInputDisplay(i); - // A tag's representative is selected from an unordered set; it is not the input contract. - String input = row.itemTag(i) == null ? item(row.mInputs[i]) - : "tag:" + row.itemTag(i).location() + "*" + row.mInputs[i].getCount(); - slots.add("in[" + i + "]=" + input + (unit == null ? "" : ":unit:" + unit.amount() + ":" + unit.rounding()) - + ":tag=" + (row.itemTag(i) == null ? "-" : row.itemTag(i).location()) - + ":catalyst=" + row.isCatalystInput(i) + ":guard=" + row.hasItemInputGuard(i)); - } - for (int i = 0; i < row.mOutputs.length; i++) slots.add("out[" + i + "]=" + item(row.mOutputs[i]) + ":chance=" + row.getOutputChance(i)); - for (int i = 0; i < row.mFluidInputs.length; i++) slots.add("fluidIn[" + i + "]=" - + (row.fluidTag(i) == null ? fluid(row.mFluidInputs[i]) - : "tag:" + row.fluidTag(i).location() + "*" + row.mFluidInputs[i].getAmount()) - + ":tag=" + (row.fluidTag(i) == null ? "-" : row.fluidTag(i).location()) - + ":catalyst=" + row.isCatalystFluidInput(i) + ":presence=" + row.isPresenceFluidInput(i)); - for (int i = 0; i < row.mFluidOutputs.length; i++) slots.add("fluidOut[" + i + "]=" + fluid(row.mFluidOutputs[i])); - return map.mNameInternal + "\t" + String.join(";", slots) + "\t" + row.mDuration + "\t" + row.mEUt + "\t" + row.mSpecialValue - + "\t" + row.mEnabled + "/" + row.mFakeRecipe + "/" + row.mNeedsEmptyOutput + "/" + row.mMaterialRecovery - + "/" + row.mRequiresEmptyContainerInputs + "/" + row.mExactItemInputs + "/" + row.mExplicitCatalystsOnly; - } - - private static String item(ItemStack stack) { return stack == null || stack.isEmpty() ? "-" : id(stack) + "*" + stack.getCount(); } - private static String fluid(FluidStack stack) { return stack == null || stack.isEmpty() ? "-" : BuiltInRegistries.FLUID.getKey(stack.getFluid()) + "*" + stack.getAmount(); } - - private static void capture(GameTestHelper helper, String phase) { - write(helper, phase + "-items.tsv", BuiltInRegistries.ITEM.stream().map(ItemStack::new) - .filter(s -> ItemMaterialRegistry.base(s.getItem()).isPresent()).map(MaterialBaselineTests::describe).sorted().toList()); - var rows = new ArrayList(); - for (var map : RecipeMap.RECIPE_MAP_LIST) for (var row : map.mRecipeList) rows.add(signature(map, row)); - rows.sort(String::compareTo); - write(helper, phase + "-recipes.tsv", rows); - var tags = new java.util.TreeMap(); - for (var map : RecipeMap.RECIPE_MAP_LIST) for (var row : map.mRecipeList) { - for (int i = 0; i < row.mInputs.length; i++) { - var tag = row.itemTag(i); - if (tag != null) tags.computeIfAbsent("item:" + tag.location(), key -> BuiltInRegistries.ITEM.getTag(tag) - .map(set -> set.stream().map(holder -> BuiltInRegistries.ITEM.getKey(holder.value()).toString()) - .sorted().collect(Collectors.joining(","))).orElse("")); - } - for (int i = 0; i < row.mFluidInputs.length; i++) { - var tag = row.fluidTag(i); - if (tag != null) tags.computeIfAbsent("fluid:" + tag.location(), key -> BuiltInRegistries.FLUID.getTag(tag) - .map(set -> set.stream().map(holder -> BuiltInRegistries.FLUID.getKey(holder.value()).toString()) - .sorted().collect(Collectors.joining(","))).orElse("")); - } - } - write(helper, phase + "-tags.tsv", tags.entrySet().stream().map(entry -> entry.getKey() + "\t" + entry.getValue()).toList()); - write(helper, phase + "-forms.tsv", BuiltInRegistries.ITEM.stream() - .filter(item -> item instanceof gregtech.engine.material.MaterialFormItem) - .map(item -> { - var form = (gregtech.engine.material.MaterialFormItem) item; - return BuiltInRegistries.ITEM.getKey(item) + "\t" + form.getPrefix().getName() + "\t" - + form.getMaterial().resolve().getName() + "\t" + form.getPrefix().getMaterialWeight() - + "\t" + form.getPrefix().isValidFor(form.getMaterial()); - }).sorted().toList()); - write(helper, phase + "-block-forms.tsv", BuiltInRegistries.BLOCK.stream() - .filter(block -> block instanceof gregtech.content.block.MaterialBlockLike) - .map(block -> { - var form = (gregtech.content.block.MaterialBlockLike) block; - return BuiltInRegistries.BLOCK.getKey(block) + "\t" + BuiltInRegistries.ITEM.getKey(block.asItem()) - + "\t" + form.prefix().getName() + "\t" + form.material().resolve().getName() - + "\t" + form.prefix().getMaterialWeight() + "\t" + form.prefix().isValidFor(form.material()); - }).sorted().toList()); - } - - private static void write(GameTestHelper helper, String file, List rows) { - try { - Path run = Path.of("").toAbsolutePath(); - Path root = run; - while (root != null && !Files.isRegularFile(root.resolve("settings.gradle"))) root = root.getParent(); - if (root == null) throw new IllegalStateException("cannot find repository root for baseline output"); - Path output = root.resolve("work/material-system-refactor/runtime") - .resolve(net.minecraft.SharedConstants.getCurrentVersion().getName()).resolve(run.getFileName()); - Files.createDirectories(output); - Files.write(output.resolve(file), rows); - } catch (Exception failure) { helper.fail("cannot write material baseline: " + failure); } - } -} diff --git a/minecraft/src/test/resources/META-INF/services/gregtech.api.addon.material.AddonMaterialContributor b/minecraft/src/test/resources/META-INF/services/gregtech.api.addon.material.AddonMaterialContributor deleted file mode 100644 index 50cc4dc9a..000000000 --- a/minecraft/src/test/resources/META-INF/services/gregtech.api.addon.material.AddonMaterialContributor +++ /dev/null @@ -1 +0,0 @@ -gregtech.gametest.MaterialBaselineAddon diff --git a/minecraft/versions/1.20.1-forge/src/main/java/gregtech/GregTech.java b/minecraft/versions/1.20.1-forge/src/main/java/gregtech/GregTech.java index 5470acf82..9301a5654 100644 --- a/minecraft/versions/1.20.1-forge/src/main/java/gregtech/GregTech.java +++ b/minecraft/versions/1.20.1-forge/src/main/java/gregtech/GregTech.java @@ -2,8 +2,11 @@ import com.mojang.logging.LogUtils; import gregtech.bootstrap.InitializationStep; -import gregtech.bootstrap.content.*; -import gregtech.bootstrap.registration.*; +import gregtech.bootstrap.content.DataBootstrap; +import gregtech.bootstrap.content.MaterialBootstrap; +import gregtech.bootstrap.content.ToolBootstrap; +import gregtech.bootstrap.registration.MaterialItemRegistration; +import gregtech.bootstrap.registration.MaterialLinkBootstrap; import gregtech.engine.material.GTMaterialRegistry; import gregtech.network.GTPackets; import net.minecraft.resources.ResourceLocation; diff --git a/minecraft/versions/1.20.1-forge/src/main/java/gregtech/content/registry/GTMaterialRegistration.java b/minecraft/versions/1.20.1-forge/src/main/java/gregtech/content/registry/GTMaterialRegistration.java index cedf6c8c4..c1e15bbc5 100644 --- a/minecraft/versions/1.20.1-forge/src/main/java/gregtech/content/registry/GTMaterialRegistration.java +++ b/minecraft/versions/1.20.1-forge/src/main/java/gregtech/content/registry/GTMaterialRegistration.java @@ -3,9 +3,7 @@ import static gregtech.engine.mod.GregTechIdentity.REGISTRY_NAMESPACE; import gregtech.GregTech; -import gregtech.api.material.GTMaterial; import gregtech.api.material.GTValues; -import gregtech.content.data.MaterialPrefixes; import gregtech.content.material.MaterialItemCompositions; import gregtech.engine.material.ItemMaterialRegistry; import net.minecraft.resources.ResourceLocation; @@ -21,7 +19,6 @@ public static void registerAll() { GregTech.LOGGER.info("[{}] Registering GT platform block item materials", GregTech.NAMESPACE); MaterialItemCompositions.registerCommon(); int count = registerIconSetOres(); - count += registerOwnedOres(); count += registerPlants(); GregTech.LOGGER.info("[{}] Registered {} Forge-specific block item compositions", GregTech.NAMESPACE, count); } @@ -34,33 +31,7 @@ private static int registerIconSetOres() { if (block instanceof gregtech.content.block.BlackSandBlock sand) { ItemMaterialRegistry.register(sand.asItem(), null, sand.material(), GTValues.U * 9); count++; - } else if (block instanceof gregtech.content.block.DenseOreBlock ore) { - GTMaterial material = ore.material(); - if (material != null && material.isValid()) { - ItemMaterialRegistry.register(block.asItem(), MaterialPrefixes.oreDense.getDelegate(), material); - count++; - } - } else if (block instanceof gregtech.content.block.VanillaOreBlock ore) { - GTMaterial material = ore.material(); - if (material != null && material.isValid()) { - ItemMaterialRegistry.register( - block.asItem(), MaterialPrefixes.oreVanillastone.getDelegate(), material); - count++; - } - } - } - return count; - } - - private static int registerOwnedOres() { - int count = 0; - for (RegisteredBlock entry : GTBlocks.allEntries()) { - if (!entry.isPresent()) continue; - if (entry.get() instanceof gregtech.content.block.OreBlock ore && !ore.isSmall()) { - ItemMaterialRegistry.register( - ore.asItem(), MaterialPrefixes.oreVanillastone.getDelegate(), ore.material()); - count++; - } + } else if (MaterialItemCompositions.registerOreBlockComposition(block)) count++; } return count; } diff --git a/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/client/LaserClientSetup.java b/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/client/LaserClientSetup.java index 3eb761b3f..b3f72d4b4 100644 --- a/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/client/LaserClientSetup.java +++ b/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/client/LaserClientSetup.java @@ -1,7 +1,9 @@ package gregtech.client; -import gregtech.content.block.energy.*; -import gregtech.content.registry.*; +import gregtech.content.block.energy.LaserConverterBlock; +import gregtech.content.block.energy.ZpmDischargerBlock; +import gregtech.content.block.energy.ZpmModuleBlock; +import gregtech.content.registry.GTLasers; @net.neoforged.fml.common.EventBusSubscriber( modid = gregtech.engine.mod.GregTechIdentity.MOD_ID, diff --git a/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/client/StorageContainerClientSetup.java b/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/client/StorageContainerClientSetup.java index 8d16a2780..51ee6c0e6 100644 --- a/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/client/StorageContainerClientSetup.java +++ b/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/client/StorageContainerClientSetup.java @@ -1,6 +1,9 @@ package gregtech.client; -import gregtech.content.registry.*; +import gregtech.content.registry.GTBlockEntities; +import gregtech.content.registry.GTManualStations; +import gregtech.content.registry.GTMenuTypes; +import gregtech.content.registry.GTStorageContainers; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; diff --git a/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/content/registry/GTSpecialOreBlocks.java b/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/content/registry/GTSpecialOreBlocks.java index ec11967a6..f9e235c49 100644 --- a/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/content/registry/GTSpecialOreBlocks.java +++ b/minecraft/versions/1.21.1-neoforge/src/main/java/gregtech/content/registry/GTSpecialOreBlocks.java @@ -4,6 +4,7 @@ import gregtech.content.block.*; import gregtech.content.data.MaterialPrefix; +import gregtech.content.material.MaterialItemCompositions; import gregtech.engine.material.ItemMaterialRegistry; import java.util.ArrayList; import java.util.Collections; @@ -79,11 +80,7 @@ private static Block create(String icon) { public static void registerCompositions() { for (var holder : ALL) { - Block block = holder.get(); - if (block instanceof DenseOreBlock ore) - ItemMaterialRegistry.register(block.asItem(), MaterialPrefix.oreDense, ore.material()); - else if (block instanceof VanillaOreBlock ore) - ItemMaterialRegistry.register(block.asItem(), MaterialPrefix.oreVanillastone, ore.material()); + MaterialItemCompositions.registerOreBlockComposition(holder.get()); } ItemMaterialRegistry.register( GTItems.getStack(MaterialPrefix.plate, gregtech.content.material.generated.WoodMaterials.WoodTreated) diff --git a/minecraft/versions/1.21.1-neoforge/src/main/resources/gregtech-neoforge.mixins.json b/minecraft/versions/1.21.1-neoforge/src/main/resources/gregtech-neoforge.mixins.json index 442d9f1f6..07415a5d1 100644 --- a/minecraft/versions/1.21.1-neoforge/src/main/resources/gregtech-neoforge.mixins.json +++ b/minecraft/versions/1.21.1-neoforge/src/main/resources/gregtech-neoforge.mixins.json @@ -5,66 +5,66 @@ "plugin": "gregtech.mixin.GTOptimizationMixinPlugin", "compatibilityLevel": "JAVA_21", "mixins": [ - "GTStateTransitionsMixin", - "MaterialIngredientCandidatesMixin", - "FormConversionServerPlaceMixin", - "PolymorphToolResultMixin", - "DungeonRedstoneInitializationMixin", - "OreHostHardnessMixin", - "SpectatorMenuMixin", - "OreHostToolSpeedMixin", - "VanillaToolDurabilityMixin", - "VanillaToolDurabilityBarMixin", - "GasImmersionMixin", - "ConstructionRecipeMixin", - "VanillaOreConfigMixin", - "VanillaOreVeinMixin", - "LegacyConstructionStackMixin", - "BaseSpawnerAccessor", - "CraftingFormPositionMixin", - "FormConversionRecipeCacheMixin", - "PolymorphFormConversionCacheMixin", "AbstractMinecartSpeedCapMixin", + "AutoCollectDropMixin", + "BaseSpawnerAccessor", "BlockEntityPaintMixin", - "WolfCollarAccessor", - "EntityFallingOreDropMixin", - "ColoredBookUseMixin", "ColoredBookLecternMixin", - "ComponentCoverHostMixin", + "ColoredBookUseMixin", "ComponentCoverCapabilitiesMixin", + "ComponentCoverHostMixin", "ComponentCoverRemovalMixin", - "LevelChunkStructureWatchMixin", - "LevelStructureProbeMixin", - "ServerChunkCacheStructureProbeMixin", - "ServerLevelStructureDataMixin", - "CoverDropMixin", - "AutoCollectDropMixin", - "ExperienceOrbCountAccessor", - "CoverWalkMixin", + "ConstructionRecipeMixin", "CoverCollisionMixin", + "CoverDropMixin", "CoverSignalMixin", + "CoverWalkMixin", + "CraftingFormPositionMixin", + "DamageSourceDeathMessageMixin", + "DungeonRedstoneInitializationMixin", + "EndermanEnchantmentMixin", + "EntityFallingOreDropMixin", + "ExperienceOrbCountAccessor", + "FormConversionRecipeCacheMixin", + "FormConversionServerPlaceMixin", + "GasImmersionMixin", + "GTStateTransitionsMixin", + "LegacyConstructionStackMixin", + "LevelChunkStructureWatchMixin", + "LevelStructureProbeMixin", + "MaterialArrowEnchantmentMixin", + "MaterialIngredientCandidatesMixin", + "OreHostHardnessMixin", + "OreHostToolSpeedMixin", + "PolymorphFormConversionCacheMixin", + "PolymorphToolResultMixin", "PotionBrewingAccessor", "PotionBrewingMixAccessor", - "MaterialArrowEnchantmentMixin", - "EndermanEnchantmentMixin", - "DamageSourceDeathMessageMixin" + "ServerChunkCacheStructureProbeMixin", + "ServerLevelStructureDataMixin", + "SpectatorMenuMixin", + "VanillaOreConfigMixin", + "VanillaOreVeinMixin", + "VanillaToolDurabilityBarMixin", + "VanillaToolDurabilityMixin", + "WolfCollarAccessor" ], "injectors": { "defaultRequire": 1 }, "client": [ - "SpectatorCrosshairMixin", - "SpectatorBlockOutlineMixin", - "GeneratedTagLanguageMixin", - "OreTerrainParticleMixin", - "FormConversionGhostPlaceMixin", - "JadeOreHarvestToolMixin", "BlockPaintColorMixin", - "ItemPaintColorMixin", - "GasFluidRenderMixin", - "FluidAlphaConfigMixin", - "EmiStructureFocusMixin", "EmiMaterialUsesMixin", - "ReliableEmiNamespaceMixin" + "EmiStructureFocusMixin", + "FluidAlphaConfigMixin", + "FormConversionGhostPlaceMixin", + "GasFluidRenderMixin", + "GeneratedTagLanguageMixin", + "ItemPaintColorMixin", + "JadeOreHarvestToolMixin", + "OreTerrainParticleMixin", + "ReliableEmiNamespaceMixin", + "SpectatorBlockOutlineMixin", + "SpectatorCrosshairMixin" ] } diff --git a/tools/README.md b/tools/README.md index 93a78c371..a9d33711d 100644 --- a/tools/README.md +++ b/tools/README.md @@ -7,6 +7,7 @@ | [buildtools/](buildtools/README.md) | 将 `core` 中的 1.20.1 配方与物品标签树转换为 1.21.1 原生资源。 | | [comments/](comments/README.md) | 检查 Java 注释中的行号引用、历史叙述与上游符号,并验证纯注释改动。 | | [gui/](gui/README.md) | 检查 GUI 模板、别名、图标引用并生成静态预览。 | +| [material/](material/README.md) | 复核历史材料运行时快照中的形态与配方名册。 | | [recipes/](recipes/README.md) | 审计数据包配方的形状、标签、电路家族、歧义与 NeoForge 覆盖。 | | [resources/](resources/README.md) | 核对模板化发行包的模型、方块状态,审计 PNG 块结构、CRC 与透明像素覆盖。 | | [validation/](validation/README.md) | 读取验证路由表,计算改动对应的检查并校验文档闭合。 | diff --git a/tools/material/README.md b/tools/material/README.md new file mode 100644 index 000000000..dbae8f1ff --- /dev/null +++ b/tools/material/README.md @@ -0,0 +1,39 @@ +# material:材料形态清单审计 + +`audit_roster.py` 只读 GameTest 写出的运行时快照,不启动游戏、不调用 Gradle、不修改仓库。 + +## 输入 + +传入包含以下文件的单个运行目录: + +- `reload-items.tsv` +- `reload-forms.tsv` +- `reload-block-forms.tsv` +- `reload-recipes.tsv` +- `reload-tags.tsv` + +这些文件来自已删除的历史材料基线 GameTest。当前测试集不再生成新快照;本工具仅用于复核仍保存在 `work/` 中的历史证据,不能把旧目录当作当前实现验证。 + +## 运行 + +```bash +python3 tools/material/audit_roster.py \ + work/material-system-refactor/runtime/1.20.1/gametest-forge + +# 完整 JSON 证据放到被忽略的 work/ +python3 tools/material/audit_roster.py \ + work/material-system-refactor/runtime/1.20.1/gametest-forge \ + --json work/material-system-refactor/07e/forge.json +``` + +输出按 prefix 汇总实际物品数、材料方块数、静态配方输出/输入对象数,以及各 `RecipeMap` 的命中数。物品 tag 输入会展开为其实际成员;同一个物品如果同时是材料物品和方块形态,会分别计入两个形态族。 + +## 边界 + +- 配方计数来自 `RecipeMap.mRecipeList`,不展开所有动态族。 +- 手工配方、世界生成、铸币、化石和展示用途没有统一静态表,必须按源码或专门运行时测试补证。 +- 本脚本证明注册清单和静态配方入口的一致性,不替代完整来源/用途图、客户端展示或机器执行验收。 + +## 维护 + +快照列格式变化时同步修改 `recipe_items`、物品 prefix 读取和方块形态读取。若重新建立常驻快照入口,长期字段口径应写入对应的架构或验证文档。 diff --git a/tools/material/audit_roster.py b/tools/material/audit_roster.py new file mode 100644 index 000000000..33da2898c --- /dev/null +++ b/tools/material/audit_roster.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python3 +"""Summarize material forms from a fresh runtime baseline.""" + +from __future__ import annotations + +import argparse +import collections +import csv +import json +import re +from pathlib import Path + + +def recipe_items(slots: str) -> tuple[set[str], set[str], set[str]]: + inputs: set[str] = set() + outputs: set[str] = set() + input_tags: set[str] = set() + for slot in slots.split(";"): + if slot.startswith("in["): + item_match = re.search(r"=(.+?)\*(\d+):", slot) + tag_match = re.search(r":tag=(.+?):catalyst=", slot) + if item_match: + inputs.add(item_match.group(1)) + if tag_match and tag_match.group(1) != "-": + input_tags.add(tag_match.group(1)) + elif slot.startswith("out["): + item_match = re.search(r"=(.+?)\*(\d+):", slot) + if item_match: + outputs.add(item_match.group(1)) + return inputs, outputs, input_tags + + +def main() -> None: + parser = argparse.ArgumentParser() + parser.add_argument("snapshot", type=Path) + parser.add_argument("--json", type=Path) + args = parser.parse_args() + + forms: dict[str, dict[str, str]] = {} + with (args.snapshot / "reload-forms.tsv").open() as source: + for row in csv.reader(source, delimiter="\t"): + if len(row) == 5: + forms[row[0]] = {"prefix": row[1], "material": row[2], "weight": row[3], "valid": row[4]} + + items: dict[str, list[str]] = {} + with (args.snapshot / "reload-items.tsv").open() as source: + for row in csv.reader(source, delimiter="\t"): + items[row[0]] = row + + block_forms: dict[str, dict[str, str]] = {} + with (args.snapshot / "reload-block-forms.tsv").open() as source: + for row in csv.reader(source, delimiter="\t"): + if len(row) == 6: + block_forms[row[1]] = { + "block": row[0], + "prefix": row[2], + "material": row[3], + "weight": row[4], + "valid": row[5], + } + + item_prefixes = { + item: row[1] for item, row in items.items() if len(row) == 12 and row[1] != "-" + } + + tags: dict[str, set[str]] = {} + with (args.snapshot / "reload-tags.tsv").open() as source: + for row in csv.reader(source, delimiter="\t"): + if len(row) == 2 and row[0].startswith("item:"): + tags[row[0].removeprefix("item:")] = set(filter(None, row[1].split(","))) + + source_maps: dict[str, collections.Counter[str]] = collections.defaultdict(collections.Counter) + input_maps: dict[str, collections.Counter[str]] = collections.defaultdict(collections.Counter) + exact_sources: dict[str, set[str]] = collections.defaultdict(set) + exact_inputs: dict[str, set[str]] = collections.defaultdict(set) + + with (args.snapshot / "reload-recipes.tsv").open() as source: + for row in csv.reader(source, delimiter="\t"): + if len(row) < 2: + continue + recipe_map, slots = row[0], row[1] + inputs, outputs, input_tags = recipe_items(slots) + for tag in input_tags: + inputs.update(tags.get(tag, ())) + for item in outputs: + prefix = item_prefixes.get(item) + if prefix: + source_maps[prefix][recipe_map] += 1 + exact_sources[prefix].add(item) + if item in block_forms: + prefix = block_forms[item]["prefix"] + source_maps[prefix][recipe_map] += 1 + exact_sources[prefix].add(item) + for item in inputs: + prefix = item_prefixes.get(item) + if prefix: + input_maps[prefix][recipe_map] += 1 + exact_inputs[prefix].add(item) + if item in block_forms: + prefix = block_forms[item]["prefix"] + input_maps[prefix][recipe_map] += 1 + exact_inputs[prefix].add(item) + + prefix_items = collections.defaultdict(set) + for item, prefix in item_prefixes.items(): + prefix_items[prefix].add(item) + for item, form in forms.items(): + prefix_items[form["prefix"]].add(item) + + prefix_blocks = collections.defaultdict(set) + for item, form in block_forms.items(): + prefix_blocks[form["prefix"]].add(form["block"]) + + result = {} + for prefix in sorted(prefix_items.keys() | prefix_blocks.keys()): + members = prefix_items[prefix] + result[prefix] = { + "items": len(members), + "material_form_items": sum(item in forms for item in members), + "material_components": len( + {forms[item]["material"] for item in members if item in forms} + ), + "composition_items": sum(item in items for item in members), + "source_items": len(exact_sources[prefix]), + "input_items": len(exact_inputs[prefix]), + "source_maps": dict(source_maps[prefix].most_common()), + "input_maps": dict(input_maps[prefix].most_common()), + "blocks": len(prefix_blocks[prefix]), + "source_blocks": len({block for block in prefix_blocks[prefix] if block in exact_sources[prefix]}), + "input_blocks": len({block for block in prefix_blocks[prefix] if block in exact_inputs[prefix]}), + } + + rendered = json.dumps(result, ensure_ascii=False, indent=2, sort_keys=True) + "\n" + if args.json: + args.json.write_text(rendered) + else: + print(rendered, end="") + + +if __name__ == "__main__": + main()