From e1e7c6d1e708fe24767a0a278ffc1324e77e809f Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Wed, 13 Oct 2021 13:36:22 +0800 Subject: add indicator on hatches --- src/main/java/gregtech/GT_Mod.java | 1 + src/main/java/gregtech/api/enums/Textures.java | 4 ++++ .../implementations/GT_MetaTileEntity_Hatch_Input.java | 10 ++++++++-- .../GT_MetaTileEntity_Hatch_InputBus.java | 10 +++++++--- .../implementations/GT_MetaTileEntity_Hatch_Output.java | 10 ++++++++-- .../GT_MetaTileEntity_Hatch_OutputBus.java | 10 ++++++++-- src/main/java/gregtech/common/GT_Proxy.java | 5 +++++ .../gregtech/textures/blocks/iconsets/FLUID_IN_SIGN.png | Bin 0 -> 1692 bytes .../gregtech/textures/blocks/iconsets/FLUID_OUT_SIGN.png | Bin 0 -> 1699 bytes .../gregtech/textures/blocks/iconsets/ITEM_IN_SIGN.png | Bin 0 -> 1700 bytes .../gregtech/textures/blocks/iconsets/ITEM_OUT_SIGN.png | Bin 0 -> 1696 bytes 11 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/FLUID_IN_SIGN.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/FLUID_OUT_SIGN.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/ITEM_IN_SIGN.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/ITEM_OUT_SIGN.png diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 5266eb246c..777cea09e5 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -337,6 +337,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mRenderTileAmbientOcclusion = GregTech_API.sClientDataFile.get("render", "TileAmbientOcclusion", true); gregtechproxy.mRenderGlowTextures = GregTech_API.sClientDataFile.get("render", "GlowTextures", true); gregtechproxy.mRenderFlippedMachinesFlipped = GregTech_API.sClientDataFile.get("render", "RenderFlippedMachinesFlipped", true); + gregtechproxy.mRenderIndicatorsOnHatch = GregTech_API.sClientDataFile.get("render", "RenderIndicatorsOnHatch", true); gregtechproxy.mMaxEqualEntitiesAtOneSpot = tMainConfig.get(aTextGeneral, "MaxEqualEntitiesAtOneSpot", 3).getInt(3); gregtechproxy.mSkeletonsShootGTArrows = tMainConfig.get(aTextGeneral, "SkeletonsShootGTArrows", 16).getInt(16); diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index c4c18b8725..6baa3c260e 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -468,6 +468,10 @@ public class Textures { OVERLAY_PIPE, OVERLAY_PIPE_IN, OVERLAY_PIPE_OUT, + FLUID_OUT_SIGN, + FLUID_IN_SIGN, + ITEM_IN_SIGN, + ITEM_OUT_SIGN, OVERLAY_MUFFLER, OVERLAY_CONTROLLER, diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java index fd7eb0fc94..a0fc7abcc7 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -10,6 +11,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import static gregtech.api.enums.Textures.BlockIcons.FLUID_IN_SIGN; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN; public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { @@ -31,12 +33,16 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; + return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ? + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN)} : + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; + return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ? + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN)} : + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java index 5a0a2b680f..96667ddb8c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java @@ -18,7 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN; +import static gregtech.api.enums.Textures.BlockIcons.*; public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch { public GT_Recipe_Map mRecipeMap = null; @@ -53,12 +53,16 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; + return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ? + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN)} : + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; + return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ? + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN)} : + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java index eb75094a02..0919961af0 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -17,6 +18,7 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; +import static gregtech.api.enums.Textures.BlockIcons.FLUID_OUT_SIGN; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT; public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch { @@ -43,12 +45,16 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; + return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ? + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN)} : + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; + return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ? + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN)} : + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java index f997f5f489..60832dd4d9 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.gui.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -12,6 +13,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import static gregtech.api.enums.Textures.BlockIcons.ITEM_OUT_SIGN; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT; import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; @@ -50,12 +52,16 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; + return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ? + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN)} : + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; + return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch ? + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN)} : + new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; } @Override diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 282542c152..ae95184062 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -230,6 +230,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { */ public boolean mRenderFlippedMachinesFlipped = true; + /** + * This enables indicators on input/output hatches + */ + public boolean mRenderIndicatorsOnHatch = true; + public static final int GUI_ID_COVER_SIDE_BASE = 10; // Takes GUI ID 10 - 15 public static Map oreDictBurnTimes = new HashMap<>(); diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/FLUID_IN_SIGN.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/FLUID_IN_SIGN.png new file mode 100644 index 0000000000..a78a13db69 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/FLUID_IN_SIGN.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/FLUID_OUT_SIGN.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/FLUID_OUT_SIGN.png new file mode 100644 index 0000000000..60aa2fe90a Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/FLUID_OUT_SIGN.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/ITEM_IN_SIGN.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/ITEM_IN_SIGN.png new file mode 100644 index 0000000000..10dd12f753 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/ITEM_IN_SIGN.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/ITEM_OUT_SIGN.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/ITEM_OUT_SIGN.png new file mode 100644 index 0000000000..831650cb28 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/ITEM_OUT_SIGN.png differ -- cgit