diff --git a/src/main/java/gregtech/integration/exnihilo/ExNihiloModule.java b/src/main/java/gregtech/integration/exnihilo/ExNihiloModule.java index 6d2a3890487..f99425a3949 100644 --- a/src/main/java/gregtech/integration/exnihilo/ExNihiloModule.java +++ b/src/main/java/gregtech/integration/exnihilo/ExNihiloModule.java @@ -1,8 +1,6 @@ package gregtech.integration.exnihilo; -import exnihilocreatio.registries.manager.ExNihiloRegistryManager; import gregtech.api.GTValues; -import gregtech.api.GregTechAPI; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.resources.SteamTexture; import gregtech.api.gui.widgets.ProgressWidget; @@ -44,14 +42,12 @@ import static gregtech.api.unification.ore.OrePrefix.Flags.ENABLE_UNIFICATION; import static gregtech.common.metatileentities.MetaTileEntities.*; - @GregTechModule( moduleID = GregTechModules.MODULE_EN, containerID = GTValues.MODID, modDependencies = GTValues.MODID_EN, - name = "GregTech ExNihiloCreatio integration", - descriptionKey = "gregtech.modules.en_integration.description" -) + name = "GregTech Ex Nihilo Creatio Integration", + description = "Ex Nihilo Integration Module") public class ExNihiloModule extends IntegrationSubmodule { // Items diff --git a/src/main/java/gregtech/integration/exnihilo/metatileentities/MetaTileEntitySteamSieve.java b/src/main/java/gregtech/integration/exnihilo/metatileentities/MetaTileEntitySteamSieve.java index fd97533fa9d..7984177657e 100644 --- a/src/main/java/gregtech/integration/exnihilo/metatileentities/MetaTileEntitySteamSieve.java +++ b/src/main/java/gregtech/integration/exnihilo/metatileentities/MetaTileEntitySteamSieve.java @@ -29,12 +29,12 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol @Override protected IItemHandlerModifiable createImportItemHandler() { - return new NotifiableItemStackHandler(2, this, false); + return new NotifiableItemStackHandler(this, 2, this, false); } @Override protected IItemHandlerModifiable createExportItemHandler() { - return new NotifiableItemStackHandler(30, this, true); + return new NotifiableItemStackHandler(this, 30, this, true); } @Override diff --git a/src/main/java/gregtech/integration/exnihilo/recipes/ExNihiloRecipes.java b/src/main/java/gregtech/integration/exnihilo/recipes/ExNihiloRecipes.java index 9d6559c49cd..77345da27ea 100644 --- a/src/main/java/gregtech/integration/exnihilo/recipes/ExNihiloRecipes.java +++ b/src/main/java/gregtech/integration/exnihilo/recipes/ExNihiloRecipes.java @@ -7,6 +7,7 @@ import gregtech.api.recipes.ModHandler; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.builders.SimpleRecipeBuilder; +import gregtech.api.recipes.chance.output.ChancedOutputLogic; import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.Material; import gregtech.api.unification.material.Materials; @@ -54,8 +55,8 @@ private static void processChunk(OrePrefix orePrefix, Material material, OreProp public static void registerGTRecipes() { // Machine Recipes MetaTileEntityLoader.registerMachineRecipe(SIEVES, "CPC", "FMF", "OSO", 'M', HULL, 'C', CIRCUIT, 'O', CABLE, 'F', CONVEYOR, 'S', new ItemStack(ModBlocks.sieve), 'P', PISTON); - ModHandler.addShapedRecipe("steam_sieve_bronze", STEAM_SIEVE_BRONZE.getStackForm(), "BPB", "BMB", "BSB", 'B', new UnificationEntry(OrePrefix.pipeSmallFluid, Materials.Bronze), 'M', MetaBlocks.STEAM_CASING.getItemVariant(BRONZE_HULL), 'S', new ItemStack(ModBlocks.sieve), 'P', Blocks.PISTON); - ModHandler.addShapedRecipe("steam_sieve_steel", STEAM_SIEVE_STEEL.getStackForm(), "BPB", "WMW", "BBB", 'B', new UnificationEntry(OrePrefix.pipeSmallFluid, Materials.WroughtIron), 'M', STEAM_SIEVE_BRONZE.getStackForm(), 'W', new UnificationEntry(OrePrefix.plate, Materials.WroughtIron), 'P', new UnificationEntry(OrePrefix.plate, Materials.Steel)); + ModHandler.addShapedRecipe(true, "steam_sieve_bronze", STEAM_SIEVE_BRONZE.getStackForm(), "BPB", "BMB", "BSB", 'B', new UnificationEntry(OrePrefix.pipeSmallFluid, Materials.Bronze), 'M', MetaBlocks.STEAM_CASING.getItemVariant(BRONZE_HULL), 'S', new ItemStack(ModBlocks.sieve), 'P', Blocks.PISTON); + ModHandler.addShapedRecipe(true, "steam_sieve_steel", STEAM_SIEVE_STEEL.getStackForm(), "BPB", "WMW", "BBB", 'B', new UnificationEntry(OrePrefix.pipeSmallFluid, Materials.WroughtIron), 'M', STEAM_SIEVE_BRONZE.getStackForm(), 'W', new UnificationEntry(OrePrefix.plate, Materials.WroughtIron), 'P', new UnificationEntry(OrePrefix.plate, Materials.Steel)); } // Has to be done in init phase because of ExNi registering outside the Registry event @@ -68,12 +69,15 @@ public static void registerExNihiloRecipes() { SimpleRecipeBuilder builder = SIEVE_RECIPES.recipeBuilder().notConsumable(recipe.getMesh()).inputs(stack); for (Siftable siftable : ExNihiloRegistryManager.SIEVE_REGISTRY.getDrops(stack)) { - if (siftable.getMeshLevel() == recipe.getMesh().getMetadata()) - if ((int) (siftable.getChance() * (float) Recipe.getMaxChancedValue()) >= Recipe.getMaxChancedValue()) { + if (siftable.getDrop() == null) continue; + if (siftable.getMeshLevel() == recipe.getMesh().getMetadata()) { + int maxChance = ChancedOutputLogic.getMaxChancedValue(); + if ((int) (siftable.getChance() * (float) maxChance) >= maxChance) { builder.outputs(siftable.getDrop().getItemStack()); } else { - builder.chancedOutput(siftable.getDrop().getItemStack(), (int) (siftable.getChance() * (float) Recipe.getMaxChancedValue()), 200); + builder.chancedOutput(siftable.getDrop().getItemStack(), (int) (siftable.getChance() * (float) maxChance), 200); } + } } builder.buildAndRegister(); }