diff options
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/metatileentity')
-rw-r--r-- | src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java | 44 | ||||
-rw-r--r-- | src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java | 64 |
2 files changed, 61 insertions, 47 deletions
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java b/src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java deleted file mode 100644 index 59a70b450d..0000000000 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java +++ /dev/null @@ -1,44 +0,0 @@ -package gregtech.api.interfaces.metatileentity; - -import gregtech.api.GregTech_API; -import java.util.List; -import net.minecraft.item.ItemStack; - -/** - * Implement this interface if your metatileentity supports configuration circuits - * to resolve recipe conflicts. - */ -public interface IConfigurationCircuitSupport { - /** - * - * @return Integrated circuit slot index in the machine inventory - */ - int getCircuitSlot(); - - /** - * Return a list of possible configuration circuit this machine expects. - * - * This list is unmodifiable. Its elements are not supposed to be modified in any way! - */ - default List<ItemStack> getConfigurationCircuits() { - return GregTech_API.getConfigurationCircuitList(100); - } - - /** - * - * @return True if that machine supports built-in configuration circuit - */ - boolean allowSelectCircuit(); - - /** - * - * @return Circuit slot index in GUI container - */ - default int getCircuitGUISlot() { - return getCircuitSlot(); - } - - int getCircuitSlotX(); - - int getCircuitSlotY(); -} diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 29b0a56a89..59d048e618 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -1,14 +1,18 @@ package gregtech.api.interfaces.metatileentity; +import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Dyes; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IGetGUITextureSet; import gregtech.api.interfaces.tileentity.IGearEnergyTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IGregtechWailaProvider; import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_Util; import java.io.File; import java.util.ArrayList; import java.util.List; @@ -38,7 +42,8 @@ public interface IMetaTileEntity IFluidHandler, IGearEnergyTileEntity, IMachineBlockUpdateable, - IGregtechWailaProvider { + IGregtechWailaProvider, + IGetGUITextureSet { /** * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself. * <p/> @@ -193,13 +198,28 @@ public interface IMetaTileEntity /** * @return the Server Side Container + * @deprecated Use ModularUI */ - Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity); + @Deprecated + default Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + throw new UnsupportedOperationException(); + } /** * @return the Client Side GUI Container + * @deprecated Use ModularUI + */ + @Deprecated + default Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + throw new UnsupportedOperationException(); + } + + /** + * For back compatibility, you need to override this if this MetaTileEntity uses ModularUI. */ - Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity); + default boolean useModularUI() { + return false; + } /** * From new ISidedInventory @@ -406,6 +426,17 @@ public interface IMetaTileEntity void onColorChangeClient(byte aColor); + /** + * @return Actual color shown on GUI + */ + default int getGUIColorization() { + if (getBaseMetaTileEntity() != null) { + return getBaseMetaTileEntity().getGUIColorization(); + } else { + return GT_Util.getRGBInt(Dyes.MACHINE_METAL.getRGBA()); + } + } + int getLightOpacity(); boolean allowGeneralRedstoneOutput(); @@ -461,4 +492,31 @@ public interface IMetaTileEntity default void onRandomDisplayTick(IGregTechTileEntity aBaseMetaTileEntity) { /* do nothing */ } + + default int getGUIWidth() { + return 176; + } + + default int getGUIHeight() { + return 166; + } + + /* + * ModularUI Support + */ + default ItemStackHandler getInventoryHandler() { + return null; + } + + default String getLocalName() { + return "Unknown"; + } + + default boolean doesBindPlayerInventory() { + return true; + } + + default int getTextColorOrDefault(String textType, int defaultColor) { + return defaultColor; + } } |