aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/modularui
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-06-04 19:54:11 +0900
committerGitHub <noreply@github.com>2023-06-04 12:54:11 +0200
commitf046db94220c1b582175f858f07fd64e81e6e864 (patch)
tree217d79501c31b76db9d38a75ccaa1ee09d96117e /src/main/java/gregtech/api/interfaces/modularui
parent9e4456e39709d815ba28064620ff0290ac14151b (diff)
downloadGT5-Unofficial-f046db94220c1b582175f858f07fd64e81e6e864.tar.gz
GT5-Unofficial-f046db94220c1b582175f858f07fd64e81e6e864.tar.bz2
GT5-Unofficial-f046db94220c1b582175f858f07fd64e81e6e864.zip
Fix void protection not working with MB with custom output hatch field (#2051)
* Fix void protection not working with MB with custom output hatch field * forgot to filter * Add util method for DT-like structure
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/modularui')
-rw-r--r--src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java b/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java
index cf740a6bc6..04b6b4e6a9 100644
--- a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java
+++ b/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java
@@ -19,6 +19,7 @@ import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import gregtech.api.enums.SoundResource;
import gregtech.api.enums.VoidingMode;
import gregtech.api.gui.modularui.GT_UITextures;
+import gregtech.api.interfaces.tileentity.IVoidable;
/**
* Machines implementing this interface can have logic and GUI buttons
@@ -31,7 +32,7 @@ import gregtech.api.gui.modularui.GT_UITextures;
* <li>Recipe locking</li>
* </ul>
*/
-public interface ControllerWithOptionalFeatures {
+public interface ControllerWithOptionalFeatures extends IVoidable {
boolean isAllowedToWork();
@@ -72,29 +73,6 @@ public interface ControllerWithOptionalFeatures {
return (ButtonWidget) button;
}
- /**
- * @return if this machine can prevent excess item and fluid from voiding.
- */
- boolean supportsVoidProtection();
-
- /**
- * @return if this machine is configured to not void excess item.
- */
- default boolean protectsExcessItem() {
- return supportsVoidProtection() && getVoidingMode().protectItem;
- }
-
- /**
- * @return if this machine is configured to not void excess fluid.
- */
- default boolean protectsExcessFluid() {
- return supportsVoidProtection() && getVoidingMode().protectFluid;
- }
-
- VoidingMode getVoidingMode();
-
- void setVoidingMode(VoidingMode mode);
-
Pos2d getVoidingModeButtonPos();
default ButtonWidget createVoidExcessButton(IWidgetBuilder<?> builder) {