Skip to content

Commit a2dc0d8

Browse files
authored
Clean up Chemical Vat Recipe Modifier (#100)
* fix up recipe modifier * spotless
1 parent b357c0b commit a2dc0d8

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/main/java/com/ghostipedia/cosmiccore/common/data/recipe/CosmicRecipeModifiers.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.ghostipedia.cosmiccore.common.machine.multiblock.electric.MagneticFieldMachine;
44

5-
import com.gregtechceu.gtceu.api.capability.IParallelHatch;
65
import com.gregtechceu.gtceu.api.capability.recipe.IO;
76
import com.gregtechceu.gtceu.api.capability.recipe.ItemRecipeCapability;
87
import com.gregtechceu.gtceu.api.machine.MetaMachine;
@@ -23,7 +22,6 @@
2322
import org.jetbrains.annotations.NotNull;
2423

2524
import java.util.Collections;
26-
import java.util.Optional;
2725

2826
public class CosmicRecipeModifiers {
2927

@@ -59,17 +57,10 @@ public static ModifierFunction vomahineReactorOC(MetaMachine machine, GTRecipe r
5957

6058
public static ModifierFunction chemicalVatLogic(MetaMachine machine, GTRecipe recipe) {
6159
if (machine instanceof WorkableMultiblockMachine vatMachine) {
62-
Optional<IParallelHatch> optionalIParallelHatch = vatMachine.getParts().stream()
63-
.filter(IParallelHatch.class::isInstance).map(IParallelHatch.class::cast).findAny();
64-
if (optionalIParallelHatch.isPresent()) {
65-
IParallelHatch parallelHatch = optionalIParallelHatch.get();
66-
var actualParallel = 1;
67-
if (parallelHatch.getCurrentParallel() != 0) {
68-
long EUt = recipe.getInputEUt().getTotalEU();
69-
actualParallel = ParallelLogic.getParallelAmount(vatMachine, recipe,
70-
parallelHatch.getCurrentParallel());
60+
if (vatMachine.getParallelHatch().isPresent()) {
61+
int actualParallel = ParallelLogic.getParallelAmount(vatMachine, recipe,
62+
vatMachine.getParallelHatch().get().getCurrentParallel());
7163

72-
}
7364
return ModifierFunction.builder()
7465
.modifyAllContents(ContentModifier.multiplier(actualParallel))
7566
.eutMultiplier(actualParallel * 0.75F)

src/main/java/com/ghostipedia/cosmiccore/common/machine/multiblock/multi/IndustChemVat.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public class IndustChemVat {
3131
.multiblock("industrial_chemical_vat", WorkableElectricMultiblockMachine::new)
3232
.rotationState(RotationState.ALL)
3333
.recipeTypes(CosmicRecipeTypes.INDUSTRIAL_CHEMVAT, GTRecipeTypes.CRACKING_RECIPES)
34-
.recipeModifiers(CosmicRecipeModifiers::chemicalVatLogic, PARALLEL_HATCH, ELECTRIC_OVERCLOCK.apply(OverclockingLogic.PERFECT_OVERCLOCK_SUBTICK),
34+
.recipeModifiers(CosmicRecipeModifiers::chemicalVatLogic, PARALLEL_HATCH,
35+
ELECTRIC_OVERCLOCK.apply(OverclockingLogic.PERFECT_OVERCLOCK_SUBTICK),
3536
BATCH_MODE)
3637
.appearanceBlock(CYCLOZINE_CHEMICALLY_REPELLING_CASING)
3738
// spotless:off

0 commit comments

Comments
 (0)