diff options
Diffstat (limited to 'src/main/java/gregtech/api/recipe')
3 files changed, 77 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/recipe/RecipeMaps.java b/src/main/java/gregtech/api/recipe/RecipeMaps.java index 6d614d27d0..a2f053922c 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMaps.java +++ b/src/main/java/gregtech/api/recipe/RecipeMaps.java @@ -61,7 +61,9 @@ import gregtech.api.recipe.maps.OilCrackerBackend; import gregtech.api.recipe.maps.PrinterBackend; import gregtech.api.recipe.maps.PurificationUnitClarifierFrontend; import gregtech.api.recipe.maps.PurificationUnitFlocculatorFrontend; +import gregtech.api.recipe.maps.PurificationUnitLaserFrontend; import gregtech.api.recipe.maps.PurificationUnitOzonationFrontend; +import gregtech.api.recipe.maps.PurificationUnitParticleExtractorFrontend; import gregtech.api.recipe.maps.PurificationUnitPhAdjustmentFrontend; import gregtech.api.recipe.maps.PurificationUnitPlasmaHeaterFrontend; import gregtech.api.recipe.maps.RecyclerBackend; @@ -1225,9 +1227,10 @@ public final class RecipeMaps { .build(); public static final RecipeMap<RecipeMapBackend> purificationUVTreatmentRecipes = RecipeMapBuilder .of("gt.recipe.purificationplantuvtreatment") - .maxIO(0, 0, 1, 1) + .maxIO(9, 0, 1, 1) .minInputs(0, 1) .progressBar(GT_UITextures.PROGRESSBAR_ARROW) + .frontend(PurificationUnitLaserFrontend::new) .disableOptimize() .build(); public static final RecipeMap<RecipeMapBackend> purificationDegasifierRecipes = RecipeMapBuilder @@ -1242,6 +1245,7 @@ public final class RecipeMaps { .maxIO(2, 1, 1, 2) .minInputs(0, 1) .progressBar(GT_UITextures.PROGRESSBAR_ARROW) + .frontend(PurificationUnitParticleExtractorFrontend::new) .disableOptimize() .build(); public static final RecipeMap<RecipeMapBackend> ic2NuclearFakeRecipes = RecipeMapBuilder.of("gt.recipe.ic2nuke") diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitLaserFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitLaserFrontend.java new file mode 100644 index 0000000000..df42259864 --- /dev/null +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitLaserFrontend.java @@ -0,0 +1,36 @@ +package gregtech.api.recipe.maps; + +import java.util.List; + +import net.minecraft.item.ItemStack; + +import com.gtnewhorizons.modularui.api.math.Pos2d; + +import codechicken.nei.PositionedStack; +import gregtech.api.recipe.BasicUIPropertiesBuilder; +import gregtech.api.recipe.NEIRecipePropertiesBuilder; +import gregtech.api.recipe.RecipeMapFrontend; +import gregtech.common.gui.modularui.UIHelper; +import gregtech.common.tileentities.machines.multi.purification.GT_MetaTileEntity_PurificationUnitUVTreatment; +import gregtech.nei.GT_NEI_DefaultHandler; + +public class PurificationUnitLaserFrontend extends RecipeMapFrontend { + + public PurificationUnitLaserFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, + NEIRecipePropertiesBuilder neiPropertiesBuilder) { + super(uiPropertiesBuilder, neiPropertiesBuilder); + } + + @Override + public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + final int numLenses = GT_MetaTileEntity_PurificationUnitUVTreatment.LENS_ITEMS.size(); + List<Pos2d> positions = UIHelper.getGridPositions(numLenses, 12, -4, 3, 3); + // Put in lens items + for (int i = 0; i < numLenses; ++i) { + Pos2d position = positions.get(i); + ItemStack lens = GT_MetaTileEntity_PurificationUnitUVTreatment.LENS_ITEMS.get(i); + neiCachedRecipe.mInputs.add(new PositionedStack(lens, position.x, position.y, false)); + } + super.drawNEIOverlays(neiCachedRecipe); + } +} diff --git a/src/main/java/gregtech/api/recipe/maps/PurificationUnitParticleExtractorFrontend.java b/src/main/java/gregtech/api/recipe/maps/PurificationUnitParticleExtractorFrontend.java new file mode 100644 index 0000000000..bbbd88fd5f --- /dev/null +++ b/src/main/java/gregtech/api/recipe/maps/PurificationUnitParticleExtractorFrontend.java @@ -0,0 +1,36 @@ +package gregtech.api.recipe.maps; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; + +import com.gtnewhorizons.modularui.api.math.Pos2d; + +import codechicken.nei.PositionedStack; +import gregtech.api.recipe.BasicUIPropertiesBuilder; +import gregtech.api.recipe.NEIRecipePropertiesBuilder; +import gregtech.api.recipe.RecipeMapFrontend; +import gregtech.common.gui.modularui.UIHelper; +import gregtech.nei.GT_NEI_DefaultHandler; + +public class PurificationUnitParticleExtractorFrontend extends RecipeMapFrontend { + + public static final ArrayList<ItemStack> inputItems = new ArrayList<>(); + public static final ArrayList<ItemStack> inputItemsShuffled = new ArrayList<>(); + + public PurificationUnitParticleExtractorFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, + NEIRecipePropertiesBuilder neiPropertiesBuilder) { + super(uiPropertiesBuilder, neiPropertiesBuilder); + } + + @Override + public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + List<Pos2d> positions = UIHelper.getGridPositions(2, 30, 14, 2, 1); + Pos2d pos1 = positions.get(0); + Pos2d pos2 = positions.get(1); + neiCachedRecipe.mInputs.set(0, new PositionedStack(inputItems, pos1.x, pos1.y, true)); + neiCachedRecipe.mInputs.set(1, new PositionedStack(inputItemsShuffled, pos2.x, pos2.y, true)); + super.drawNEIOverlays(neiCachedRecipe); + } +} |