Skip to content

Commit

Permalink
Next round of Ra2 conversions (#1982)
Browse files Browse the repository at this point in the history
* process log RA2

* process crop RA2

* process nuggets ra2

* process gear ra2

* process pipe ra2

* unhide leninade
  • Loading branch information
chochem authored May 13, 2023
1 parent dc1d5be commit 422e719
Show file tree
Hide file tree
Showing 6 changed files with 406 additions and 262 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ public GT_MetaGenerated_Item_02() {
tLastID = 106,
"Leninade",
"Let the Communism flow through you!",
SubTag.INVISIBLE,
new GT_FoodStat(
2,
0.2F,
Expand Down
204 changes: 132 additions & 72 deletions src/main/java/gregtech/loaders/oreprocessing/ProcessingCrop.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package gregtech.loaders.oreprocessing;

import static gregtech.api.enums.Mods.IndustrialCraft2;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBrewingRecipes;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sSlicerRecipes;
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
import static gregtech.api.util.GT_RecipeBuilder.TICKS;

import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;

import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
Expand Down Expand Up @@ -33,87 +40,140 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
.addTo(sCompressorRecipes);
}

Fluid[] waterArray;

if (IndustrialCraft2.isModLoaded()) {
waterArray = new Fluid[] { FluidRegistry.WATER, GT_ModHandler.getDistilledWater(1L)
.getFluid() };
} else {
waterArray = new Fluid[] { FluidRegistry.WATER };
}

switch (aOreDictName) {
case "cropTea" -> {
GT_Values.RA.addBrewingRecipe(aStack, FluidRegistry.WATER, FluidRegistry.getFluid("potion.tea"), false);
GT_Values.RA.addBrewingRecipe(
aStack,
GT_ModHandler.getDistilledWater(1L)
.getFluid(),
FluidRegistry.getFluid("potion.tea"),
false);
for (Fluid tFluid : waterArray) {
GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.noItemOutputs()
.fluidInputs(new FluidStack(tFluid, 750))
.fluidOutputs(new FluidStack(FluidRegistry.getFluid("potion.tea"), 750))
.duration(6 * SECONDS + 8 * TICKS)
.eut(4)
.addTo(sBrewingRecipes);
}
}
case "cropGrape" -> {
GT_Values.RA
.addBrewingRecipe(aStack, FluidRegistry.WATER, FluidRegistry.getFluid("potion.grapejuice"), false);
GT_Values.RA.addBrewingRecipe(
aStack,
GT_ModHandler.getDistilledWater(1L)
.getFluid(),
FluidRegistry.getFluid("potion.grapejuice"),
false);
for (Fluid tFluid : waterArray) {
GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.noItemOutputs()
.fluidInputs(new FluidStack(tFluid, 750))
.fluidOutputs(new FluidStack(FluidRegistry.getFluid("potion.grapejuice"), 750))
.duration(6 * SECONDS + 8 * TICKS)
.eut(4)
.addTo(sBrewingRecipes);
}
}
case "cropChilipepper" -> GT_ModHandler
.addPulverisationRecipe(aStack, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chili, 1L));
case "cropCoffee" -> GT_ModHandler
.addPulverisationRecipe(aStack, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coffee, 1L));
case "cropChilipepper" -> GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chili, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(20 * SECONDS)
.eut(2)
.addTo(sMaceratorRecipes);
case "cropCoffee" -> GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coffee, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(20 * SECONDS)
.eut(2)
.addTo(sMaceratorRecipes);
case "cropPotato" -> {
GT_Values.RA.addSlicerRecipe(
aStack,
ItemList.Shape_Slicer_Flat.get(0L),
ItemList.Food_Raw_PotatoChips.get(1L),
64,
4);
GT_Values.RA.addSlicerRecipe(
aStack,
ItemList.Shape_Slicer_Stripes.get(0L),
ItemList.Food_Raw_Fries.get(1L),
64,
4);
GT_Values.RA
.addBrewingRecipe(aStack, FluidRegistry.WATER, FluidRegistry.getFluid("potion.potatojuice"), true);
GT_Values.RA.addBrewingRecipe(
aStack,
GT_ModHandler.getDistilledWater(1L)
.getFluid(),
FluidRegistry.getFluid("potion.potatojuice"),
true);
GT_Values.RA.stdBuilder()
.itemInputs(aStack, ItemList.Shape_Slicer_Flat.get(0))
.itemOutputs(ItemList.Food_Raw_PotatoChips.get(1L))
.noFluidInputs()
.noFluidOutputs()
.duration(3 * SECONDS + 4 * TICKS)
.eut(4)
.addTo(sSlicerRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(aStack, ItemList.Shape_Slicer_Stripes.get(0L))
.itemOutputs(ItemList.Food_Raw_Fries.get(1L))
.noFluidInputs()
.noFluidOutputs()
.duration(3 * SECONDS + 4 * TICKS)
.eut(4)
.addTo(sSlicerRecipes);

for (Fluid tFluid : waterArray) {
GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.noItemOutputs()
.fluidInputs(new FluidStack(tFluid, 750))
.fluidOutputs(new FluidStack(FluidRegistry.getFluid("potion.potatojuice"), 750))
.duration(6 * SECONDS + 8 * TICKS)
.eut(4)
.addTo(sBrewingRecipes);
}
}
case "cropLemon" -> {
GT_Values.RA.addSlicerRecipe(
aStack,
ItemList.Shape_Slicer_Flat.get(0L),
ItemList.Food_Sliced_Lemon.get(4L),
64,
4);
GT_Values.RA
.addBrewingRecipe(aStack, FluidRegistry.WATER, FluidRegistry.getFluid("potion.lemonjuice"), false);
GT_Values.RA.addBrewingRecipe(
aStack,
GT_ModHandler.getDistilledWater(1L)
.getFluid(),
FluidRegistry.getFluid("potion.lemonjuice"),
false);
GT_Values.RA.addBrewingRecipe(
aStack,
FluidRegistry.getFluid("potion.vodka"),
FluidRegistry.getFluid("potion.leninade"),
true);
GT_Values.RA.stdBuilder()
.itemInputs(aStack, ItemList.Shape_Slicer_Flat.get(0))
.itemOutputs(ItemList.Food_Sliced_Lemon.get(4L))
.noFluidInputs()
.noFluidOutputs()
.duration(3 * SECONDS + 4 * TICKS)
.eut(4)
.addTo(sSlicerRecipes);

for (Fluid tFluid : waterArray) {
GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.noItemOutputs()
.fluidInputs(new FluidStack(tFluid, 750))
.fluidOutputs(new FluidStack(FluidRegistry.getFluid("potion.lemonjuice"), 750))
.duration(6 * SECONDS + 8 * TICKS)
.eut(4)
.addTo(sBrewingRecipes);
}

GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.noItemOutputs()
.fluidInputs(new FluidStack(FluidRegistry.getFluid("potion.vodka"), 750))
.fluidOutputs(new FluidStack(FluidRegistry.getFluid("potion.leninade"), 750))
.duration(6 * SECONDS + 8 * TICKS)
.eut(4)
.addTo(sBrewingRecipes);
}
case "cropTomato" -> GT_Values.RA.addSlicerRecipe(
aStack,
ItemList.Shape_Slicer_Flat.get(0L),
ItemList.Food_Sliced_Tomato.get(4L),
64,
4);
case "cropCucumber" -> GT_Values.RA.addSlicerRecipe(
aStack,
ItemList.Shape_Slicer_Flat.get(0L),
ItemList.Food_Sliced_Cucumber.get(4L),
64,
4);
case "cropOnion" -> GT_Values.RA
.addSlicerRecipe(aStack, ItemList.Shape_Slicer_Flat.get(0L), ItemList.Food_Sliced_Onion.get(4L), 64, 4);
case "cropTomato" -> GT_Values.RA.stdBuilder()
.itemInputs(aStack, ItemList.Shape_Slicer_Flat.get(0))
.itemOutputs(ItemList.Food_Sliced_Tomato.get(4L))
.noFluidInputs()
.noFluidOutputs()
.duration(3 * SECONDS + 4 * TICKS)
.eut(4)
.addTo(sSlicerRecipes);
case "cropCucumber" -> GT_Values.RA.stdBuilder()
.itemInputs(aStack, ItemList.Shape_Slicer_Flat.get(0))
.itemOutputs(ItemList.Food_Sliced_Cucumber.get(4L))
.noFluidInputs()
.noFluidOutputs()
.duration(3 * SECONDS + 4 * TICKS)
.eut(4)
.addTo(sSlicerRecipes);
case "cropOnion" -> GT_Values.RA.stdBuilder()
.itemInputs(aStack, ItemList.Shape_Slicer_Flat.get(0))
.itemOutputs(ItemList.Food_Sliced_Onion.get(4L))
.noFluidInputs()
.noFluidOutputs()
.duration(3 * SECONDS + 4 * TICKS)
.eut(4)
.addTo(sSlicerRecipes);
}
}
}
37 changes: 23 additions & 14 deletions src/main/java/gregtech/loaders/oreprocessing/ProcessingGear.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package gregtech.loaders.oreprocessing;

import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes;
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
import static gregtech.api.util.GT_RecipeBuilder.TICKS;
import static gregtech.api.util.GT_Utility.calculateRecipeEU;

import net.minecraft.init.Blocks;
Expand All @@ -24,15 +27,18 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
switch (aPrefix) {
case gearGt -> {
GT_ModHandler.removeRecipeByOutputDelayed(aStack);
if (aMaterial.mStandardMoltenFluid != null)
if (aMaterial.mStandardMoltenFluid != null) {
if (!(aMaterial == Materials.AnnealedCopper || aMaterial == Materials.WroughtIron)) {
GT_Values.RA.addFluidSolidifierRecipe(
ItemList.Shape_Mold_Gear.get(0L),
aMaterial.getMolten(576L),
GT_OreDictUnificator.get(aPrefix, aMaterial, 1L),
128,
calculateRecipeEU(aMaterial, 8));
GT_Values.RA.stdBuilder()
.itemInputs(ItemList.Shape_Mold_Gear.get(0L))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, aMaterial, 1L))
.fluidInputs(aMaterial.getMolten(576L))
.noFluidOutputs()
.duration(6 * SECONDS + 8 * TICKS)
.eut(calculateRecipeEU(aMaterial, 8))
.addTo(sFluidSolidficationRecipes);
}
}
if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial)
&& !aMaterial.contains(SubTag.NO_WORKING)) {
switch (aMaterial.mName) {
Expand All @@ -59,15 +65,18 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
}
}
case gearGtSmall -> {
if (aMaterial.mStandardMoltenFluid != null)
if (aMaterial.mStandardMoltenFluid != null) {
if (!(aMaterial == Materials.AnnealedCopper || aMaterial == Materials.WroughtIron)) {
GT_Values.RA.addFluidSolidifierRecipe(
ItemList.Shape_Mold_Gear_Small.get(0L),
aMaterial.getMolten(144L),
GT_Utility.copyAmount(1L, aStack),
16,
calculateRecipeEU(aMaterial, 8));
GT_Values.RA.stdBuilder()
.itemInputs(ItemList.Shape_Mold_Gear_Small.get(0L))
.itemOutputs(GT_Utility.copyAmount(1L, aStack))
.fluidInputs(aMaterial.getMolten(144L))
.noFluidOutputs()
.duration(16 * TICKS)
.eut(calculateRecipeEU(aMaterial, 8))
.addTo(sFluidSolidficationRecipes);
}
}
if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial)
&& !aMaterial.contains(SubTag.NO_WORKING)) {
switch (aMaterial.mName) {
Expand Down
Loading

0 comments on commit 422e719

Please sign in to comment.