aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/logic
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-05-28 18:21:42 +0900
committerGitHub <noreply@github.com>2023-05-28 11:21:42 +0200
commit9af741164c5b59c4d884aba48ebeab7db5442d63 (patch)
tree5bbbbb5feb67db85aefd5f21fd885a1a0ab71c78 /src/main/java/gregtech/api/logic
parent24ad01683a084bebd26152b803ee19bffe78213c (diff)
downloadGT5-Unofficial-9af741164c5b59c4d884aba48ebeab7db5442d63.tar.gz
GT5-Unofficial-9af741164c5b59c4d884aba48ebeab7db5442d63.tar.bz2
GT5-Unofficial-9af741164c5b59c4d884aba48ebeab7db5442d63.zip
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
Diffstat (limited to 'src/main/java/gregtech/api/logic')
-rw-r--r--src/main/java/gregtech/api/logic/ComplexParallelProcessingLogic.java16
1 files changed, 8 insertions, 8 deletions
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) {