diff options
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
4 files changed, 40 insertions, 21 deletions
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 9a60092121..7b29f185c6 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -298,8 +298,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand void receiveClientEvent(byte aEventID, byte aValue); /** - * Called to actually play the Sound. Do not insert Client/Server checks. That is already done for you. Do not - * use @playSoundEffect, Minecraft doesn't like that at all. Use @playSound instead. + * Called to actually play the sound on client side. Client/Server check is already done. */ void doSound(byte aIndex, double aX, double aY, double aZ); diff --git a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java b/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java index 9f862e254d..3d4ed80f67 100644 --- a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java +++ b/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java @@ -20,6 +20,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.IRecipeLockable; import gregtech.api.interfaces.tileentity.IVoidable; /** @@ -33,7 +34,7 @@ import gregtech.api.interfaces.tileentity.IVoidable; * <li>Recipe locking</li> * </ul> */ -public interface ControllerWithOptionalFeatures extends IVoidable { +public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockable { boolean isAllowedToWork(); @@ -233,22 +234,6 @@ public interface ControllerWithOptionalFeatures extends IVoidable { return (ButtonWidget) button; } - /** - * Override this if you are a multi-block that has added support for single recipe locking. - */ - boolean supportsSingleRecipeLocking(); - - /** - * @return true if recipe locking is enabled, else false. This is getter is used for displaying the icon in the GUI - */ - boolean isRecipeLockingEnabled(); - - 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/IHasWorldObjectAndCoords.java b/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java index 64d206aff7..6d81d5c401 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java @@ -136,8 +136,9 @@ public interface IHasWorldObjectAndCoords { boolean isDead(); /** - * Sends a Block Event to the Client TileEntity, the byte Parameters are only for validation as Minecraft doesn't - * properly write Packet Data. + * Sends a Block Event to the Client TileEntity. + * + * @param aValue value to sync */ void sendBlockEvent(byte aID, byte aValue); diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IRecipeLockable.java b/src/main/java/gregtech/api/interfaces/tileentity/IRecipeLockable.java new file mode 100644 index 0000000000..f793221a50 --- /dev/null +++ b/src/main/java/gregtech/api/interfaces/tileentity/IRecipeLockable.java @@ -0,0 +1,34 @@ +package gregtech.api.interfaces.tileentity; + +import gregtech.api.recipe.check.SingleRecipeCheck; +import gregtech.api.util.GT_Recipe; + +/** + * Machines implementing this interface can have logic to lock to a single recipe. + */ +public interface IRecipeLockable { + + /** + * @return if this machine supports single recipe locking. + */ + boolean supportsSingleRecipeLocking(); + + /** + * @return true if recipe locking is enabled, else false. This is getter is used for displaying the icon in the GUI + */ + boolean isRecipeLockingEnabled(); + + void setRecipeLocking(boolean enabled); + + default boolean getDefaultRecipeLockingMode() { + return false; + } + + default SingleRecipeCheck getSingleRecipeCheck() { + return null; + } + + default void setSingleRecipeCheck(SingleRecipeCheck recipeCheck) {} + + GT_Recipe.GT_Recipe_Map getRecipeMap(); +} |