diff options
author | miozune <miozune@gmail.com> | 2023-06-11 02:19:54 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-10 19:19:54 +0200 |
commit | 8e3c8829d737d92da5503bd34d0c51130b6b3f00 (patch) | |
tree | 54c64a99c847aa900024f065b51a4caf80f61115 /src | |
parent | 7a4acc4ef1d944a321945b6d565843005fc88dce (diff) | |
download | GT5-Unofficial-8e3c8829d737d92da5503bd34d0c51130b6b3f00.tar.gz GT5-Unofficial-8e3c8829d737d92da5503bd34d0c51130b6b3f00.tar.bz2 GT5-Unofficial-8e3c8829d737d92da5503bd34d0c51130b6b3f00.zip |
Enable input separation by default if it's supported (#2072)
Diffstat (limited to 'src')
4 files changed, 24 insertions, 9 deletions
diff --git a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java b/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java index e6e3142196..9f862e254d 100644 --- a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java +++ b/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java @@ -127,6 +127,10 @@ public interface ControllerWithOptionalFeatures extends IVoidable { void setInputSeparation(boolean enabled); + default boolean getDefaultInputSeparationMode() { + return supportsInputSeparation(); + } + Pos2d getInputSeparationButtonPos(); default ButtonWidget createInputSeparationButton(IWidgetBuilder<?> builder) { @@ -183,6 +187,10 @@ public interface ControllerWithOptionalFeatures extends IVoidable { void setBatchMode(boolean enabled); + default boolean getDefaultBatchMode() { + return false; + } + Pos2d getBatchModeButtonPos(); default ButtonWidget createBatchModeButton(IWidgetBuilder<?> builder) { @@ -237,6 +245,10 @@ public interface ControllerWithOptionalFeatures extends IVoidable { void setRecipeLocking(boolean enabled); + default boolean getDefaultRecipeLockingMode() { + return false; + } + Pos2d getRecipeLockingButtonPos(); default ButtonWidget createLockToSingleRecipeButton(IWidgetBuilder<?> builder) { diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IVoidable.java b/src/main/java/gregtech/api/interfaces/tileentity/IVoidable.java index d6325e8597..f4467a2e8c 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IVoidable.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IVoidable.java @@ -36,6 +36,10 @@ public interface IVoidable { void setVoidingMode(VoidingMode mode); + default VoidingMode getDefaultVoidingMode() { + return supportsVoidProtection() ? VoidingMode.VOID_NONE : VoidingMode.VOID_ALL; + } + /** * @param toOutput List of items this machine is going to output. * @return List of slots available for item outputs. Null element represents empty slot. diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 7b19323b89..8f5f3ee48c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -99,10 +99,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public int damageFactorLow = 5; public float damageFactorHigh = 0.6f; - public boolean mLockedToSingleRecipe = false; - protected boolean inputSeparation = false; - protected VoidingMode voidingMode = VoidingMode.VOID_ALL; - protected boolean batchMode = false; + public boolean mLockedToSingleRecipe = getDefaultRecipeLockingMode(); + protected boolean inputSeparation = getDefaultInputSeparationMode(); + protected VoidingMode voidingMode = getDefaultVoidingMode(); + protected boolean batchMode = getDefaultBatchMode(); protected static final String INPUT_SEPARATION_NBT_KEY = "inputSeparation"; protected static final String VOID_EXCESS_NBT_KEY = "voidExcess"; protected static final String VOIDING_MODE_NBT_KEY = "voidingMode"; @@ -143,7 +143,6 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5); this.damageFactorHigh = (float) GregTech_API.sMachineFile .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f); - voidingMode = supportsVoidProtection() ? VoidingMode.VOID_NONE : VoidingMode.VOID_ALL; } // maybe remove this at some point? diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java b/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java index 14e7883398..b96a822e4b 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java @@ -132,10 +132,10 @@ public abstract class Controller<T extends Controller<T>> extends MultiTileBasic private IAlignmentLimits limits = getInitialAlignmentLimits(); private String inventoryName; private String tankName; - protected boolean separateInputs = false; - protected VoidingMode voidingMode = supportsVoidProtection() ? VoidingMode.VOID_NONE : VoidingMode.VOID_ALL; - protected boolean batchMode = false; - protected boolean recipeLock = false; + protected boolean separateInputs = getDefaultInputSeparationMode(); + protected VoidingMode voidingMode = getDefaultVoidingMode(); + protected boolean batchMode = getDefaultBatchMode(); + protected boolean recipeLock = getDefaultRecipeLockingMode(); /** If this is set to true, the machine will get default WAILA behavior */ protected boolean isSimpleMachine = true; |