Skip to content

Commit

Permalink
RA2 fixes (#1910)
Browse files Browse the repository at this point in the history
* add circuits

* more circuit

* more circuits

* sa

* fix cell and bucket bending

* more missing circuits

* sa

* gem, wire and stick

* finer nullcheck for gems

* block

* more gem fixes

* dust

* ingot
  • Loading branch information
chochem authored Apr 24, 2023
1 parent d1f5ab6 commit e271583
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 207 deletions.
20 changes: 11 additions & 9 deletions src/main/java/gregtech/loaders/oreprocessing/ProcessingBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
if (tStack2 != null) tStack2.stackSize = 9;
if (tStack3 != null) tStack3.stackSize = 9;

GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.itemOutputs(tStack2)
.noFluidInputs()
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(24)
.addTo(sHammerRecipes);
if (tStack2 != null) {
GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.itemOutputs(tStack2)
.noFluidInputs()
.noFluidOutputs()
.duration(5 * SECONDS)
.eut(24)
.addTo(sHammerRecipes);
}

if (GregTech_API.sRecipeFile.get(
ConfigCategories.Recipes.storageblockdecrafting,
Expand All @@ -105,7 +107,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
GT_ModHandler.addShapelessCraftingRecipe(tStack1, new Object[] { OrePrefixes.block.get(aMaterial) });
}

if (!OrePrefixes.block.isIgnored(aMaterial)) {
if (!OrePrefixes.block.isIgnored(aMaterial) && tStack1 != null) {
// 9 ingots -> 1 block
GT_Values.RA.stdBuilder()
.itemInputs(GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 9L))
Expand Down
21 changes: 12 additions & 9 deletions src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
}
} else if (!aMaterial.contains(SubTag.NO_WORKING)) {
if ((!OrePrefixes.block.isIgnored(aMaterial))
&& (null == GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L))) {
&& (null == GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L))
&& GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L) != null) {

GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(9L, aStack))
Expand All @@ -107,14 +108,16 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
&& (aMaterial != Materials.Clay)) {
// compressor recipe
{
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(15 * SECONDS)
.eut(2)
.addTo(sCompressorRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(15 * SECONDS)
.eut(2)
.addTo(sCompressorRecipes);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public void registerOre(OrePrefixes prefix, Materials material, String oreDictNa

private void registerBenderRecipe(Materials material) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.plate, material, 4L)))
.itemInputs(
GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.plate, material, 4L)),
GT_Utility.getIntegratedCircuit(1))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.foil, material, 4L))
.noFluidInputs()
.noFluidOutputs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private void registerSlicerRecipes(ItemStack stack) {

private void registerBenderRecipes(ItemStack stack) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, stack))
.itemInputs(GT_Utility.copyAmount(1L, stack), GT_Utility.getIntegratedCircuit(1))
.itemOutputs(ItemList.Food_Flat_Dough.get(1L))
.noFluidInputs()
.noFluidOutputs()
Expand Down
159 changes: 88 additions & 71 deletions src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
aMaterial.mFuelType);
}

if (!OrePrefixes.block.isIgnored(aMaterial)) {
if (!OrePrefixes.block.isIgnored(aMaterial)
&& GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L) != null) {
// Compressor recipes
{
GT_Values.RA.stdBuilder()
Expand All @@ -78,89 +79,105 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic
if (aNoSmashing) {
// Forge hammer recipes
{
GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, 2L))
.noFluidInputs()
.noFluidOutputs()
.duration(3 * SECONDS + 4 * TICKS)
.eut(16)
.addTo(sHammerRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(aStack)
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, 2L))
.noFluidInputs()
.noFluidOutputs()
.duration(3 * SECONDS + 4 * TICKS)
.eut(16)
.addTo(sHammerRecipes);
}
}
} else {
// Forge hammer recipes
{
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(Math.max(aMaterialMass, 1L))
.eut(calculateRecipeEU(aMaterial, 16))
.addTo(sHammerRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L) != null) {
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(Math.max(aMaterialMass, 1L))
.eut(calculateRecipeEU(aMaterial, 16))
.addTo(sHammerRecipes);
}
}

// Bender recipes
{
// Plate
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration((int) Math.max(aMaterialMass * 2L, 1L))
.eut(calculateRecipeEU(aMaterial, 24))
.addTo(sBenderRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L) != null) {
// Plate
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(1L, aStack), GT_Utility.getIntegratedCircuit(1))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration((int) Math.max(aMaterialMass * 2L, 1L))
.eut(calculateRecipeEU(aMaterial, 24))
.addTo(sBenderRecipes);
}

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

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

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

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

// dense plate
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(9L, aStack))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(Math.max(aMaterialMass * 9L, 1L))
.eut(calculateRecipeEU(aMaterial, 96))
.addTo(sBenderRecipes);
if (GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L) != null) {
// dense plate
GT_Values.RA.stdBuilder()
.itemInputs(GT_Utility.copyAmount(9L, aStack), GT_Utility.getIntegratedCircuit(9))
.itemOutputs(GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L))
.noFluidInputs()
.noFluidOutputs()
.duration(Math.max(aMaterialMass * 9L, 1L))
.eut(calculateRecipeEU(aMaterial, 96))
.addTo(sBenderRecipes);
}
}
}
if (aNoWorking) {
Expand Down
Loading

0 comments on commit e271583

Please sign in to comment.