From 9af741164c5b59c4d884aba48ebeab7db5442d63 Mon Sep 17 00:00:00 2001 From: miozune Date: Sun, 28 May 2023 18:21:42 +0900 Subject: Add new mode for void protection & implement it for more multis (#2024) * Void protection improvements * Rename methods: isXXXButtonEnabled -> supportsXXX * Adjust texture for forbidden * Add MultiBlockFeatureSupportDumpers * Fix oversight in PCBFactory * Revert void protection support for PA * Rename class: ControllerWithButtons -> ControllerWithOptionalFeatures --- .../api/logic/ComplexParallelProcessingLogic.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/java/gregtech/api/logic') diff --git a/src/main/java/gregtech/api/logic/ComplexParallelProcessingLogic.java b/src/main/java/gregtech/api/logic/ComplexParallelProcessingLogic.java index d38a3d98fd..4c49a88819 100644 --- a/src/main/java/gregtech/api/logic/ComplexParallelProcessingLogic.java +++ b/src/main/java/gregtech/api/logic/ComplexParallelProcessingLogic.java @@ -23,7 +23,8 @@ public class ComplexParallelProcessingLogic { protected final long[] availableEut; protected final long[] eut; protected final long[] durations; - protected boolean[] isVoidProtected; + protected boolean[] isItemVoidProtected; + protected boolean[] isFluidVoidProtected; public ComplexParallelProcessingLogic(int maxComplexParallels) { this(null, maxComplexParallels); @@ -39,7 +40,8 @@ public class ComplexParallelProcessingLogic { eut = new long[maxComplexParallels]; availableEut = new long[maxComplexParallels]; durations = new long[maxComplexParallels]; - isVoidProtected = new boolean[maxComplexParallels]; + isItemVoidProtected = new boolean[maxComplexParallels]; + isFluidVoidProtected = new boolean[maxComplexParallels]; } public ComplexParallelProcessingLogic setRecipeMap(GT_Recipe.GT_Recipe_Map recipeMap) { @@ -73,9 +75,10 @@ public class ComplexParallelProcessingLogic { return this; } - public ComplexParallelProcessingLogic setVoidProtection(int index, boolean shouldVoidProtect) { + public ComplexParallelProcessingLogic setVoidProtection(int index, boolean protectItem, boolean protectFluid) { if (index >= 0 && index < maxComplexParallels) { - isVoidProtected[index] = shouldVoidProtect; + isItemVoidProtected[index] = protectItem; + isFluidVoidProtected[index] = protectFluid; } return this; } @@ -122,13 +125,10 @@ public class ComplexParallelProcessingLogic { .setItemInputs(inputItems[index]) .setFluidInputs(inputFluids[index]) .setAvailableEUt(availableEut[index]) + .setController(tileEntity, isItemVoidProtected[index], isFluidVoidProtected[index]) .enableConsumption() .enableOutputCalculation(); - if (isVoidProtected[index]) { - helper.enableVoidProtection(tileEntity); - } - helper.build(); if (helper.getCurrentParallel() <= 0) { -- cgit