From 3c45b88fecb0a429f8d777d9ffe486ff6104a893 Mon Sep 17 00:00:00 2001 From: Léa Gris Date: Thu, 6 May 2021 15:07:22 +0200 Subject: feat(render): active replicator front glow --- src/main/java/gregtech/api/enums/Textures.java | 1 + .../basic/GT_MetaTileEntity_Replicator.java | 30 +++++++++++++++++++-- .../iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png | Bin 584 -> 309 bytes .../OVERLAY_FRONT_REPLICATOR_ACTIVE.png.mcmeta | 5 ---- .../OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png | Bin 0 -> 526 bytes ...OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png.mcmeta | 6 +++++ 6 files changed, 35 insertions(+), 7 deletions(-) delete mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png.mcmeta (limited to 'src/main') diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index 5b97831df3..e69f191249 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -548,6 +548,7 @@ public class Textures { OVERLAY_FRONT_POTIONBREWER_ACTIVE, OVERLAY_FRONT_REPLICATOR_ACTIVE, + OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW, OVERLAY_FRONT_MASSFAB_ACTIVE, OVERLAY_FRONT_STEAM_HAMMER_ACTIVE, OVERLAY_FRONT_STEAM_FURNACE_ACTIVE, diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java index 3df33fc6c4..b478579581 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -6,6 +6,8 @@ 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_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -17,6 +19,16 @@ import net.minecraftforge.fluids.FluidStack; import java.util.HashMap; import java.util.NoSuchElementException; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_REPLICATOR; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE; + public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine { private static int sHeaviestElementMass = 0; @@ -32,7 +44,17 @@ public class GT_MetaTileEntity_Replicator } public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR)); + super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", + new GT_RenderedTexture(OVERLAY_SIDE_REPLICATOR_ACTIVE), + new GT_RenderedTexture(OVERLAY_SIDE_REPLICATOR), + new GT_MultiTexture( + new GT_RenderedTexture(OVERLAY_FRONT_REPLICATOR_ACTIVE), + new GT_RenderedGlowTexture(OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW)), + new GT_RenderedTexture(OVERLAY_FRONT_REPLICATOR), + new GT_RenderedTexture(OVERLAY_TOP_REPLICATOR_ACTIVE), + new GT_RenderedTexture(OVERLAY_TOP_REPLICATOR), + new GT_RenderedTexture(OVERLAY_BOTTOM_REPLICATOR_ACTIVE), + new GT_RenderedTexture(OVERLAY_BOTTOM_REPLICATOR)); } public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -43,6 +65,7 @@ public class GT_MetaTileEntity_Replicator super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @@ -53,6 +76,7 @@ public class GT_MetaTileEntity_Replicator return (long) Math.pow(amount, EXPONENT); } + @Override public int checkRecipe() { FluidStack tFluid = getFillableStack(); if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) { @@ -63,7 +87,7 @@ public class GT_MetaTileEntity_Replicator if ((tFluid.amount >= tMass) && (tMass > 0L)) { this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.V[this.mTier],1); - this.mMaxProgresstime = GT_Utility.safeInt(tMass * 1024L / (1 << this.mTier),1); + this.mMaxProgresstime = GT_Utility.safeInt(tMass * 1024L / (1L << this.mTier),1); if (mMaxProgresstime == Integer.MAX_VALUE - 1 || mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -106,10 +130,12 @@ public class GT_MetaTileEntity_Replicator return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && ItemList.Cell_Empty.isStackEqual(aStack); } + @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return aFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)); } + @Override public int getCapacity() { if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) { sHeaviestElementMass = Materials.getMaterialsMap().values().stream().mapToInt(material -> (int) cubicFluidMultiplier((int)material.getMass())).max().orElseThrow(NoSuchElementException::new); diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png index 32f1bf2713..c259006a11 100644 Binary files a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png.mcmeta deleted file mode 100644 index 24f9c2fae3..0000000000 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "animation": { - "frametime": 1 - } -} diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png new file mode 100644 index 0000000000..c67b898167 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png.mcmeta new file mode 100644 index 0000000000..26bb55e207 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "frametime": 1 + } +} + -- cgit