aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2021-05-07 03:10:12 +0200
committerLéa Gris <lea.gris@noiraude.net>2021-05-21 13:38:36 +0200
commitb57f975dc9820c6400b725fb3f32c84d1463850e (patch)
tree4a9c8c4afc77f1af66e8c439ae6c8a617a4500dd /src/main/java/gregtech/common/tileentities/machines
parent21439b6eb0f73e722309d4ab7994848a8fb06471 (diff)
downloadGT5-Unofficial-b57f975dc9820c6400b725fb3f32c84d1463850e.tar.gz
GT5-Unofficial-b57f975dc9820c6400b725fb3f32c84d1463850e.tar.bz2
GT5-Unofficial-b57f975dc9820c6400b725fb3f32c84d1463850e.zip
feat(render): distillation tower glow
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java65
1 files changed, 40 insertions, 25 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
index 0fbac9aaf0..a47bd5227b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
@@ -2,12 +2,14 @@ package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
@@ -22,6 +24,11 @@ import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_GLOW;
+
public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_MultiBlockBase {
private static final int CASING_INDEX = 49;
private short controllerY;
@@ -39,31 +46,39 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Multi
}
public String[] getDescription() {
- final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Distillery")
- .addInfo("Controller block for the Distillation Tower")
- .addInfo("Fluids are only put out at the correct height")
- .addInfo("The correct height equals the slot number in the NEI recipe")
- .addSeparator()
- .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true)
- .addController("Front bottom")
- .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)")
- .addEnergyHatch("Any casing")
- .addMaintenanceHatch("Any casing")
- .addInputHatch("Any bottom layer casing")
- .addOutputBus("Any bottom layer casing")
- .addOutputHatch("2-11x Output Hatches (One per layer except bottom layer)")
- .toolTipFinisher("Gregtech");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return tt.getInformation();
- } else {
- return tt.getStructureInformation();
- }
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Distillery")
+ .addInfo("Controller block for the Distillation Tower")
+ .addInfo("Fluids are only put out at the correct height")
+ .addInfo("The correct height equals the slot number in the NEI recipe")
+ .addSeparator()
+ .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true)
+ .addController("Front bottom")
+ .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)")
+ .addEnergyHatch("Any casing")
+ .addMaintenanceHatch("Any casing")
+ .addInputHatch("Any bottom layer casing")
+ .addOutputBus("Any bottom layer casing")
+ .addOutputHatch("2-11x Output Hatches (One per layer except bottom layer)")
+ .toolTipFinisher("Gregtech");
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ return tt.getStructureInformation();
+ } else {
+ return tt.getInformation();
+ }
}
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)};
+ if (aActive)
+ return new ITexture[]{
+ BlockIcons.getCasingTextureForId(CASING_INDEX),
+ new GT_RenderedTexture(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE),
+ new GT_RenderedGlowTexture(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW)};
+ return new ITexture[]{
+ BlockIcons.getCasingTextureForId(CASING_INDEX),
+ new GT_RenderedTexture(OVERLAY_FRONT_DISTILLATION_TOWER),
+ new GT_RenderedGlowTexture(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW)};
}
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)};
}
@@ -89,8 +104,8 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Multi
ArrayList<FluidStack> tFluidList = getStoredFluids();
for (int i = 0; i < tFluidList.size() - 1; i++) {
for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
- if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
+ if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
tFluidList.remove(j--);
} else {
tFluidList.remove(i--);
@@ -102,12 +117,12 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Multi
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage));
- FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
+ FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]);
if (tFluids.length > 0) {
for (FluidStack tFluid : tFluids) {
GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluid});
if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) {
+ if (tRecipe.isRecipeInputEqual(true, tFluids)) {
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage);