aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2021-05-07 11:51:27 +0200
committerLéa Gris <lea.gris@noiraude.net>2021-05-21 13:38:37 +0200
commit273712c4ca64940d398f8a1de18440dd647d23d7 (patch)
tree831dec86462a5e8632db78660bf06d4c31cdfdcc
parentcbb32e9e40395bd7e5d25a5cf8d06997a2f69803 (diff)
downloadGT5-Unofficial-273712c4ca64940d398f8a1de18440dd647d23d7.tar.gz
GT5-Unofficial-273712c4ca64940d398f8a1de18440dd647d23d7.tar.bz2
GT5-Unofficial-273712c4ca64940d398f8a1de18440dd647d23d7.zip
feat(render): active boxinator front glow
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java47
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW.pngbin0 -> 277 bytes
3 files changed, 36 insertions, 12 deletions
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index be6fa3124a..cfa7b8b491 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -573,6 +573,7 @@ public class Textures {
OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE,
OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE,
OVERLAY_FRONT_BOXINATOR_ACTIVE,
+ OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW,
OVERLAY_FRONT_ROCK_BREAKER_ACTIVE,
OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW,
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
index aabce730d0..2f7443424a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
@@ -1,24 +1,44 @@
package gregtech.common.tileentities.machines.basic;
import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Textures;
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_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_BOXINATOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE;
+
public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine {
ItemStack aInputCache;
ItemStack aOutputCache;
int aTypeCache = 0;
public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR));
+ super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "",
+ new GT_RenderedTexture(OVERLAY_SIDE_BOXINATOR_ACTIVE),
+ new GT_RenderedTexture(OVERLAY_SIDE_BOXINATOR),
+ new GT_MultiTexture(
+ new GT_RenderedTexture(OVERLAY_FRONT_BOXINATOR_ACTIVE),
+ new GT_RenderedGlowTexture(OVERLAY_FRONT_BOXINATOR_ACTIVE)),
+ new GT_RenderedTexture(OVERLAY_FRONT_BOXINATOR),
+ new GT_RenderedTexture(OVERLAY_TOP_BOXINATOR_ACTIVE),
+ new GT_RenderedTexture(OVERLAY_TOP_BOXINATOR),
+ new GT_RenderedTexture(OVERLAY_BOTTOM_BOXINATOR_ACTIVE),
+ new GT_RenderedTexture(OVERLAY_BOTTOM_BOXINATOR));
}
public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
@@ -29,10 +49,12 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName);
}
+ @Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_Boxinator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName);
}
+ @Override
public GT_Recipe.GT_Recipe_Map getRecipeList() {
return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes;
}
@@ -59,6 +81,7 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
aInputCache = mInputItem.copy();
}
+ @Override
public int checkRecipe() {
int tCheck = super.checkRecipe();
if (tCheck != DID_NOT_FIND_RECIPE) {
@@ -69,9 +92,9 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
if ((GT_Utility.isStackValid(tSlot0)) && (GT_Utility.isStackValid(tSlot1)) && (GT_Utility.getContainerItem(tSlot0, true) == null)) {
if ((ItemList.Schematic_1by1.isStackEqual(tSlot1)) && (tSlot0.stackSize >= 1)) {
boolean tIsCached = hasValidCache(tSlot0,1,true);
- this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0});
+ this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0);
if (this.mOutputItems[0] != null) {
- if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ if (canOutput(this.mOutputItems[0])) {
tSlot0.stackSize -= 1;
calculateOverclockedNess(32,16);
//In case recipe is too OP for that machine
@@ -86,9 +109,9 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
}
if ((ItemList.Schematic_2by2.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 4)) {
boolean tIsCached = hasValidCache(tSlot0,2,true);
- this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, null, tSlot0, tSlot0});
+ this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, null, tSlot0, tSlot0);
if (this.mOutputItems[0] != null) {
- if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ if (canOutput(this.mOutputItems[0])) {
getInputAt(0).stackSize -= 4;
calculateOverclockedNess(32,32);
//In case recipe is too OP for that machine
@@ -103,9 +126,9 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
}
if ((ItemList.Schematic_3by3.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 9)) {
boolean tIsCached = hasValidCache(tSlot0,3,true);
- this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0});
+ this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0);
if (this.mOutputItems[0] != null) {
- if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ if (canOutput(this.mOutputItems[0])) {
getInputAt(0).stackSize -= 9;
calculateOverclockedNess(32,64);
//In case recipe is too OP for that machine
@@ -131,15 +154,15 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) || (ItemList.Schematic_3by3.isStackEqual(tInput1))) {
if (hasValidCache(aStack,aTypeCache,false))
return true;
- if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, new ItemStack[]{GT_Utility.copyAmount(64L, new Object[]{aStack}), tInput1}) != null) {
+ if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, GT_Utility.copyAmount(64L, aStack), tInput1) != null) {
return true;
}
- if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack}) != null)
+ if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(aStack) != null)
return true;
- if (ItemList.Schematic_2by2.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack, aStack, null, aStack, aStack}) != null) {
+ if (ItemList.Schematic_2by2.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(aStack, aStack, null, aStack, aStack) != null) {
return true;
}
- return ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) && (GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack}) != null);
+ return ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) && (GT_ModHandler.getRecipeOutput(aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack) != null);
} else {
return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack);
}
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW.png
new file mode 100644
index 0000000000..c068177a95
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW.png
Binary files differ