Skip to content

Commit

Permalink
Some more ra2 fixes (#1932)
Browse files Browse the repository at this point in the history
* multiple RA2 fixes

* revert the revert of my work

why do I have to fix shit multiple times

* more fixes

* and more

* these dont exist and are always null

* sa

* better check

* and another forgotten null check

* fix turbine blades
  • Loading branch information
chochem authored Apr 30, 2023
1 parent 2c4471c commit 5192502
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 168 deletions.
3 changes: 2 additions & 1 deletion src/main/java/gregtech/api/util/GT_RecipeRegistrator.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ public static void registerReverseMacerating(ItemStack aStack, ItemData aData, b

for (MaterialStack tMaterial : aData.getAllMaterialStacks()) {
if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL)
&& tMaterial.mMaterial != Materials.Glass) {
&& tMaterial.mMaterial != Materials.Glass
&& GT_OreDictUnificator.getDust(aData.mMaterial) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1, aStack))
.itemOutputs(GT_OreDictUnificator.getDust(aData.mMaterial))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ public ProcessingCrystallized() {
public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName,
ItemStack aStack) {

GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(10 * TICKS)
.eut(16)
.addTo(sHammerRecipes);

GT_ModHandler.addPulverisationRecipe(
GT_Utility.copyAmount(1L, aStack),
GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L),
null,
10,
false);
if (aMaterial.mMacerateInto != null
&& GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(10 * TICKS)
.eut(16)
.addTo(sHammerRecipes);

GT_ModHandler.addPulverisationRecipe(
GT_Utility.copyAmount(1L, aStack),
GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L),
null,
10,
false);
}
}
}
21 changes: 12 additions & 9 deletions src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,19 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
for (ItemStack is : OreDictionary.getOres("craftingLens" + aMaterial.mColor.mName.replace(" ", ""))) { // Engraver
// Laser engraver recipes
{
is.stackSize = 0;

GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(3L, aStack), is)
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(60 * SECONDS)
.eut(TierEU.RECIPE_HV)
.addTo(sLaserEngraverRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, 1L) != null) {
is.stackSize = 0;

GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(3L, aStack), is)
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(60 * SECONDS)
.eut(TierEU.RECIPE_HV)
.addTo(sLaserEngraverRecipes);
}

}
}
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,16 @@ private void registerPlateDouble(final Materials aMaterial, final ItemStack aSta

if (!aNoSmashing) {
// 2 double -> 1 quadruple plate
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(2L, aStack), GT_Utility.getIntegratedCircuit(2))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(Math.max(aMaterialMass * 2L, 1L))
.eut(calculateRecipeEU(aMaterial, 96))
.addTo(sBenderRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(2L, aStack), GT_Utility.getIntegratedCircuit(2))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(Math.max(aMaterialMass * 2L, 1L))
.eut(calculateRecipeEU(aMaterial, 96))
.addTo(sBenderRecipes);
}

if (GregTech_API.sRecipeFile.get(
gregtech.api.enums.ConfigCategories.Tools.hammerdoubleplate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
if (!aMaterial.contains(SubTag.NO_SMASHING)) {
// Bender recipes
{
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack), GT_Utility.getIntegratedCircuit(1))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.spring, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(10 * SECONDS)
.eut(calculateRecipeEU(aMaterial, 16))
.addTo(sBenderRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.spring, aMaterial, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack), GT_Utility.getIntegratedCircuit(1))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.spring, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(10 * SECONDS)
.eut(calculateRecipeEU(aMaterial, 16))
.addTo(sBenderRecipes);
}
}

if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1168,16 +1168,19 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
}

// Turbine blades
GT_Values.RA.stdBuilder()
.itemInputs(
GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 3L),
GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 2L))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(10 * SECONDS)
.eut(calculateRecipeEU(aMaterial, 60))
.addTo(sPressRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L) != null
&& GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(
GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 3L),
GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 2L))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(10 * SECONDS)
.eut(calculateRecipeEU(aMaterial, 60))
.addTo(sPressRecipes);
}
}
}
default -> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,55 +33,37 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
case "Wood" ->
// Chemical bath recipes
{
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.WoodSealed, 1L))
.fluidInputs(
Materials.SeedOil
.getFluid(GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 120L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.WoodSealed, 1L))
.fluidInputs(
Materials.SeedOilLin
.getFluid(GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 80L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.WoodSealed, 1L))
.fluidInputs(
Materials.SeedOilHemp
.getFluid(GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 80L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);

}
case "Iron" -> {
// Chemical bath recipes
{
if (GT_OreDictUnificator.get(aPrefix, Materials.WoodSealed, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.WoodSealed, 1L))
.fluidInputs(
Materials.FierySteel
.getFluid(GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 250L, true)))
Materials.SeedOil
.getFluid(GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 120L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);
}

}
case "Iron" -> {
// Chemical bath recipes
{
if (GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L))
.fluidInputs(
Materials.FierySteel.getFluid(
GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 250L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);
}
}

// Polarizer recipes
{
GT_Values.RA.addPolarizerRecipe(
Expand All @@ -94,16 +76,18 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
case "WroughtIron" -> {
// Chemical bath recipes
{
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L))
.fluidInputs(
Materials.FierySteel
.getFluid(GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 225L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);
if (GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L))
.fluidInputs(
Materials.FierySteel.getFluid(
GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 225L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);
}
}

// Polarizer recipes
Expand All @@ -118,16 +102,18 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
case "Steel" -> {
// Chemical Bath recipes
{
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L))
.fluidInputs(
Materials.FierySteel
.getFluid(GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 200L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);
if (GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(aPrefix, Materials.FierySteel, 1L))
.fluidInputs(
Materials.FierySteel.getFluid(
GT_Utility.translateMaterialToAmount(aPrefix.mMaterialAmount, 200L, true)))
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(TierEU.ULV)
.addTo(sChemicalBathRecipes);
}
}

// polarizer recipes
Expand Down
Loading

0 comments on commit 5192502

Please sign in to comment.