From ca73b12cdceeb098ccc4a8cfe1a1083bd3e0f8fe Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Thu, 11 Jan 2024 21:01:37 +1100 Subject: [PATCH] Migrate To New Material Registry, Fix Remappers & Mixin (#13) --- .../java/com/nomiceu/nomilabs/LabsValues.java | 1 - .../nomiceu/nomilabs/config/LabsConfig.java | 8 +- .../nomiceu/nomilabs/core/LabsLateMixin.java | 3 +- .../nomiceu/nomilabs/event/CommonProxy.java | 7 + .../material/registry/LabsMaterials.java | 222 +++++++++--------- .../registry/register/LabsChemicals.java | 56 ++--- .../material/registry/register/LabsEIO.java | 30 +-- .../registry/register/LabsElements.java | 16 +- .../registry/register/LabsEndgame.java | 8 +- .../registry/register/LabsMicroverse.java | 16 +- .../registry/register/LabsNaqLine.java | 16 +- .../registry/register/LabsPlatLine.java | 54 ++--- .../registry/register/LabsTaraniumLine.java | 30 +-- .../registry/register/LabsThermal.java | 34 +-- .../nomilabs/mixin/WorldLoadHandler.java | 3 +- .../draconicevolution/GuiEnergyCoreMixin.java | 8 +- .../InvisECoreBlockMixin.java | 3 +- .../ReactorSlotIntegration.java | 2 +- .../TileEnergyStorageCoreMixin.java | 33 ++- .../TileInvisECoreBlockMixin.java | 2 +- .../nomilabs/mixin/solarflux/INetworkSF.java | 12 - .../mixin/solarflux/SolarFluxMixin.java | 31 --- .../nomilabs/remap/LabsRemapHelper.java | 7 + .../nomiceu/nomilabs/remap/LabsRemappers.java | 75 +++++- .../com/nomiceu/nomilabs/remap/Remapper.java | 37 ++- .../remap/datafixer/DataFixerHandler.java | 8 +- .../nomilabs/remap/datafixer/LabsFixes.java | 35 ++- .../resources/mixins.nomilabs.solarflux.json | 13 - 28 files changed, 428 insertions(+), 342 deletions(-) delete mode 100644 src/main/java/com/nomiceu/nomilabs/mixin/solarflux/INetworkSF.java delete mode 100644 src/main/java/com/nomiceu/nomilabs/mixin/solarflux/SolarFluxMixin.java delete mode 100644 src/main/resources/mixins.nomilabs.solarflux.json diff --git a/src/main/java/com/nomiceu/nomilabs/LabsValues.java b/src/main/java/com/nomiceu/nomilabs/LabsValues.java index 4676bf07..0007a305 100644 --- a/src/main/java/com/nomiceu/nomilabs/LabsValues.java +++ b/src/main/java/com/nomiceu/nomilabs/LabsValues.java @@ -26,5 +26,4 @@ public class LabsValues { public static final String STORAGE_DRAWERS_MODID = "storagedrawers"; public static final String FRAMED_COMPACT_MODID = "framedcompactdrawers"; public static final String ENDER_IO_MODID = "enderio"; - public static final String SOLAR_FLUX_MODID = "solarflux"; } diff --git a/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java b/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java index c5858c08..e94344a4 100644 --- a/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java +++ b/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java @@ -154,12 +154,6 @@ public static class ModIntegration { @Config.RequiresMcRestart public boolean enableEnderIOIntegration = true; - @Config.Comment({"Whether to enable Solar Flux Reborn Integration, which fixes its crash with Cleanroom, and is no harm on regular Forge.", - "[default: true]"}) - @Config.LangKey("config.nomilabs.mod_integration.solarflux") - @Config.RequiresMcRestart - public boolean enableSolarFluxRebornIntegration = true; - @Config.Comment("Draconic Evolution Integration Settings") @Config.LangKey("config.nomilabs.mod_integration.draconicevolution") @Config.Name("draconic evolution integration") @@ -215,7 +209,7 @@ public static class Advanced { "This may be used in the future as well, and your world will not be fixed if it is up-to-date.", "[default: false]"}) @Config.LangKey("config.nomilabs.advanced.enable_data_fixes") - @Config.RequiresWorldRestart + @Config.RequiresMcRestart public boolean enableDataFixes = false; @Config.Comment({"List of Regex Patterns to ignore if they are included in the ITEM missing registry list.", diff --git a/src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java b/src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java index dd78635d..6dc7ceef 100644 --- a/src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java @@ -18,8 +18,7 @@ public class LabsLateMixin implements ILateMixinLoader { public static final Map modMixinsConfig = ImmutableMap.of( LabsValues.DRACONIC_MODID, LabsConfig.modIntegration.draconicEvolutionIntegration.enableDraconicEvolutionIntegration, LabsValues.NUCLEARCRAFT_MODID, LabsConfig.modIntegration.enableNuclearCraftIntegration, - LabsValues.XU2_MODID, LabsConfig.modIntegration.enableExtraUtils2Integration, - LabsValues.SOLAR_FLUX_MODID, LabsConfig.modIntegration.enableSolarFluxRebornIntegration + LabsValues.XU2_MODID, LabsConfig.modIntegration.enableExtraUtils2Integration ); @Override diff --git a/src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java b/src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java index 79309c18..2b5cc87f 100644 --- a/src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java +++ b/src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java @@ -21,7 +21,9 @@ import com.nomiceu.nomilabs.remap.datafixer.DataFixerHandler; import com.nomiceu.nomilabs.util.LabsModeHelper; import com.nomiceu.nomilabs.util.LabsNames; +import gregtech.api.GregTechAPI; import gregtech.api.unification.material.event.MaterialEvent; +import gregtech.api.unification.material.event.MaterialRegistryEvent; import gregtech.api.unification.material.event.PostMaterialEvent; import net.minecraft.block.Block; import net.minecraft.item.Item; @@ -97,6 +99,11 @@ public static void materialChanges(PostMaterialEvent event) { LabsMaterials.materialChanges(); } + @SubscribeEvent + public static void createMaterialRegistry(MaterialRegistryEvent event) { + GregTechAPI.materialManager.createRegistry(LabsValues.LABS_MODID); + } + @SubscribeEvent public static void registerRecipes(RegistryEvent.Register event) { if (LabsConfig.content.gtCustomContent.enablePerfectGems && LabsOrePrefix.GEM_PERFECT != null) diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/LabsMaterials.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/LabsMaterials.java index 59e2b4dd..b1303526 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/LabsMaterials.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/LabsMaterials.java @@ -14,156 +14,156 @@ public class LabsMaterials { /** * Deprecated Materials */ - public static Material Infinity; // 32026 + public static Material Infinity; // ID: 26 /** * Elemental materials */ - public static Material Draconium; // 32001 - public static Material AwakenedDraconium; // 32002 - public static Material Omnium; // 32004 - public static Material Taranium; // 32109; HM only + public static Material Draconium; // ID: 1 + public static Material AwakenedDraconium; // ID: 2 + public static Material Omnium; // ID: 4 + public static Material Taranium; // ID: 109; HM only /** * Chemical Materials */ - public static Material TungstenTrioxide; // 32032; HM only - public static Material BerylliumOxide; // 32033; HM only - public static Material NiobiumPentoxide; // 32034; HM only - public static Material TantalumPentoxide; // 32035; HM only - public static Material ManganeseDifluoride; // 32037; HM only - public static Material MolybdenumTrioxide; // 32038; HM only - public static Material LeadChloride; // 32039; HM only - public static Material Wollastonite; // 32040; HM only - public static Material SodiumMetavanadate; // 32041; HM only - public static Material VanadiumPentoxide; // 32042; HM only - public static Material AmmoniumMetavanadate; // 32043; HM only - public static Material PhthalicAnhydride; // 32044; HM only - public static Material Ethylanthraquinone; // 32045; HM only - public static Material HydrogenPeroxide; // 32046; HM only - public static Material Hydrazine; // 32047; HM only - public static Material AcetoneAzine; // 32048; HM only - public static Material GrapheneOxide; // 32049; HM only - public static Material Durene; // 32051; HM only - public static Material PyromelliticDianhydride; // 32052; HM only - public static Material Dimethylformamide; // 32053; HM only - public static Material Aminophenol; // 32054; HM only - public static Material Oxydianiline; // 32055; HM only - public static Material AntimonyPentafluoride; // 32056; HM only - public static Material LeadMetasilicate; // 32066; HM only - public static Material Butanol; // 32112 - public static Material PhosphorusTrichloride; // 32113 - public static Material PhosphorylChloride; // 32114 - public static Material TributylPhosphate; // 32115 + public static Material TungstenTrioxide; // ID: 32; HM only + public static Material BerylliumOxide; // ID: 33; HM only + public static Material NiobiumPentoxide; // ID: 34; HM only + public static Material TantalumPentoxide; // ID: 35; HM only + public static Material ManganeseDifluoride; // ID: 37; HM only + public static Material MolybdenumTrioxide; // ID: 38; HM only + public static Material LeadChloride; // ID: 39; HM only + public static Material Wollastonite; // ID: 40; HM only + public static Material SodiumMetavanadate; // ID: 41; HM only + public static Material VanadiumPentoxide; // ID: 42; HM only + public static Material AmmoniumMetavanadate; // ID: 43; HM only + public static Material PhthalicAnhydride; // ID: 44; HM only + public static Material Ethylanthraquinone; // ID: 45; HM only + public static Material HydrogenPeroxide; // ID: 46; HM only + public static Material Hydrazine; // ID: 47; HM only + public static Material AcetoneAzine; // ID: 48; HM only + public static Material GrapheneOxide; // ID: 49; HM only + public static Material Durene; // ID: 51; HM only + public static Material PyromelliticDianhydride; // ID: 52; HM only + public static Material Dimethylformamide; // ID: 53; HM only + public static Material Aminophenol; // ID: 54; HM only + public static Material Oxydianiline; // ID: 55; HM only + public static Material AntimonyPentafluoride; // ID: 56; HM only + public static Material LeadMetasilicate; // ID: 66; HM only + public static Material Butanol; // ID: 112 + public static Material PhosphorusTrichloride; // ID: 113 + public static Material PhosphorylChloride; // ID: 114 + public static Material TributylPhosphate; // ID: 115 /** * Naquadah Line Materials */ - public static Material NaquadahOxide; // 32057; HM only - public static Material Pyromorphite; // 32058; HM only - public static Material NaquadahHydroxide; // 32059; HM only - public static Material CaesiumHydroxide; // 32061; HM only - public static Material Neocryolite; // 32062; HM only - public static Material NaquadahOxidePetroSolution; // 32063; HM only - public static Material NaquadahOxideAeroSolution; // 32064; HM only - public static Material HotNaquadahOxideNeocryoliteSolution; // 32065; HM only + public static Material NaquadahOxide; // ID: 57; HM only + public static Material Pyromorphite; // ID: 58; HM only + public static Material NaquadahHydroxide; // ID: 59; HM only + public static Material CaesiumHydroxide; // ID: 61; HM only + public static Material Neocryolite; // ID: 62; HM only + public static Material NaquadahOxidePetroSolution; // ID: 63; HM only + public static Material NaquadahOxideAeroSolution; // ID: 64; HM only + public static Material HotNaquadahOxideNeocryoliteSolution; // ID: 65; HM only /** * Taranium Line Materials */ - public static Material HexafluorosilicicAcid; // 32094 - public static Material DirtyHexafluorosilicicAcid; // 32095 - public static Material StoneResidue; // 32096; HM only - public static Material UncommonResidue; // 32097; HM only - public static Material OxidisedResidue; // 32098; HM only - public static Material RefinedResidue; // 32099; HM only - public static Material CleanInertResidue; // 32100; HM only - public static Material UltraacidicResidue; // 32101 - public static Material XenicAcid; // 32102 - public static Material DustyHelium; // 32103 - public static Material TaraniumEnrichedHelium; // 32104 - public static Material TaraniumDepletedHelium; // 32105 - public static Material TritiumHydride; // 32106 - public static Material HeliumHydride; // 32107 - public static Material DioxygenDifluoride; // 32108 + public static Material HexafluorosilicicAcid; // ID: 94 + public static Material DirtyHexafluorosilicicAcid; // ID: 95 + public static Material StoneResidue; // ID: 96; HM only + public static Material UncommonResidue; // ID: 97; HM only + public static Material OxidisedResidue; // ID: 98; HM only + public static Material RefinedResidue; // ID: 99; HM only + public static Material CleanInertResidue; // ID: 100; HM only + public static Material UltraacidicResidue; // ID: 101 + public static Material XenicAcid; // ID: 102 + public static Material DustyHelium; // ID: 103 + public static Material TaraniumEnrichedHelium; // ID: 104 + public static Material TaraniumDepletedHelium; // ID: 105 + public static Material TritiumHydride; // ID: 106 + public static Material HeliumHydride; // ID: 107 + public static Material DioxygenDifluoride; // ID: 108 /** * Platinum Line Materials */ - public static Material PlatinumMetallic; // 32067; HM only - public static Material PalladiumMetallic; // 32068; HM only - public static Material AmmoniumHexachloroplatinate; // 32069; HM only - public static Material ChloroplatinicAcid; // 32070 - public static Material PotassiumBisulfate; // 32071; HM only - public static Material PotassiumPyrosulfate; // 32072; HM only - public static Material PotassiumSulfate; // 32073; HM only - public static Material ZincSulfate; // 32074; HM only - public static Material SodiumNitrate; // 32075; HM only - public static Material RhodiumNitrate; // 32076; HM only - public static Material SodiumRuthenate; // 32077; HM only - public static Material SodiumPeroxide; // 32078; HM only - public static Material IridiumDioxideResidue; // 32079; HM only - public static Material AmmoniumHexachloroiridiate; // 32080; HM only - public static Material PlatinumGroupResidue; // 32081; HM only - public static Material PalladiumRichAmmonia; // 32082 - public static Material CrudePlatinumResidue; // 32083; HM only - public static Material CrudePalladiumResidue; // 32084; HM only - public static Material IridiumGroupSludge; // 32085; HM only - public static Material RhodiumSulfateSolution; // 32086 - public static Material CrudeRhodiumResidue; // 32087; HM only - public static Material RhodiumSalt; // 32088; HM only - public static Material AcidicIridiumDioxideSolution; // 32089 - public static Material PlatinumPalladiumLeachate; // 32090 - public static Material MethylFormate; // 32091 - public static Material FormicAcid; // 32092 - public static Material SodiumMethoxide; // 32093; HM only + public static Material PlatinumMetallic; // ID: 67; HM only + public static Material PalladiumMetallic; // ID: 68; HM only + public static Material AmmoniumHexachloroplatinate; // ID: 69; HM only + public static Material ChloroplatinicAcid; // ID: 70 + public static Material PotassiumBisulfate; // ID: 71; HM only + public static Material PotassiumPyrosulfate; // ID: 72; HM only + public static Material PotassiumSulfate; // ID: 73; HM only + public static Material ZincSulfate; // ID: 74; HM only + public static Material SodiumNitrate; // ID: 75; HM only + public static Material RhodiumNitrate; // ID: 76; HM only + public static Material SodiumRuthenate; // ID: 77; HM only + public static Material SodiumPeroxide; // ID: 78; HM only + public static Material IridiumDioxideResidue; // ID: 79; HM only + public static Material AmmoniumHexachloroiridiate; // ID: 80; HM only + public static Material PlatinumGroupResidue; // ID: 81; HM only + public static Material PalladiumRichAmmonia; // ID: 82 + public static Material CrudePlatinumResidue; // ID: 83; HM only + public static Material CrudePalladiumResidue; // ID: 84; HM only + public static Material IridiumGroupSludge; // ID: 85; HM only + public static Material RhodiumSulfateSolution; // ID: 86 + public static Material CrudeRhodiumResidue; // ID: 87; HM only + public static Material RhodiumSalt; // ID: 88; HM only + public static Material AcidicIridiumDioxideSolution; // ID: 89 + public static Material PlatinumPalladiumLeachate; // ID: 90 + public static Material MethylFormate; // ID: 91 + public static Material FormicAcid; // ID: 92 + public static Material SodiumMethoxide; // ID: 93; HM only /** * Microverse Materials */ - public static Material Microversium; // 32027 - public static Material Osmiridium8020; // 32029 - public static Material Iridosmine8020; // 32030 - public static Material Kaemanite; // 32031 - public static Material Fluorite; // 32036 - public static Material Snowchestite; // 32060; HM only - public static Material Darmstadtite; // 32110 - public static Material Dulysite; // 32111 + public static Material Microversium; // ID: 27 + public static Material Osmiridium8020; // ID: 29 + public static Material Iridosmine8020; // ID: 30 + public static Material Kaemanite; // ID: 31 + public static Material Fluorite; // ID: 36 + public static Material Snowchestite; // ID: 60; HM only + public static Material Darmstadtite; // ID: 110 + public static Material Dulysite; // ID: 111 /** * Thermal Materials */ - public static Material Ardite; // 32006 - public static Material Mana; // 32007 - public static Material Manyullyn; // 32008 - public static Material Signalum; // 32010 - public static Material Lumium; // 32017 - public static Material Enderium; // 32018 - public static Material ElectrumFlux; // 32019 - public static Material Mithril; // 32021 + public static Material Ardite; // ID: 6 + public static Material Mana; // ID: 7 + public static Material Manyullyn; // ID: 8 + public static Material Signalum; // ID: 10 + public static Material Lumium; // ID: 17 + public static Material Enderium; // ID: 18 + public static Material ElectrumFlux; // ID: 19 + public static Material Mithril; // ID: 21 /** * EnderIO Materials */ - public static Material DarkSteel; // 32003 - public static Material ConductiveIron; // 32011 - public static Material EnergeticAlloy; // 32012 - public static Material VibrantAlloy; // 32013 - public static Material PulsatingIron; // 32014 - public static Material ElectricalSteel; // 32015 - public static Material Soularium; // 32024 - public static Material EndSteel; // 32025 + public static Material DarkSteel; // ID: 3 + public static Material ConductiveIron; // ID: 11 + public static Material EnergeticAlloy; // ID: 12 + public static Material VibrantAlloy; // ID: 13 + public static Material PulsatingIron; // ID: 14 + public static Material ElectricalSteel; // ID: 15 + public static Material Soularium; // ID: 24 + public static Material EndSteel; // ID: 25 /** * Endgame Materials */ - public static Material CrystalMatrix; // 32023 - public static Material DraconicSuperconductor; // 32028 - public static Material KaptonK; // 32050; HM only + public static Material CrystalMatrix; // ID: 23 + public static Material DraconicSuperconductor; // ID: 28 + public static Material KaptonK; // ID: 50; HM only public static void init() { /* Deprecated Materials */ - Infinity = new Material.Builder(32026, makeLabsName("infinity")) + Infinity = new Material.Builder(26, makeLabsName("infinity")) .ingot() .color(0x000000).iconSet(MaterialIconSet.SHINY) .flags(GENERATE_PLATE) diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsChemicals.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsChemicals.java index 6885a0fa..97400777 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsChemicals.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsChemicals.java @@ -10,78 +10,78 @@ public class LabsChemicals { public static void initChemicals() { - TungstenTrioxide = new Material.Builder(32032, makeLabsName("tungsten_trioxide")) // Hardmode Material + TungstenTrioxide = new Material.Builder(32, makeLabsName("tungsten_trioxide")) // Hardmode Material .dust() .color(0xC7D300).iconSet(DULL) .flags(DISABLE_DECOMPOSITION) .components(Tungsten, 1, Oxygen, 3) .build(); - BerylliumOxide = new Material.Builder(32033, makeLabsName("beryllium_oxide")) // Hardmode Material + BerylliumOxide = new Material.Builder(33, makeLabsName("beryllium_oxide")) // Hardmode Material .ingot() .color(0x54C757).iconSet(DULL) .flags(GENERATE_ROD, GENERATE_RING) .components(Beryllium, 1, Oxygen, 1) .build(); - NiobiumPentoxide = new Material.Builder(32034, makeLabsName("niobium_pentoxide")) // Hardmode Material + NiobiumPentoxide = new Material.Builder(34, makeLabsName("niobium_pentoxide")) // Hardmode Material .dust() .color(0xBAB0C3).iconSet(ROUGH) .components(Niobium, 2, Oxygen, 5) .build(); - TantalumPentoxide = new Material.Builder(32035, makeLabsName("tantalum_pentoxide")) // Hardmode Material + TantalumPentoxide = new Material.Builder(35, makeLabsName("tantalum_pentoxide")) // Hardmode Material .dust() .color(0x72728A).iconSet(ROUGH) .components(Tantalum, 2, Oxygen, 5) .build(); - ManganeseDifluoride = new Material.Builder(32037, makeLabsName("manganese_difluoride")) // Hardmode Material + ManganeseDifluoride = new Material.Builder(37, makeLabsName("manganese_difluoride")) // Hardmode Material .dust() .color(0xEF4B3D).iconSet(ROUGH) .components(Manganese, 1, Fluorine, 2) .build(); - MolybdenumTrioxide = new Material.Builder(32038, makeLabsName("molybdenum_trioxide")) // Hardmode Material + MolybdenumTrioxide = new Material.Builder(38, makeLabsName("molybdenum_trioxide")) // Hardmode Material .dust() .color(0xCBCFDA).iconSet(ROUGH) .flags(DISABLE_DECOMPOSITION) .components(Molybdenum, 1, Oxygen, 3) .build(); - LeadChloride = new Material.Builder(32039, makeLabsName("lead_chloride")) // Hardmode Material + LeadChloride = new Material.Builder(39, makeLabsName("lead_chloride")) // Hardmode Material .dust() .color(0xF3F3F3).iconSet(ROUGH) .components(Lead, 1, Chlorine, 2) .build(); - Wollastonite = new Material.Builder(32040, makeLabsName("wollastonite")) // Hardmode Material + Wollastonite = new Material.Builder(40, makeLabsName("wollastonite")) // Hardmode Material .dust() .color(0xF7F7E7).iconSet(BRIGHT) .components(Calcium, 1, Silicon, 1, Oxygen, 3) .build(); - SodiumMetavanadate = new Material.Builder(32041, makeLabsName("sodium_metavanadate")) // Hardmode Material + SodiumMetavanadate = new Material.Builder(41, makeLabsName("sodium_metavanadate")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0xe6bb22).iconSet(DULL) .components(Sodium, 1, Vanadium, 1, Oxygen, 3) .build(); - VanadiumPentoxide = new Material.Builder(32042, makeLabsName("vanadium_pentoxide")) // Hardmode Material + VanadiumPentoxide = new Material.Builder(42, makeLabsName("vanadium_pentoxide")) // Hardmode Material .dust() .color(0xffcf33).iconSet(ROUGH) .components(Vanadium, 2, Oxygen, 5) .build(); - AmmoniumMetavanadate = new Material.Builder(32043, makeLabsName("ammonium_metavanadate")) // Hardmode Material + AmmoniumMetavanadate = new Material.Builder(43, makeLabsName("ammonium_metavanadate")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0xf7e37e).iconSet(DULL) .components(Nitrogen, 1, Hydrogen, 4, Vanadium, 1, Oxygen, 3) .build(); - PhthalicAnhydride = new Material.Builder(32044, makeLabsName("phthalic_anhydride")) // Hardmode Material + PhthalicAnhydride = new Material.Builder(44, makeLabsName("phthalic_anhydride")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0xeeaaee).iconSet(DULL) @@ -90,7 +90,7 @@ public static void initChemicals() { PhthalicAnhydride.setFormula("C6H4(CO)2O", true); - Ethylanthraquinone = new Material.Builder(32045, makeLabsName("ethylanthraquinone")) // Hardmode Material + Ethylanthraquinone = new Material.Builder(45, makeLabsName("ethylanthraquinone")) // Hardmode Material .dust() .color(0xf1e181) .flags(DISABLE_DECOMPOSITION) @@ -99,19 +99,19 @@ public static void initChemicals() { Ethylanthraquinone.setFormula("C6H4(CO)2C6H3(CH2CH3)", true); - HydrogenPeroxide = new Material.Builder(32046, makeLabsName("hydrogen_peroxide")) // Hardmode Material + HydrogenPeroxide = new Material.Builder(46, makeLabsName("hydrogen_peroxide")) // Hardmode Material .liquid() .color(0xd2ffff) .components(Hydrogen, 2, Oxygen, 2) .build(); - Hydrazine = new Material.Builder(32047, makeLabsName("hydrazine")) // Hardmode Material + Hydrazine = new Material.Builder(47, makeLabsName("hydrazine")) // Hardmode Material .liquid() .color(0xb50707) .components(Nitrogen, 2, Hydrogen, 4) .build(); - AcetoneAzine = new Material.Builder(32048, makeLabsName("acetone_azine")) // Hardmode Material + AcetoneAzine = new Material.Builder(48, makeLabsName("acetone_azine")) // Hardmode Material .liquid() .color(0xa1e1e1) .components(Carbon, 6, Hydrogen, 12, Nitrogen, 2) @@ -119,14 +119,14 @@ public static void initChemicals() { AcetoneAzine.setFormula("((CH3)2(CN))2", true); - GrapheneOxide = new Material.Builder(32049, makeLabsName("graphene_oxide")) // Hardmode Material + GrapheneOxide = new Material.Builder(49, makeLabsName("graphene_oxide")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0x777777).iconSet(ROUGH) .components(Graphene, 1, Oxygen, 1) .build(); - Durene = new Material.Builder(32051, makeLabsName("durene")) // Hardmode Material + Durene = new Material.Builder(51, makeLabsName("durene")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0x336040).iconSet(FINE) @@ -135,7 +135,7 @@ public static void initChemicals() { Durene.setFormula("C6H2(CH3)4", true); - PyromelliticDianhydride = new Material.Builder(32052, makeLabsName("pyromellitic_dianhydride")) // Hardmode Material + PyromelliticDianhydride = new Material.Builder(52, makeLabsName("pyromellitic_dianhydride")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0xf0ead6).iconSet(ROUGH) @@ -144,20 +144,20 @@ public static void initChemicals() { PyromelliticDianhydride.setFormula("C6H2(C2O3)2", true); - Dimethylformamide = new Material.Builder(32053, makeLabsName("dimethylformamide")) // Hardmode Material + Dimethylformamide = new Material.Builder(53, makeLabsName("dimethylformamide")) // Hardmode Material .liquid() .color(0x42bdff) .components(Carbon, 3, Hydrogen, 7, Nitrogen, 1, Oxygen, 1) .build(); - Aminophenol = new Material.Builder(32054, makeLabsName("aminophenol")) // Hardmode Material + Aminophenol = new Material.Builder(54, makeLabsName("aminophenol")) // Hardmode Material .liquid() .flags(DISABLE_DECOMPOSITION) .color(0xff7f50) .components(Carbon, 6, Hydrogen, 7, Nitrogen, 1, Oxygen, 1) .build(); - Oxydianiline = new Material.Builder(32055, makeLabsName("oxydianiline")) // Hardmode Material + Oxydianiline = new Material.Builder(55, makeLabsName("oxydianiline")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0xf0e130).iconSet(DULL) @@ -166,20 +166,20 @@ public static void initChemicals() { Oxydianiline.setFormula("O(C6H4NH2)2", true); - AntimonyPentafluoride = new Material.Builder(32056, makeLabsName("antimony_pentafluoride")) // Hardmode Material + AntimonyPentafluoride = new Material.Builder(56, makeLabsName("antimony_pentafluoride")) // Hardmode Material .liquid() .flags(DISABLE_DECOMPOSITION) .color(0xe3f1f1) .components(Antimony, 1, Fluorine, 5) .build(); - LeadMetasilicate = new Material.Builder(32066, makeLabsName("lead_metasilicate")) // Hardmode Material + LeadMetasilicate = new Material.Builder(66, makeLabsName("lead_metasilicate")) // Hardmode Material .dust() .color(0xF7F7E7).iconSet(DULL) .components(Lead, 1, Silicon, 1, Oxygen, 3) .build(); - Butanol = new Material.Builder(32112, makeLabsName("butanol")) + Butanol = new Material.Builder(112, makeLabsName("butanol")) .liquid() .color(0xc7af2e) .components(Carbon, 4, Hydrogen, 10, Oxygen, 1) @@ -187,19 +187,19 @@ public static void initChemicals() { Butanol.setFormula("C4H9OH", true); - PhosphorusTrichloride = new Material.Builder(32113, makeLabsName("phosphorus_trichloride")) + PhosphorusTrichloride = new Material.Builder(113, makeLabsName("phosphorus_trichloride")) .liquid() .color(0xe8c474) .components(Phosphorus, 1, Chlorine, 3) .build(); - PhosphorylChloride = new Material.Builder(32114, makeLabsName("phosphoryl_chloride")) + PhosphorylChloride = new Material.Builder(114, makeLabsName("phosphoryl_chloride")) .liquid() .color(0xe8bb5b) .components(Phosphorus, 1, Oxygen, 1, Chlorine, 3) .build(); - TributylPhosphate = new Material.Builder(32115, makeLabsName("tributyl_phosphate")) + TributylPhosphate = new Material.Builder(115, makeLabsName("tributyl_phosphate")) .liquid() .color(0xe8c4a0) .components(Carbon, 12, Hydrogen, 27, Oxygen, 4, Phosphorus, 1) diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsEIO.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsEIO.java index d6c7b371..f4b12e09 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsEIO.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsEIO.java @@ -13,7 +13,7 @@ public class LabsEIO { public static void initEIO() { - DarkSteel = new Material.Builder(32003, makeLabsName("dark_steel")) + DarkSteel = new Material.Builder(3, makeLabsName("dark_steel")) .ingot() .liquid() .color(0x414751).iconSet(DULL) @@ -21,49 +21,49 @@ public static void initEIO() { .components(Iron, 1) .build(); - ConductiveIron = new Material.Builder(32011, makeLabsName("conductive_iron")) + ConductiveIron = new Material.Builder(11, makeLabsName("conductive_iron")) .ingot() .liquid() .color(0xf7b29b).iconSet(METALLIC) .flags(GENERATE_PLATE, GENERATE_GEAR) .components(Iron, 1, Redstone, 1) - .cableProperties(V[LV], 1, 0, true) + .cableProperties(V[1], 1, 0, true) .build(); - EnergeticAlloy = new Material.Builder(32012, makeLabsName("energetic_alloy")) + EnergeticAlloy = new Material.Builder(12, makeLabsName("energetic_alloy")) .ingot() .liquid() .color(0xffb545).iconSet(SHINY) .flags(GENERATE_PLATE, GENERATE_DOUBLE_PLATE, GENERATE_GEAR) .blast(builder -> builder .temp(1250, GasTier.LOW) - .blastStats(VA[MV], 400)) + .blastStats(VA[2], 400)) .components(Gold, 2, Redstone, 1, Glowstone, 1) - .cableProperties(V[MV], 1, 0, true) + .cableProperties(V[2], 1, 0, true) .build(); - VibrantAlloy = new Material.Builder(32013, makeLabsName("vibrant_alloy")) + VibrantAlloy = new Material.Builder(13, makeLabsName("vibrant_alloy")) .ingot() .liquid() .color(0xa4ff70).iconSet(SHINY) .flags(GENERATE_PLATE, GENERATE_DOUBLE_PLATE, GENERATE_GEAR, GENERATE_ROD, GENERATE_BOLT_SCREW) .blast(builder -> builder .temp(1350, GasTier.LOW) - .blastStats(VA[HV], 400)) + .blastStats(VA[3], 400)) .components(EnergeticAlloy, 1, EnderPearl, 1) - .cableProperties(V[MV], 1, 0, true) + .cableProperties(V[2], 1, 0, true) .build(); - PulsatingIron = new Material.Builder(32014, makeLabsName("pulsating_iron")) + PulsatingIron = new Material.Builder(14, makeLabsName("pulsating_iron")) .ingot() .liquid() .color(0x6ae26e).iconSet(SHINY) .flags(GENERATE_PLATE, GENERATE_GEAR) .components(Iron, 1) - .cableProperties(V[ULV], 1, 0, true) + .cableProperties(V[0], 1, 0, true) .build(); - ElectricalSteel = new Material.Builder(32015, makeLabsName("electrical_steel")) + ElectricalSteel = new Material.Builder(15, makeLabsName("electrical_steel")) .ingot() .liquid() .color(0xb2c0c1).iconSet(METALLIC) @@ -71,7 +71,7 @@ public static void initEIO() { .components(Steel, 1, Silicon, 1) .build(); - Soularium = new Material.Builder(32024, makeLabsName("soularium")) + Soularium = new Material.Builder(24, makeLabsName("soularium")) .ingot() .liquid() .color(0x7c674d).iconSet(METALLIC) @@ -79,13 +79,13 @@ public static void initEIO() { .components(Gold, 1) .build(); - EndSteel = new Material.Builder(32025, makeLabsName("end_steel")) + EndSteel = new Material.Builder(25, makeLabsName("end_steel")) .ingot() .liquid() .color(0xd6d980).iconSet(METALLIC) .flags(GENERATE_PLATE, GENERATE_GEAR) .toolStats(ToolProperty.Builder.of(4.0f, 3.5f, 1024, 3).build()) - .cableProperties(V[EV], 1, 0, true) + .cableProperties(V[4], 1, 0, true) .build(); } } diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsElements.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsElements.java index 9da50126..1fd0ec3c 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsElements.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsElements.java @@ -18,38 +18,38 @@ public class LabsElements { public static final Element Tn = Elements.add(43, 55, -1, null, "Taranium", "Tn", false); public static void init() { - Draconium = new Material.Builder(32001, makeLabsName("draconium")) + Draconium = new Material.Builder(1, makeLabsName("draconium")) .ingot().liquid().ore() .element(Dc) .color(0xbe49ed).iconSet(METALLIC) .blast(6800, GasTier.HIGHER) - .cableProperties(V[UV], 1, 0, true) + .cableProperties(V[8], 1, 0, true) .flags(GENERATE_PLATE, GENERATE_DOUBLE_PLATE, GENERATE_ROD, GENERATE_GEAR, GENERATE_DENSE) .build(); - AwakenedDraconium = new Material.Builder(32002, makeLabsName("awakened_draconium")) + AwakenedDraconium = new Material.Builder(2, makeLabsName("awakened_draconium")) .ingot().liquid() .element(ADc) .color(0xf58742).iconSet(METALLIC) .flags(NO_SMELTING, GENERATE_PLATE, GENERATE_DOUBLE_PLATE, GENERATE_ROD, GENERATE_GEAR) .build(); - Omnium = new Material.Builder(32004, makeLabsName("omnium")) + Omnium = new Material.Builder(4, makeLabsName("omnium")) .ingot().liquid() .element(Nm) .color(0x84053e).iconSet(SHINY) - .cableProperties(V[MAX], 64, 0, true) + .cableProperties(V[14], 64, 0, true) .build(); - Taranium = new Material.Builder(32109, makeLabsName("taranium")) // Hardmode Material + Taranium = new Material.Builder(109, makeLabsName("taranium")) // Hardmode Material .element(Tn) .ingot().liquid() .color(0xff00ff).iconSet(BRIGHT) .flags(GENERATE_PLATE, GENERATE_DENSE) .blast(builder -> builder .temp(10800, GasTier.HIGHEST) - .blastStats(VA[ZPM], 1800) - .vacuumStats(VA[LuV], 600)) + .blastStats(VA[7], 1800) + .vacuumStats(VA[6], 600)) .build(); } } diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsEndgame.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsEndgame.java index 790654f5..a119e33a 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsEndgame.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsEndgame.java @@ -11,19 +11,19 @@ public class LabsEndgame { public static void initEndgame() { - CrystalMatrix = new Material.Builder(32023, makeLabsName("crystal_matrix")) + CrystalMatrix = new Material.Builder(23, makeLabsName("crystal_matrix")) .ingot().liquid() .color(0x70ecff).iconSet(SHINY) .flags(GENERATE_PLATE, GENERATE_DOUBLE_PLATE) .build(); - DraconicSuperconductor = new Material.Builder(32028, makeLabsName("draconic_superconductor")) + DraconicSuperconductor = new Material.Builder(28, makeLabsName("draconic_superconductor")) .ingot() .color(0xf5f0f4).iconSet(SHINY) - .cableProperties(V[MAX], 4, 0, true) + .cableProperties(V[14], 4, 0, true) .build(); - KaptonK = new Material.Builder(32050, makeLabsName("kapton_k")) // Hardmode Material + KaptonK = new Material.Builder(50, makeLabsName("kapton_k")) // Hardmode Material .ingot().liquid() .color(0xffce52).iconSet(DULL) .flags(GENERATE_PLATE, DISABLE_DECOMPOSITION) diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsMicroverse.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsMicroverse.java index 69192006..35ba61c8 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsMicroverse.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsMicroverse.java @@ -10,41 +10,41 @@ public class LabsMicroverse { public static void initMicroverse() { - Microversium = new Material.Builder(32027, makeLabsName("microversium")) + Microversium = new Material.Builder(27, makeLabsName("microversium")) .ingot() .color(0x9b61b8).iconSet(DULL) .flags(GENERATE_PLATE, GENERATE_FRAME) .build(); - Osmiridium8020 = new Material.Builder(32029, makeLabsName("osmiridium_8020")) + Osmiridium8020 = new Material.Builder(29, makeLabsName("osmiridium_8020")) .dust().ore() .components(Osmium, 4, Iridium, 1) .colorAverage() .addOreByproducts(Osmium, Iridium, Ruthenium) .build(); - Iridosmine8020 = new Material.Builder(32030, makeLabsName("iridosmine_8020")) + Iridosmine8020 = new Material.Builder(30, makeLabsName("iridosmine_8020")) .dust().ore() .components(Iridium, 4, Osmium, 1) .colorAverage() .addOreByproducts(Iridium, Osmium, Rhodium) .build(); - Kaemanite = new Material.Builder(32031, makeLabsName("kaemanite")) + Kaemanite = new Material.Builder(31, makeLabsName("kaemanite")) .dust().ore() .components(Trinium, 1, Tantalum, 1, Oxygen, 4) .color(0xe7413c).iconSet(BRIGHT) .addOreByproducts(Niobium, TriniumSulfide, Trinium) .build(); - Fluorite = new Material.Builder(32036, makeLabsName("fluorite")) + Fluorite = new Material.Builder(36, makeLabsName("fluorite")) .dust().ore() .color(0xFFFC9E).iconSet(ROUGH) .components(Calcium, 1, Fluorine, 2) .addOreByproducts(Sphalerite, Bastnasite, Topaz) .build(); - Snowchestite = new Material.Builder(32060, makeLabsName("snowchestite")) // Hardmode Material + Snowchestite = new Material.Builder(60, makeLabsName("snowchestite")) // Hardmode Material .dust().ore() .flags(DISABLE_DECOMPOSITION) .color(0x274c9f).iconSet(SHINY) @@ -52,14 +52,14 @@ public static void initMicroverse() { .addOreByproducts(Chalcopyrite, VanadiumMagnetite, NaquadahHydroxide) .build(); - Darmstadtite = new Material.Builder(32110, makeLabsName("darmstadtite")) + Darmstadtite = new Material.Builder(110, makeLabsName("darmstadtite")) .dust().ore(2, 1) .colorAverage().iconSet(DULL) .components(Darmstadtium, 2, Sulfur, 3) .addOreByproducts(RareEarth, RhodiumSulfate, Darmstadtium) .build(); // This also adds dust property to rhodium sulfate - Dulysite = new Material.Builder(32111, makeLabsName("dulysite")) + Dulysite = new Material.Builder(111, makeLabsName("dulysite")) .gem().ore(2, 1) .colorAverage().iconSet(RUBY) .components(Duranium, 1, Chlorine, 3) diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsNaqLine.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsNaqLine.java index 0b4854a1..66290834 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsNaqLine.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsNaqLine.java @@ -11,21 +11,21 @@ public class LabsNaqLine { public static void initNaqLine() { - NaquadahOxide = new Material.Builder(32057, makeLabsName("naquadah_oxide")) // Hardmode Material + NaquadahOxide = new Material.Builder(57, makeLabsName("naquadah_oxide")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0x17ddd3).iconSet(ROUGH) .components(Naquadah, 2, Oxygen, 3) .build(); - Pyromorphite = new Material.Builder(32058, makeLabsName("pyromorphite")) // Hardmode Material + Pyromorphite = new Material.Builder(58, makeLabsName("pyromorphite")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0xd3ed28).iconSet(ROUGH) .components(Lead, 5, Phosphate, 3, Chlorine, 1) .build(); - NaquadahHydroxide = new Material.Builder(32059, makeLabsName("naquadah_hydroxide")) // Hardmode Material + NaquadahHydroxide = new Material.Builder(59, makeLabsName("naquadah_hydroxide")) // Hardmode Material .dust() .color(0x1941a6).iconSet(DULL) .components(Naquadah, 1, Hydrogen, 3, Oxygen, 3) @@ -33,33 +33,33 @@ public static void initNaqLine() { NaquadahHydroxide.setFormula("Nq(OH)3", true); - CaesiumHydroxide = new Material.Builder(32061, makeLabsName("caesium_hydroxide")) // Hardmode Material + CaesiumHydroxide = new Material.Builder(61, makeLabsName("caesium_hydroxide")) // Hardmode Material .dust() .flags(DISABLE_DECOMPOSITION) .color(0xbd8340).iconSet(DULL) .components(Caesium, 1, Oxygen, 1, Hydrogen, 1) .build(); - Neocryolite = new Material.Builder(32062, makeLabsName("neocryolite")) // Hardmode Material + Neocryolite = new Material.Builder(62, makeLabsName("neocryolite")) // Hardmode Material .liquid() .flags(DISABLE_DECOMPOSITION) .color(0x3fd1aa) .components(Caesium, 3, Naquadah, 1, Fluorine, 6) .build(); - NaquadahOxidePetroSolution = new Material.Builder(32063, makeLabsName("naquadah_oxide_petro_solution")) // Hardmode Material + NaquadahOxidePetroSolution = new Material.Builder(63, makeLabsName("naquadah_oxide_petro_solution")) // Hardmode Material .liquid() .flags(DISABLE_DECOMPOSITION) .color(0x595c70) .build(); - NaquadahOxideAeroSolution = new Material.Builder(32064, makeLabsName("naquadah_oxide_aero_solution")) // Hardmode Material + NaquadahOxideAeroSolution = new Material.Builder(64, makeLabsName("naquadah_oxide_aero_solution")) // Hardmode Material .liquid() .flags(DISABLE_DECOMPOSITION) .color(0x6f7059) .build(); - HotNaquadahOxideNeocryoliteSolution = new Material.Builder(32065, makeLabsName("hot_naquadah_oxide_neocryolite_solution")) // Hardmode Material + HotNaquadahOxideNeocryoliteSolution = new Material.Builder(65, makeLabsName("hot_naquadah_oxide_neocryolite_solution")) // Hardmode Material .liquid(new FluidBuilder().temperature(4700)) .flags(DISABLE_DECOMPOSITION) .color(0x658280) diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsPlatLine.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsPlatLine.java index ac619ec4..b1e70830 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsPlatLine.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsPlatLine.java @@ -10,183 +10,183 @@ public class LabsPlatLine { public static void initPlatLine() { - PlatinumMetallic = new Material.Builder(32067, makeLabsName("platinum_metallic")) // Hardmode Material + PlatinumMetallic = new Material.Builder(67, makeLabsName("platinum_metallic")) // Hardmode Material .dust() .color(0xfffbc5).iconSet(METALLIC) .flags(DISABLE_DECOMPOSITION) .components(Platinum, 1, RareEarth, 1) .build(); - PalladiumMetallic = new Material.Builder(32068, makeLabsName("palladium_metallic")) // Hardmode Material + PalladiumMetallic = new Material.Builder(68, makeLabsName("palladium_metallic")) // Hardmode Material .dust() .color(0x808080).iconSet(METALLIC) .flags(DISABLE_DECOMPOSITION) .components(Palladium, 1, RareEarth, 1) .build(); - AmmoniumHexachloroplatinate = new Material.Builder(32069, makeLabsName("ammonium_hexachloroplatinate")) // Hardmode Material + AmmoniumHexachloroplatinate = new Material.Builder(69, makeLabsName("ammonium_hexachloroplatinate")) // Hardmode Material .dust() .color(0xfef0c2).iconSet(METALLIC) .flags(DISABLE_DECOMPOSITION) .components(Nitrogen, 2, Hydrogen, 8, Platinum, 1, Chlorine, 6) .build().setFormula("(NH4)2PtCl6", true); - ChloroplatinicAcid = new Material.Builder(32070, makeLabsName("chloroplatinic_acid")) + ChloroplatinicAcid = new Material.Builder(70, makeLabsName("chloroplatinic_acid")) .liquid() .color(0xfef0c2) .flags(DISABLE_DECOMPOSITION) .components(Hydrogen, 2, Platinum, 1, Chlorine, 6) .build(); - PotassiumBisulfate = new Material.Builder(32071, makeLabsName("potassium_bisulfate")) // Hardmode Material + PotassiumBisulfate = new Material.Builder(71, makeLabsName("potassium_bisulfate")) // Hardmode Material .dust() .color(0xfdbd68) .components(Potassium, 1, Hydrogen, 1, Sulfur, 1, Oxygen, 4) .build(); - PotassiumPyrosulfate = new Material.Builder(32072, makeLabsName("potassium_pyrosulfate")) // Hardmode Material + PotassiumPyrosulfate = new Material.Builder(72, makeLabsName("potassium_pyrosulfate")) // Hardmode Material .dust() .color(0xfbbb66) .components(Potassium, 2, Sulfur, 2, Oxygen, 7) .build(); - PotassiumSulfate = new Material.Builder(32073, makeLabsName("potassium_sulfate")) // Hardmode Material + PotassiumSulfate = new Material.Builder(73, makeLabsName("potassium_sulfate")) // Hardmode Material .dust() .color(0xf0b064).iconSet(METALLIC) .components(Potassium, 2, Sulfur, 1, Oxygen, 4) .build(); - ZincSulfate = new Material.Builder(32074, makeLabsName("zinc_sulfate")) // Hardmode Material + ZincSulfate = new Material.Builder(74, makeLabsName("zinc_sulfate")) // Hardmode Material .dust() .color(0x846649).iconSet(FINE) .components(Zinc, 1, Sulfur, 1, Oxygen, 4) .build(); - SodiumNitrate = new Material.Builder(32075, makeLabsName("sodium_nitrate")) // Hardmode Material + SodiumNitrate = new Material.Builder(75, makeLabsName("sodium_nitrate")) // Hardmode Material .dust() .color(0x846684).iconSet(ROUGH) .components(Sodium, 1, Nitrogen, 1, Oxygen, 3) .build(); - RhodiumNitrate = new Material.Builder(32076, makeLabsName("rhodium_nitrate")) // Hardmode Material + RhodiumNitrate = new Material.Builder(76, makeLabsName("rhodium_nitrate")) // Hardmode Material .dust() .color(0x776649).iconSet(FINE) .flags(DISABLE_DECOMPOSITION) .components(Rhodium, 1, Nitrogen, 3, Oxygen, 9) .build().setFormula("Rh(NO3)3", true); - SodiumRuthenate = new Material.Builder(32077, makeLabsName("sodium_ruthenate")) // Hardmode Material + SodiumRuthenate = new Material.Builder(77, makeLabsName("sodium_ruthenate")) // Hardmode Material .dust() .color(0x3a40cb).iconSet(SHINY) .flags(DISABLE_DECOMPOSITION) .components(Sodium, 2, Ruthenium, 1, Oxygen, 4) .build(); - SodiumPeroxide = new Material.Builder(32078, makeLabsName("sodium_peroxide")) // Hardmode Material + SodiumPeroxide = new Material.Builder(78, makeLabsName("sodium_peroxide")) // Hardmode Material .dust() .color(0xecff80).iconSet(ROUGH) .components(Sodium, 2, Oxygen, 2) .build(); - IridiumDioxideResidue = new Material.Builder(32079, makeLabsName("iridium_dioxide_residue")) // Hardmode Material + IridiumDioxideResidue = new Material.Builder(79, makeLabsName("iridium_dioxide_residue")) // Hardmode Material .dust() .color(0x17182e).iconSet(ROUGH) .flags(DISABLE_DECOMPOSITION) .components(Iridium, 1, Oxygen, 2, RareEarth, 1) .build(); - AmmoniumHexachloroiridiate = new Material.Builder(32080, makeLabsName("ammonium_hexachloroiridiate")) // Hardmode Material + AmmoniumHexachloroiridiate = new Material.Builder(80, makeLabsName("ammonium_hexachloroiridiate")) // Hardmode Material .dust() .color(0x644629).iconSet(ROUGH) .flags(DISABLE_DECOMPOSITION) .components(Nitrogen, 2, Hydrogen, 8, Iridium, 1, Chlorine, 6) .build().setFormula("(NH4)2IrCl6", true); - PlatinumGroupResidue = new Material.Builder(32081, makeLabsName("platinum_group_residue")) // Hardmode Material + PlatinumGroupResidue = new Material.Builder(81, makeLabsName("platinum_group_residue")) // Hardmode Material .dust() .color(0x64632e).iconSet(ROUGH) .flags(DISABLE_DECOMPOSITION) .components(Iridium, 1, Osmium, 1, Rhodium, 1, Ruthenium, 1, RareEarth, 1) .build(); - PalladiumRichAmmonia = new Material.Builder(32082, makeLabsName("palladium_rich_ammonia")) + PalladiumRichAmmonia = new Material.Builder(82, makeLabsName("palladium_rich_ammonia")) .liquid() .color(0x808080) .flags(DISABLE_DECOMPOSITION) .components(Ammonia, 2, Palladium, 1, Chlorine, 1) .build(); - CrudePlatinumResidue = new Material.Builder(32083, makeLabsName("crude_platinum_residue")) // Hardmode Material + CrudePlatinumResidue = new Material.Builder(83, makeLabsName("crude_platinum_residue")) // Hardmode Material .dust() .color(0xfffbc5).iconSet(DULL) .flags(DISABLE_DECOMPOSITION) .components(PlatinumRaw, 1) .build(); - CrudePalladiumResidue = new Material.Builder(32084, makeLabsName("crude_palladium_residue")) // Hardmode Material + CrudePalladiumResidue = new Material.Builder(84, makeLabsName("crude_palladium_residue")) // Hardmode Material .dust() .color(0x909090).iconSet(DULL) .flags(DISABLE_DECOMPOSITION) .components(PalladiumRaw, 1) .build(); - IridiumGroupSludge = new Material.Builder(32085, makeLabsName("iridium_group_sludge")) // Hardmode Material + IridiumGroupSludge = new Material.Builder(85, makeLabsName("iridium_group_sludge")) // Hardmode Material .dust() .color(0x644629).iconSet(DULL) .flags(DISABLE_DECOMPOSITION) .components(Iridium, 1, Osmium, 1, Ruthenium, 1, RareEarth, 1) .build(); - RhodiumSulfateSolution = new Material.Builder(32086, makeLabsName("rhodium_sulfate_solution")) + RhodiumSulfateSolution = new Material.Builder(86, makeLabsName("rhodium_sulfate_solution")) .liquid() .color(0xffbb66) .flags(DISABLE_DECOMPOSITION) .components(RhodiumSulfate, 1, Water, 1) .build(); - CrudeRhodiumResidue = new Material.Builder(32087, makeLabsName("crude_rhodium_residue")) // Hardmode Material + CrudeRhodiumResidue = new Material.Builder(87, makeLabsName("crude_rhodium_residue")) // Hardmode Material .dust() .color(0x666666).iconSet(DULL) .flags(DISABLE_DECOMPOSITION) .components(Rhodium, 2, Water, 1) .build(); - RhodiumSalt = new Material.Builder(32088, makeLabsName("rhodium_salt")) // Hardmode Material + RhodiumSalt = new Material.Builder(88, makeLabsName("rhodium_salt")) // Hardmode Material .dust() .color(0x848484).iconSet(SHINY) .flags(DISABLE_DECOMPOSITION) .components(Salt, 2, Rhodium, 2, Chlorine, 6) .build().setFormula("(NaCl)2(RhCl3)2", true); - AcidicIridiumDioxideSolution = new Material.Builder(32089, makeLabsName("acidic_iridium_dioxide_solution")) + AcidicIridiumDioxideSolution = new Material.Builder(89, makeLabsName("acidic_iridium_dioxide_solution")) .liquid() .color(0x27284e) .flags(DISABLE_DECOMPOSITION) .components(IridiumDioxideResidue, 1, HydrochloricAcid, 4) .build(); - PlatinumPalladiumLeachate = new Material.Builder(32090, makeLabsName("platinum_palladium_leachate")) + PlatinumPalladiumLeachate = new Material.Builder(90, makeLabsName("platinum_palladium_leachate")) .liquid() .color(0xffffc5) .flags(DISABLE_DECOMPOSITION) .components(Platinum, 1, Palladium, 1, AquaRegia, 1) .build(); - MethylFormate = new Material.Builder(32091, makeLabsName("methyl_formate")) + MethylFormate = new Material.Builder(91, makeLabsName("methyl_formate")) .liquid() .color(0xffaaaa) .flags(DISABLE_DECOMPOSITION) .components(Carbon, 2, Hydrogen, 4, Oxygen, 2) .build().setFormula("HCOOCH3", true); - FormicAcid = new Material.Builder(32092, makeLabsName("formic_acid")) + FormicAcid = new Material.Builder(92, makeLabsName("formic_acid")) .liquid() .color(0xffffc5) .flags(DISABLE_DECOMPOSITION) .components(Carbon, 1, Hydrogen, 2, Oxygen, 2) .build().setFormula("HCOOH", true); - SodiumMethoxide = new Material.Builder(32093, makeLabsName("sodium_methoxide")) // Hardmode Material + SodiumMethoxide = new Material.Builder(93, makeLabsName("sodium_methoxide")) // Hardmode Material .dust() .color(0xd0d0f0).iconSet(DULL) .flags(DISABLE_DECOMPOSITION) diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsTaraniumLine.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsTaraniumLine.java index 30b161c5..fe923d5e 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsTaraniumLine.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsTaraniumLine.java @@ -11,96 +11,96 @@ public class LabsTaraniumLine { public static void initTaraniumLine() { - HexafluorosilicicAcid = new Material.Builder(32094, makeLabsName("hexafluorosilicic_acid")) + HexafluorosilicicAcid = new Material.Builder(94, makeLabsName("hexafluorosilicic_acid")) .liquid() .color(0xd00010) .components(Hydrogen, 2, Silicon, 1, Fluorine, 6) .build(); - DirtyHexafluorosilicicAcid = new Material.Builder(32095, makeLabsName("dirty_hexafluorosilicic_acid")) + DirtyHexafluorosilicicAcid = new Material.Builder(95, makeLabsName("dirty_hexafluorosilicic_acid")) .liquid() .color(0xe00030) .flags(DISABLE_DECOMPOSITION) .components(Hydrogen, 2, Silicon, 1, Fluorine, 6, RareEarth, 1) .build(); - StoneResidue = new Material.Builder(32096, makeLabsName("stone_residue")) // Hardmode Material + StoneResidue = new Material.Builder(96, makeLabsName("stone_residue")) // Hardmode Material .dust() .color(0x4d4d4d).iconSet(ROUGH) .flags(DISABLE_DECOMPOSITION) .build(); - UncommonResidue = new Material.Builder(32097, makeLabsName("uncommon_residue")) // Hardmode Material + UncommonResidue = new Material.Builder(97, makeLabsName("uncommon_residue")) // Hardmode Material .dust() .color(0x4d4ded).iconSet(FINE) .flags(DISABLE_DECOMPOSITION) .build(); - OxidisedResidue = new Material.Builder(32098, makeLabsName("oxidised_residue")) // Hardmode Material + OxidisedResidue = new Material.Builder(98, makeLabsName("oxidised_residue")) // Hardmode Material .dust() .color(0xad4d4d).iconSet(FINE) .flags(DISABLE_DECOMPOSITION) .build(); - RefinedResidue = new Material.Builder(32099, makeLabsName("refined_residue")) // Hardmode Material + RefinedResidue = new Material.Builder(99, makeLabsName("refined_residue")) // Hardmode Material .dust() .color(0x2a8a21).iconSet(SHINY) .flags(DISABLE_DECOMPOSITION) .build(); - CleanInertResidue = new Material.Builder(32100, makeLabsName("clean_inert_residue")) // Hardmode Material + CleanInertResidue = new Material.Builder(100, makeLabsName("clean_inert_residue")) // Hardmode Material .dust() .color(0x3bbd2f).iconSet(SHINY) .flags(DISABLE_DECOMPOSITION) .build(); - UltraacidicResidue = new Material.Builder(32101, makeLabsName("ultraacidic_residue")) + UltraacidicResidue = new Material.Builder(101, makeLabsName("ultraacidic_residue")) .liquid() .color(0xb0babf) .flags(DISABLE_DECOMPOSITION) .build(); - XenicAcid = new Material.Builder(32102, makeLabsName("xenic_acid")) + XenicAcid = new Material.Builder(102, makeLabsName("xenic_acid")) .liquid() .color(0xa567db) .components(Xenon, 1, Water, 1, Oxygen, 5, HydrogenPeroxide, 1) .build().setFormula("H2XeO4", true); - DustyHelium = new Material.Builder(32103, makeLabsName("dusty_helium")) + DustyHelium = new Material.Builder(103, makeLabsName("dusty_helium")) .gas() .color(0xa040af) .flags(DISABLE_DECOMPOSITION) .components(Helium3, 1, RareEarth, 1) .build(); - TaraniumEnrichedHelium = new Material.Builder(32104, makeLabsName("taranium_enriched_helium")) + TaraniumEnrichedHelium = new Material.Builder(104, makeLabsName("taranium_enriched_helium")) .gas() .plasma() .color(0x10c050) .flags(DISABLE_DECOMPOSITION) .build(); - TaraniumDepletedHelium = new Material.Builder(32105, makeLabsName("taranium_depleted_helium")) + TaraniumDepletedHelium = new Material.Builder(105, makeLabsName("taranium_depleted_helium")) .gas() .color(0x006010) .flags(DISABLE_DECOMPOSITION) .build(); - TritiumHydride = new Material.Builder(32106, makeLabsName("tritium_hydride")) + TritiumHydride = new Material.Builder(106, makeLabsName("tritium_hydride")) .gas() .color(0xd01010) .flags(DISABLE_DECOMPOSITION) .components(Tritium, 1, Hydrogen, 1) .build(); - HeliumHydride = new Material.Builder(32107, makeLabsName("helium_hydride")) + HeliumHydride = new Material.Builder(107, makeLabsName("helium_hydride")) .gas() .color(0xe6d62e) .flags(DISABLE_DECOMPOSITION) .components(Helium3, 1, Hydrogen, 1) .build(); - DioxygenDifluoride = new Material.Builder(32108, makeLabsName("dioxygen_difluoride")) + DioxygenDifluoride = new Material.Builder(108, makeLabsName("dioxygen_difluoride")) .liquid(new FluidBuilder().temperature(80)) .colorAverage() .components(Oxygen, 2, Fluorine, 2) diff --git a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsThermal.java b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsThermal.java index 573d0f9b..895dbb51 100644 --- a/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsThermal.java +++ b/src/main/java/com/nomiceu/nomilabs/gregtech/material/registry/register/LabsThermal.java @@ -12,7 +12,7 @@ public class LabsThermal { public static void initThermal() { - Ardite = new Material.Builder(32006, makeLabsName("ardite")) + Ardite = new Material.Builder(6, makeLabsName("ardite")) .ingot() .liquid() .color(0xad2f05).iconSet(DULL) @@ -20,11 +20,11 @@ public static void initThermal() { .components(RedSteel, 3, Blaze, 1) .build(); - Mana = new Material.Builder(32007, makeLabsName("mana")) + Mana = new Material.Builder(7, makeLabsName("mana")) .flags(DISABLE_DECOMPOSITION) .build(); - Manyullyn = new Material.Builder(32008, makeLabsName("manyullyn")) + Manyullyn = new Material.Builder(8, makeLabsName("manyullyn")) .ingot() .liquid() .color(0x9949cc).iconSet(METALLIC) @@ -32,46 +32,46 @@ public static void initThermal() { .components(Ardite, 4, Cobalt, 4, Mana, 1) .build(); - Signalum = new Material.Builder(32010, makeLabsName("signalum")) + Signalum = new Material.Builder(10, makeLabsName("signalum")) .ingot() .liquid() .color(0xff7f0f).iconSet(SHINY) .blast(builder -> builder .temp(4000, GasTier.MID) - .blastStats(VA[IV], 1400) - .vacuumStats(VA[HV], 500)) + .blastStats(VA[5], 1400) + .vacuumStats(VA[3], 500)) .flags(GENERATE_PLATE, GENERATE_DOUBLE_PLATE, GENERATE_DENSE, GENERATE_ROD, GENERATE_GEAR) .components(AnnealedCopper, 4, Ardite, 2, RedAlloy, 2) - .cableProperties(V[LuV], 1, 0, true) + .cableProperties(V[6], 1, 0, true) .build(); - Lumium = new Material.Builder(32017, makeLabsName("lumium")) + Lumium = new Material.Builder(17, makeLabsName("lumium")) .ingot() .liquid() .color(0xf6ff99).iconSet(BRIGHT) .flags(GENERATE_PLATE, GENERATE_DOUBLE_PLATE, GENERATE_GEAR, GENERATE_FINE_WIRE) .blast(builder -> builder .temp(4500, GasTier.MID) - .blastStats(VA[IV], 1600) - .vacuumStats(VA[HV], 600)) + .blastStats(VA[5], 1600) + .vacuumStats(VA[3], 600)) .components(TinAlloy, 4, SterlingSilver, 2) - .cableProperties(V[IV], 1, 0, true) + .cableProperties(V[5], 1, 0, true) .build(); - Enderium = new Material.Builder(32018, makeLabsName("enderium")) + Enderium = new Material.Builder(18, makeLabsName("enderium")) .ingot() .liquid() .color(0x1f6b62).iconSet(SHINY) .flags(GENERATE_PLATE, GENERATE_DOUBLE_PLATE, GENERATE_GEAR, GENERATE_FINE_WIRE) .blast(builder -> builder .temp(6400, GasTier.HIGHEST) - .blastStats(VA[LuV], 1200) - .vacuumStats(VA[EV], 400)) + .blastStats(VA[6], 1200) + .vacuumStats(VA[4], 400)) .components(Lead, 4, Platinum, 2, BlueSteel, 1, Osmium, 1) - .cableProperties(V[ZPM], 1, 0, true) + .cableProperties(V[7], 1, 0, true) .build(); - ElectrumFlux = new Material.Builder(32019, makeLabsName("electrum_flux")) + ElectrumFlux = new Material.Builder(19, makeLabsName("electrum_flux")) .ingot() .liquid() .color(0xf7be20).iconSet(BRIGHT) @@ -80,7 +80,7 @@ public static void initThermal() { .components(Electrum, 6, Lumium, 1, Signalum, 1) .build(); - Mithril = new Material.Builder(32021, makeLabsName("mithril")) + Mithril = new Material.Builder(21, makeLabsName("mithril")) .ingot() .color(0x428fdb).iconSet(DULL) .flags(GENERATE_PLATE, GENERATE_GEAR, NO_UNIFICATION) diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/WorldLoadHandler.java b/src/main/java/com/nomiceu/nomilabs/mixin/WorldLoadHandler.java index 8913b0f6..daf8fe84 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/WorldLoadHandler.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/WorldLoadHandler.java @@ -20,7 +20,8 @@ @Mixin(value = SaveFormatOld.class) public class WorldLoadHandler { // No need for remap, forge method - @Inject(method = "loadAndFix(Ljava/io/File;Lnet/minecraft/util/datafix/DataFixer;Lnet/minecraft/world/storage/SaveHandler;)Lnet/minecraft/world/storage/WorldInfo;", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/nbt/CompressedStreamTools;readCompressed(Ljava/io/InputStream;)Lnet/minecraft/nbt/NBTTagCompound;"), remap = false) + @Inject(method = "loadAndFix(Ljava/io/File;Lnet/minecraft/util/datafix/DataFixer;Lnet/minecraft/world/storage/SaveHandler;)Lnet/minecraft/world/storage/WorldInfo;", + at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/nbt/CompressedStreamTools;readCompressed(Ljava/io/InputStream;)Lnet/minecraft/nbt/NBTTagCompound;", remap = true), remap = false, require = 1) private static void loadDataFixers(File file, DataFixer fixer, SaveHandler save, CallbackInfoReturnable cir) { if (FMLCommonHandler.instance().getEffectiveSide() != Side.SERVER) return; diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/GuiEnergyCoreMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/GuiEnergyCoreMixin.java index c5005552..e34fd5db 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/GuiEnergyCoreMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/GuiEnergyCoreMixin.java @@ -46,14 +46,14 @@ public GuiEnergyCoreMixin(Container inventorySlotsIn) { super(inventorySlotsIn); } - @Inject(method = "initGui", at = @At(value = "INVOKE", target = "Lcom/brandon3055/draconicevolution/client/gui/GuiEnergyCore;updateButtonStates()V")) + @Inject(method = "initGui()V", at = @At(value = "INVOKE", target = "Lcom/brandon3055/draconicevolution/client/gui/GuiEnergyCore;updateButtonStates()V", remap = false), remap = true, require = 1) public void initGui(CallbackInfo ci) { destructCore = GuiEnergyCoreLogic.addDestructButtonToList(this, buttonList); // Change default display string of assemble core assembleCore.displayString = I18n.format("button.de.assembleCore.instant.txt"); } - @Inject(method = "drawGuiContainerBackgroundLayer", at = @At("HEAD"), cancellable = true) + @Inject(method = "drawGuiContainerBackgroundLayer(FII)V", at = @At("HEAD"), cancellable = true, remap = true) protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY, CallbackInfo ci) { var guiCore = (GuiEnergyCore) (Object) this; // We only need to change the background layer of non-active cores (changing wrap text dimensions for non-valid) @@ -94,14 +94,14 @@ private void updateButtonStates(CallbackInfo ci) { } } - @Inject(method = "updateScreen", at = @At("HEAD")) + @Inject(method = "updateScreen()V", at = @At("HEAD"), remap = true) public void updateScreen(CallbackInfo ci) { var guiCore = (GuiEnergyCore) (Object) this; // Reload whether the structure is valid (Fixes needing to exit GUI before able to activate structure after auto-building/destructing) guiCore.tile.validateStructure(); } - @Inject(method = "actionPerformed", at = @At("TAIL"), cancellable = true) + @Inject(method = "actionPerformed(Lnet/minecraft/client/gui/GuiButton;)V", at = @At("TAIL"), cancellable = true, remap = true) public void actionPerformed(GuiButton button, CallbackInfo ci) { if (!(button.id == destructCore.id)) return; diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/InvisECoreBlockMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/InvisECoreBlockMixin.java index 7b2dbddf..b5661603 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/InvisECoreBlockMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/InvisECoreBlockMixin.java @@ -16,7 +16,8 @@ @Mixin(value = InvisECoreBlock.class, remap = false) public class InvisECoreBlockMixin { - @Inject(method = "onBlockHarvested", at = @At("HEAD"), cancellable = true) + @Inject(method = "onBlockHarvested(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/entity/player/EntityPlayer;)V", + at = @At("HEAD"), cancellable = true, remap = true) public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player, CallbackInfo ci) { InvisECoreBlockLogic.onBlockHarvested(world, pos, player); ci.cancel(); diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/ReactorSlotIntegration.java b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/ReactorSlotIntegration.java index d05da271..5db8ae53 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/ReactorSlotIntegration.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/ReactorSlotIntegration.java @@ -20,7 +20,7 @@ public abstract class ReactorSlotIntegration { /** * Overrides Normal Draconic Reactor to allow usage of GT Awakened Draconium. */ - @Inject(method = "getStack", at = @At("HEAD"), cancellable = true) + @Inject(method = "getStack()Lnet/minecraft/item/ItemStack;", at = @At("HEAD"), cancellable = true, remap = true) public void getGTStack(CallbackInfoReturnable cir) { int index = ((ContainerReactor.SlotReactor) (Object) this).getSlotIndex(); if (index < 3) diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/TileEnergyStorageCoreMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/TileEnergyStorageCoreMixin.java index 57f7e682..a874feef 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/TileEnergyStorageCoreMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/TileEnergyStorageCoreMixin.java @@ -11,6 +11,7 @@ import com.nomiceu.nomilabs.integration.draconicevolution.TileEnergyStorageCoreLogic; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ITickable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; @@ -128,8 +129,36 @@ public void receivePacketFromClient(MCDataInput data, EntityPlayerMP client, int ci.cancel(); } - @Inject(method = "update", at = @At("HEAD")) - public void update(CallbackInfo ci) { + /** + * This allows the new features to actually be updated. This is split into two functions, one for Non Obfuscated Environments (Dev Env), + * and one is for Obfuscated Environments (normal instances) + *

+ * This is because {@link TileBCBase} has an {@link TileBCBase#update()} function, + * but {@link TileEnergyStorageCore} also has an {@link TileEnergyStorageCore#update()} function. + *

+ * Mixin fails to find the one in {@link TileEnergyStorageCore} if remap is true, but it can't find it in obfuscated environments + * in runtime, if remap is false, because {@link TileEnergyStorageCore#update()} is overriding {@link ITickable}'s {@link ITickable#update()} function, + * thus it is obfuscated. + *

+ * The obfuscated name one does throw errors, but it works great in runtime, and doesn't crash in build time. This name will not change across forge versions, + * or when loading with Cleanroom Loader. + */ + @Inject(method = "update()V", at = @At("HEAD")) + public void updateDevEnv(CallbackInfo ci) { + updateLogic(); + } + + @SuppressWarnings({"UnresolvedMixinReference", "MixinAnnotationTarget"}) // Removes Errors/Warnings in IDE Inspections (not build time though) + @Inject(method = "func_73660_a()V", at = @At("HEAD")) + public void updateObf(CallbackInfo ci) { + updateLogic(); + } + + /** + * Shared Function so we don't have dupe code. + */ + @Unique + private void updateLogic() { var tile = (TileEnergyStorageCore) (Object) this; if (tile.getWorld().isRemote) return; if (activeBuilder == null) hasActiveBuilder.value = false; // Just in case diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/TileInvisECoreBlockMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/TileInvisECoreBlockMixin.java index fe497bac..fda00467 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/TileInvisECoreBlockMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/TileInvisECoreBlockMixin.java @@ -48,7 +48,7 @@ public void revert(CallbackInfo ci) { ci.cancel(); } - @Inject(method = "getUpdatePacket", at = @At("HEAD"), cancellable = true) + @Inject(method = "getUpdatePacket()Lnet/minecraft/network/play/server/SPacketUpdateTileEntity;", at = @At("HEAD"), cancellable = true, remap = true) public void getUpdatePacket(CallbackInfoReturnable cir) { cir.setReturnValue(TileInvisECoreBlockLogic.getUpdatePacket((TileInvisECoreBlock) (Object) this)); } diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/solarflux/INetworkSF.java b/src/main/java/com/nomiceu/nomilabs/mixin/solarflux/INetworkSF.java deleted file mode 100644 index aa9f9b36..00000000 --- a/src/main/java/com/nomiceu/nomilabs/mixin/solarflux/INetworkSF.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.nomiceu.nomilabs.mixin.solarflux; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; -import tk.zeitheron.solarflux.net.NetworkSF; - -@SuppressWarnings("unused") -@Mixin(value = NetworkSF.class, remap = false) -public interface INetworkSF { - @Accessor - static void setINSTANCE(NetworkSF instance) {} -} diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/solarflux/SolarFluxMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/solarflux/SolarFluxMixin.java deleted file mode 100644 index 551e424e..00000000 --- a/src/main/java/com/nomiceu/nomilabs/mixin/solarflux/SolarFluxMixin.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.nomiceu.nomilabs.mixin.solarflux; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; -import tk.zeitheron.solarflux.SolarFlux; -import tk.zeitheron.solarflux.net.NetworkSF; - -import java.io.File; - -@Mixin(value = SolarFlux.class, remap = false) -public class SolarFluxMixin { - @Shadow - @Mutable - @Final - public static File CONFIG_DIR; - @Redirect(method = "preInit", at = @At(value = "INVOKE", target = "Ltk/zeitheron/solarflux/SolarFlux$FinalFieldHelper;setStaticFinalField(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Z")) - private boolean setStaticFinalFieldConfig(Class cls, String var, Object val) { - CONFIG_DIR = (File) val; - return true; - } - - @Redirect(method = "init", at = @At(value = "INVOKE", target = "Ltk/zeitheron/solarflux/SolarFlux$FinalFieldHelper;setStaticFinalField(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Z")) - private boolean setStaticFinalFieldInstance(Class cls, String var, Object val) { - INetworkSF.setINSTANCE((NetworkSF) val); - return true; - } -} diff --git a/src/main/java/com/nomiceu/nomilabs/remap/LabsRemapHelper.java b/src/main/java/com/nomiceu/nomilabs/remap/LabsRemapHelper.java index 42e05841..c45b01b6 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/LabsRemapHelper.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/LabsRemapHelper.java @@ -16,7 +16,14 @@ import net.minecraftforge.fml.common.registry.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistry; +import java.util.regex.Pattern; + public class LabsRemapHelper { + public static final Pattern META_ITEM_MATCHER = Pattern.compile("meta_.+"); + public static final Pattern META_BLOCK_MATCHER = Pattern.compile("meta_block_.+_\\d+"); + public static final int MIN_META_ITEM_BASE_ID = 32000; // The Base ID where the Old Meta Items/Materials started from + public static final int MIN_META_BLOCK_BASE_ID = 2000; // The Base ID where the Old Meta Blocks started from + public static void createWorldBackup() { try { NomiLabs.LOGGER.info("Creating world backup..."); diff --git a/src/main/java/com/nomiceu/nomilabs/remap/LabsRemappers.java b/src/main/java/com/nomiceu/nomilabs/remap/LabsRemappers.java index 8e26df66..48cd7d36 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/LabsRemappers.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/LabsRemappers.java @@ -8,6 +8,7 @@ import gregtech.api.util.GTUtility; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.event.RegistryEvent; @@ -29,26 +30,32 @@ public class LabsRemappers { public static Map> ignorePtns; private static Map deprecationRemap; + private static Remapper metaBlockRemapper; public static boolean checked = false; public static void preInit() { - helperMapInit(); + helpersInit(); initRemappers(); parseIgnoreConfigs(); } private static void initRemappers() { remappers = new Object2ObjectOpenHashMap<>(); - remappers.put(RemapTypes.ITEM, ImmutableList.of( + + List itemRemappers = new ObjectArrayList<>(); + /* It is too big to use ImmutableList.of(). Add each manually. */ + itemRemappers.add( // Remap Deprecated Items new Remapper(rl -> (deprecationRemap.containsKey(rl)), - rl -> deprecationRemap.get(rl)), - + rl -> deprecationRemap.get(rl)) + ); + itemRemappers.add( // Remap Content Tweaker Items new Remapper(rl -> (rl.getNamespace().equals(CONTENTTWEAKER_MODID)), - rl -> LabsNames.makeLabsName(rl.getPath())), - + rl -> LabsNames.makeLabsName(rl.getPath())) + ); + itemRemappers.add( /* * Remap old DevTech perfect gem to new perfect gem. * DevTech did this badly, and created a MetaPrefixItem with GT's material registry but their @@ -56,12 +63,32 @@ private static void initRemappers() { */ new Remapper(rl -> (rl.getNamespace().equals(DEVTECH_MODID) && rl.getPath().equals("meta_gem_perfect")), rl -> GTUtility.gregtechId(rl.getPath())) - )); + ); + itemRemappers.add( + /* + * Remap old Meta Blocks. This remaps all meta blocks from old crafttweaker materials, to new nomi labs ones. + * Because the old id was + 32000, and the base id (the number after `meta_block_.*_`) is id / 16, + * we can just decrease 2000 from that to get the new base id. + * + * The meta does not need to be changed, as id % 16 stays the same (32000 is thankfully divisible by 16) + */ + metaBlockRemapper + ); + remappers.put(RemapTypes.ITEM, itemRemappers); remappers.put(RemapTypes.BLOCK, ImmutableList.of( // Remap Content Tweaker Blocks new Remapper(rl -> (rl.getNamespace().equals(LabsValues.CONTENTTWEAKER_MODID)), - rl -> LabsNames.makeLabsName(rl.getPath())) + rl -> LabsNames.makeLabsName(rl.getPath())), + + /* + * Remap old Meta Blocks. This remaps all meta blocks from old crafttweaker materials, to new nomi labs ones. + * Because the old id was + 32000, and the base id (the number after `meta_block_.*_`) is id / 16, + * we can just decrease 2000 from that to get the new base id. + * + * The meta does not need to be changed, as id % 16 stays the same (32000 is thankfully divisible by 16) + */ + metaBlockRemapper )); } @@ -86,7 +113,7 @@ private static List parseIgnoreConfig(String[] patterns, RemapTypes typ return ignored; } - private static void helperMapInit() { + private static void helpersInit() { deprecationRemap = new Object2ObjectOpenHashMap<>(); /* It is too big to use ImmutableMap.of(). Add each manually. */ deprecationRemap.put( @@ -113,6 +140,22 @@ private static void helperMapInit() { new ResourceLocation(LabsValues.CONTENTTWEAKER_MODID, "dark_red_coal"), new ResourceLocation(XU2_MODID, "ingredients") ); + + metaBlockRemapper = new Remapper( + (rl) -> getMetaBlockID(rl) >= LabsRemapHelper.MIN_META_BLOCK_BASE_ID, + (rl) -> { + var split = rl.getPath().split("_"); + split[split.length - 1] = String.valueOf(getMetaBlockID(rl) - LabsRemapHelper.MIN_META_BLOCK_BASE_ID); + return LabsNames.makeLabsName(String.join("_", split)); + } + ); + } + + private static int getMetaBlockID(ResourceLocation rl) { + if (!LabsRemapHelper.META_BLOCK_MATCHER.matcher(rl.getPath()).matches()) + return 0; // Return no id, as it is not a meta block + var split = rl.getPath().split("_"); + return Integer.parseInt(split[split.length - 1]); } public static > void remapAndIgnoreEntries(RegistryEvent.MissingMappings event, RemapTypes type) { @@ -146,7 +189,9 @@ public static > void remapAndIgnoreEntries(Regi } if (ignores[i] || needsRemap || remap == null) continue; // Only check if remap is needed if it is not already set to true for (var remapper : remap) { - if (remapper.shouldRemap(entry.key)) needsRemap = true; + if (remapper.shouldNotRemap(entry.key)) continue; + + needsRemap = true; break; } } @@ -176,10 +221,14 @@ public static > void remapAndIgnoreEntries(Regi if (ignores[i]) continue; var entry = mappings.get(i); for (var remapper : remap) { - if (!remapper.shouldRemap(entry.key)) continue; + if (remapper.shouldNotRemap(entry.key)) continue; var oldRl = entry.key; - var newRl = remapper.remapEntry(entry); - NomiLabs.LOGGER.debug("Mapping Resource Location {} to {} (Type {})", oldRl, newRl, type); + NomiLabs.LOGGER.debug("Mapping Resource Location {}... (Type {})", oldRl, type); + var newRl = remapper.remapEntry(entry, type); + if (newRl == null) + NomiLabs.LOGGER.error("Failed to Map Resource Location {}! (Type {})", oldRl, type); + else + NomiLabs.LOGGER.debug("Mapped Resource Location {} to {}! (Type {})", oldRl, newRl, type); break; } } diff --git a/src/main/java/com/nomiceu/nomilabs/remap/Remapper.java b/src/main/java/com/nomiceu/nomilabs/remap/Remapper.java index b9dbfa89..23f648ee 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/Remapper.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/Remapper.java @@ -2,8 +2,11 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.fml.common.registry.ForgeRegistries; +import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.IForgeRegistryEntry; +import javax.annotation.Nullable; import java.util.function.Function; public class Remapper { @@ -15,17 +18,20 @@ public Remapper(Function shouldRemap, Function> ResourceLocation remapEntry(RegistryEvent.MissingMappings.Mapping entry) { + @Nullable + public > ResourceLocation remapEntry(RegistryEvent.MissingMappings.Mapping entry, RemapTypes type) { var rl = remapRl(entry.key); - entry.remap(entry.registry.getValue(rl)); + var remap = new RemapTypes.RegistryHelper().getRegistryForType(type).getValue(rl); + if (remap == null) return null; + entry.remap(remap); return rl; } @@ -33,6 +39,27 @@ public enum RemapTypes { ITEM, BLOCK, ENTITY, - BIOME + BIOME; + + @SuppressWarnings("unchecked") + public static class RegistryHelper> { + public IForgeRegistry getRegistryForType(RemapTypes type) { + switch (type) { + case ITEM -> { + return (IForgeRegistry) ForgeRegistries.ITEMS; + } + case BLOCK -> { + return (IForgeRegistry) ForgeRegistries.BLOCKS; + } + case ENTITY -> { + return (IForgeRegistry) ForgeRegistries.ENTITIES; + } + case BIOME -> { + return (IForgeRegistry) ForgeRegistries.BIOMES; + } + default -> throw new RuntimeException("No Registry Set for Type " + type.name() + "!"); + } + } + } } } diff --git a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/DataFixerHandler.java b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/DataFixerHandler.java index 583e7635..f4ae5687 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/DataFixerHandler.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/DataFixerHandler.java @@ -53,7 +53,8 @@ public class DataFixerHandler { public static Map blockIdToRlMap; public static void preInit() { - LabsFixes.init(); + if (!LabsConfig.advanced.enableDataFixes) return; + CompoundDataFixer fmlFixer = FMLCommonHandler.instance().getDataFixer(); var itemWalker = new ItemStackWalker(); @@ -95,12 +96,13 @@ public static void onWorldLoad(SaveHandler save) { NomiLabs.LOGGER.info("This world's data version is up to date."); return; } - NomiLabs.LOGGER.info("This world's data version needs updating."); + NomiLabs.LOGGER.info("This world's data version needs updating. New Version: {}.", LabsFixes.FIX_VERSION); } else { DataFixerHandler.worldSavedData = new LabsWorldFixData(); - NomiLabs.LOGGER.info("This world was saved without a data version."); + NomiLabs.LOGGER.info("This world was saved without a data version. New Version: {}.", LabsFixes.FIX_VERSION); } + LabsFixes.init(); determineNeededFixesAndLog(save); if (neededFixes.isEmpty()) { NomiLabs.LOGGER.info("This world does not need any data fixers, but it has no saved version or it is old."); diff --git a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsFixes.java b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsFixes.java index 2f28d8ab..53cb32a0 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsFixes.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsFixes.java @@ -2,8 +2,10 @@ import com.nomiceu.nomilabs.LabsValues; import com.nomiceu.nomilabs.config.LabsConfig; +import com.nomiceu.nomilabs.remap.LabsRemapHelper; import com.nomiceu.nomilabs.remap.datafixer.types.LabsFixTypes; import com.nomiceu.nomilabs.util.LabsModeHelper; +import com.nomiceu.nomilabs.util.LabsNames; import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -39,7 +41,17 @@ public class LabsFixes { * The current data format version. Increment this when breaking changes are made and the * data mixer must be applied. If this is not incremented, nothing will be applied. */ - public static final int FIX_VERSION = 1; + public static final int FIX_VERSION = 2; + + /** + * Version before Material Registry Rework. + *

+ * Versions before this need to be remapped. Meta Blocks are remapped based on missing registry event, as they have 'baseID's + * (thus, any new GT Addons must be checked to make sure they do not have IDs in GregTech's Registry above 32000) + *

+ * Meta Items are mapped below. + */ + public static final int PRE_MATERIAL_REWORK_VERSION = 1; /** * Default version, used if save doesn't have a fix version, or if something goes wrong @@ -103,7 +115,8 @@ public static void init() { (version) -> version <= DEFAULT_VERSION, (modList) -> true, (stack) -> stack.rl.equals(new ResourceLocation(CONTENTTWEAKER_MODID, "dark_red_coal")), - (stack) -> stack.setRl(new ResourceLocation(XU2_MODID, "ingredients")).setMeta((short) 4)) // Red Coal + (stack) -> stack.setRl(new ResourceLocation(XU2_MODID, "ingredients")) + .setMeta((short) 4)) // Red Coal ); if (LabsConfig.modIntegration.enableExtraUtils2Integration) @@ -128,8 +141,22 @@ public static void init() { true, (version) -> version <= DEFAULT_VERSION, (modList) -> true, - (stack) -> stack.rl.equals(new ResourceLocation("gregtech:machine")) && multiblockMetaRemap.containsKey(stack.meta), - (stack) -> stack.meta = multiblockMetaRemap.get(stack.meta)) + (stack) -> stack.rl.equals(new ResourceLocation(GREGTECH_MODID,"machine")) && multiblockMetaRemap.containsKey(stack.meta), + (stack) -> stack.setMeta(multiblockMetaRemap.get(stack.meta))) + ); + + itemFixes.add( + new DataFix.ItemFix("Material Meta Item Remap", + "Remaps old Meta Items, from Custom Materials, to the new format and registry.", + false, + (version) -> version <= PRE_MATERIAL_REWORK_VERSION, + (modList) -> true, + (stack) -> stack.rl.getNamespace().equals(GREGTECH_MODID) && + LabsRemapHelper.META_ITEM_MATCHER.matcher(stack.rl.getPath()).matches() && + !LabsRemapHelper.META_BLOCK_MATCHER.matcher(stack.rl.getPath()).matches() && + stack.meta >= LabsRemapHelper.MIN_META_ITEM_BASE_ID, + (stack) -> stack.setMeta((short) (stack.meta - LabsRemapHelper.MIN_META_ITEM_BASE_ID)) + .setRl(LabsNames.makeLabsName(stack.rl.getPath()))) ); /* diff --git a/src/main/resources/mixins.nomilabs.solarflux.json b/src/main/resources/mixins.nomilabs.solarflux.json deleted file mode 100644 index 4cb86124..00000000 --- a/src/main/resources/mixins.nomilabs.solarflux.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "package": "com.nomiceu.nomilabs.mixin.solarflux", - "refmap": "mixins.nomilabs.refmap.json", - "target": "@env(DEFAULT)", - "minVersion": "0.8", - "compatibilityLevel": "JAVA_8", - "mixins": [ - "SolarFluxMixin", - "INetworkSF" - ], - "client": [], - "server": [] -}