aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2021-05-06 17:24:58 +0200
committerLéa Gris <lea.gris@noiraude.net>2021-05-21 13:38:34 +0200
commit46dc12b91a836235a7b673e7fae7bec485ee4555 (patch)
tree963f90bcc13d3c9270d408a78dbd2d5cd0919ce0 /src
parentf3ed9e448ffe260a22a61abca69eb65dd67c42d1 (diff)
downloadGT5-Unofficial-46dc12b91a836235a7b673e7fae7bec485ee4555.tar.gz
GT5-Unofficial-46dc12b91a836235a7b673e7fae7bec485ee4555.tar.bz2
GT5-Unofficial-46dc12b91a836235a7b673e7fae7bec485ee4555.zip
feat(render): ore drilling plant glow
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java33
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL.pngbin439 -> 382 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE.pngbin457 -> 389 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW.pngbin0 -> 379 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_GLOW.pngbin0 -> 378 bytes
6 files changed, 27 insertions, 8 deletions
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index 5b91e95168..3dada35dc6 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -929,7 +929,9 @@ public class Textures {
OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE,
OVERLAY_FRONT_ASSEMBLY_LINE,
OVERLAY_FRONT_ORE_DRILL_ACTIVE,
+ OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW,
OVERLAY_FRONT_ORE_DRILL,
+ OVERLAY_FRONT_ORE_DRILL_GLOW,
OVERLAY_TOP_CLEANROOM_ACTIVE,
OVERLAY_TOP_CLEANROOM,
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
index fdb61e1945..dbc8d96fc1 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
@@ -3,7 +3,6 @@ package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IChunkLoader;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -13,6 +12,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataA
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_ChunkManager;
+import gregtech.api.objects.GT_RenderedGlowTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
@@ -29,6 +29,11 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.ArrayList;
import static gregtech.api.enums.GT_Values.W;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId;
public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_MultiBlockBase implements IChunkLoader {
private static final ItemStack miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0);
@@ -73,10 +78,19 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
workState = STATE_DOWNWARD;
}
+ @Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing)
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(casingTextureIndex),new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ORE_DRILL)};
- return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(casingTextureIndex)};
+ if (aSide == aFacing) {
+ if (aActive) return new ITexture[]{
+ getCasingTextureForId(casingTextureIndex),
+ new GT_RenderedTexture(OVERLAY_FRONT_ORE_DRILL_ACTIVE),
+ new GT_RenderedGlowTexture(OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW)};
+ return new ITexture[]{
+ getCasingTextureForId(casingTextureIndex),
+ new GT_RenderedTexture(OVERLAY_FRONT_ORE_DRILL),
+ new GT_RenderedGlowTexture(OVERLAY_FRONT_ORE_DRILL_GLOW)};
+ }
+ return new ITexture[]{getCasingTextureForId(casingTextureIndex)};
}
@Override
@@ -146,7 +160,9 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
/**
* Added for compability reasons
* @return true if the state is 0 false otherwise.
+ * @deprecated compatibility reason
*/
+ @Deprecated
protected boolean tryLowerPipe() {
return tryLowerPipeState(false) == 0;
}
@@ -199,7 +215,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
if (pipes.stackSize == maxPipes) break;
int needPipes = maxPipes - pipes.stackSize;
- int transferPipes = storedItem.stackSize < needPipes ? storedItem.stackSize : needPipes;
+ int transferPipes = Math.min(storedItem.stackSize, needPipes);
pipes.stackSize += transferPipes;
storedItem.stackSize -= transferPipes;
@@ -238,9 +254,10 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
}
/**
- * Readded for compability
+ * @deprecated Readded for compability
* @return if no pipes are present
*/
+ @Deprecated
protected boolean waitForPipes(){
return !isHasMiningPipes();
}
@@ -425,7 +442,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
return config;
}
- public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>();
+ public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<>();
/**
* @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb
@@ -441,7 +458,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
* @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb
*/
public ArrayList<ItemStack> getDataItems(int state) {
- ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ ArrayList<ItemStack> rList = new ArrayList<>();
if (GT_Utility.isStackValid(mInventory[1]) && isCorrectDataItem(mInventory[1], state)) {
rList.add(mInventory[1]);
}
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL.png
index bc1dd3f5f0..da0ce84a35 100644
--- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL.png
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE.png
index b57178136f..89277c79d6 100644
--- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE.png
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW.png
new file mode 100644
index 0000000000..4a8ad42dd8
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_GLOW.png
new file mode 100644
index 0000000000..1227d5a7fd
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ORE_DRILL_GLOW.png
Binary files differ