diff options
author | Léa Gris <lea.gris@noiraude.net> | 2021-05-06 21:28:33 +0200 |
---|---|---|
committer | Léa Gris <lea.gris@noiraude.net> | 2021-05-21 13:38:34 +0200 |
commit | 72d7196f037036ea22d64d9a6aab9e836a40efd6 (patch) | |
tree | 5c3b4dba75920bb6f3c6d5bda3df050f57403e03 | |
parent | dd104f8e599429ee3c99d35249d905efa0965291 (diff) | |
download | GT5-Unofficial-72d7196f037036ea22d64d9a6aab9e836a40efd6.tar.gz GT5-Unofficial-72d7196f037036ea22d64d9a6aab9e836a40efd6.tar.bz2 GT5-Unofficial-72d7196f037036ea22d64d9a6aab9e836a40efd6.zip |
feat(render): active mass-fabricator glow
3 files changed, 34 insertions, 5 deletions
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index 536371a010..203cc32043 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -552,6 +552,7 @@ public class Textures { OVERLAY_FRONT_REPLICATOR_ACTIVE, OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW, OVERLAY_FRONT_MASSFAB_ACTIVE, + OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW, OVERLAY_FRONT_STEAM_HAMMER_ACTIVE, OVERLAY_FRONT_STEAM_FURNACE_ACTIVE, OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW, diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java index 745033f4a3..3cd6d913f1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -1,16 +1,29 @@ package gregtech.common.tileentities.machines.basic; -import gregtech.api.enums.*; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_MultiTexture; +import gregtech.api.objects.GT_RenderedGlowTexture; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Recipe; import net.minecraftforge.fluids.FluidStack; import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MASSFAB; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_MASSFAB; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_MASSFAB; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE; public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMachine { public static int sUUAperUUM = 1; @@ -19,7 +32,17 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac public static boolean sRequiresUUA = false; public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)); + super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", + new GT_RenderedTexture(OVERLAY_SIDE_MASSFAB_ACTIVE), + new GT_RenderedTexture(OVERLAY_SIDE_MASSFAB), + new GT_MultiTexture( + new GT_RenderedTexture(OVERLAY_FRONT_MASSFAB_ACTIVE), + new GT_RenderedGlowTexture(OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW)), + new GT_RenderedTexture(OVERLAY_FRONT_MASSFAB), + new GT_RenderedTexture(OVERLAY_TOP_MASSFAB_ACTIVE), + new GT_RenderedTexture(OVERLAY_TOP_MASSFAB), + new GT_RenderedTexture(OVERLAY_BOTTOM_MASSFAB_ACTIVE), + new GT_RenderedTexture(OVERLAY_BOTTOM_MASSFAB)); } public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -30,10 +53,12 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } + @Override public void onConfigLoad(GT_Config aConfig) { super.onConfigLoad(aConfig); sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); @@ -53,6 +78,7 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac return V[mTier] * 512L; } + @Override public int checkRecipe() { FluidStack tFluid = getDrainableStack(); if ((tFluid == null) || (tFluid.amount < getCapacity())) { @@ -84,14 +110,14 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac mEUt=Integer.MAX_VALUE-1; mMaxProgresstime=Integer.MAX_VALUE-1; }else{ - mEUt= (int)(GT_Values.V[1]<<2);//2^2=4 so shift <<2 + mEUt= (int)(V[1]<<2);//2^2=4 so shift <<2 mMaxProgresstime=(int)xMaxProgresstime; } }else{ //Long EUt calculation - long xEUt=GT_Values.V[1] * (long)Math.pow(2,mTier+2); + long xEUt= V[1] * (long)Math.pow(2,mTier+2); - long tempEUt = GT_Values.V[1]; + long tempEUt = V[1]; mMaxProgresstime = sDurationMultiplier; @@ -114,10 +140,12 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac } } + @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)); } + @Override public int getCapacity() { return Math.max(sUUAperUUM, 1000); } diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW.png Binary files differnew file mode 100644 index 0000000000..5b73fbc96a --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW.png |