diff options
author | Léa Gris <lea.gris@noiraude.net> | 2021-05-06 14:44:36 +0200 |
---|---|---|
committer | Léa Gris <lea.gris@noiraude.net> | 2021-05-21 13:38:33 +0200 |
commit | bc60f1ccba587198aaf0e316cc5b1d4ff301aa3d (patch) | |
tree | 5b28eae2a1c88893c2c01216c8f0c70d75c51f80 | |
parent | 7c1425f9ce38a6eb9e1063a37e8abc374dc53a63 (diff) | |
download | GT5-Unofficial-bc60f1ccba587198aaf0e316cc5b1d4ff301aa3d.tar.gz GT5-Unofficial-bc60f1ccba587198aaf0e316cc5b1d4ff301aa3d.tar.bz2 GT5-Unofficial-bc60f1ccba587198aaf0e316cc5b1d4ff301aa3d.zip |
feat(render): active rockbreacker front glow
Used by:
- Advanced Seismic Prospector
- Rock Breaker
- Seismic Prospector
- Charcoal Pit
9 files changed, 216 insertions, 129 deletions
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index b0d02c60b2..5b97831df3 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -562,6 +562,7 @@ public class Textures { OVERLAY_FRONT_BOXINATOR_ACTIVE, OVERLAY_FRONT_ROCK_BREAKER_ACTIVE, + OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW, OVERLAY_FRONT_SCANNER_ACTIVE, OVERLAY_FRONT_SCANNER_ACTIVE_GLOW, OVERLAY_BOTTOM_POTIONBREWER_ACTIVE, diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 2fb5066786..b9e5e0ed4e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -3,11 +3,12 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -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.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; @@ -25,8 +26,20 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fluids.FluidStack; -import java.util.*; - +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE; import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; @@ -44,18 +57,21 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba 1, // output slot count "Default.png", // GUI name "", // NEI name - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)); + new GT_RenderedTexture(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_SIDE_ROCK_BREAKER), + new GT_RenderedTexture(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_TOP_ROCK_BREAKER), + new GT_MultiTexture( + new GT_RenderedTexture(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + new GT_RenderedGlowTexture(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW)), + new GT_RenderedTexture(OVERLAY_FRONT_ROCK_BREAKER), + new GT_RenderedTexture(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_BOTTOM_ROCK_BREAKER)); radius = aRadius; step = aStep; } + @Override public String[] getDescription() { return new String[]{ "Place, activate with explosives", @@ -79,6 +95,7 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba step = aStep; } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_AdvSeismicProspector(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName, this.radius, this.step); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java index 37113e0f9a..747e93ad06 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java @@ -2,11 +2,12 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -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_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -14,9 +15,29 @@ import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE; + public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)); + super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", + new GT_RenderedTexture(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_SIDE_ROCK_BREAKER), + new GT_MultiTexture( + new GT_RenderedTexture(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + new GT_RenderedGlowTexture(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW)), + new GT_RenderedTexture(OVERLAY_FRONT_ROCK_BREAKER), + new GT_RenderedTexture(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_TOP_ROCK_BREAKER), + new GT_RenderedTexture(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_BOTTOM_ROCK_BREAKER)); } public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -27,10 +48,12 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_RockBreaker(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.sRockBreakerFakeRecipes; } @@ -40,6 +63,7 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && getRecipeList().containsInput(aStack); } + @Override public int checkRecipe() { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water)) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index ac7dd17607..bf5d225e1e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -3,11 +3,12 @@ package gregtech.common.tileentities.machines.basic; import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -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.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; @@ -27,12 +28,34 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.List; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE; + public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_BasicMachine { boolean ready = false; public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", 1, 1, "Default.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)); + super(aID, aName, aNameRegional, aTier, 1, + "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", 1, 1, + "Default.png", "", + new GT_RenderedTexture(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_SIDE_ROCK_BREAKER), + new GT_RenderedTexture(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_TOP_ROCK_BREAKER), + new GT_MultiTexture( + new GT_RenderedTexture(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + new GT_RenderedGlowTexture(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW)), + new GT_RenderedTexture(OVERLAY_FRONT_ROCK_BREAKER), + new GT_RenderedTexture(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(OVERLAY_BOTTOM_ROCK_BREAKER)); } public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -43,6 +66,7 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SeismicProspector(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 1b5ecbb90d..11e4ef6676 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -1,16 +1,12 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; @@ -22,11 +18,18 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.ChunkPosition; import net.minecraftforge.oredict.OreDictionary; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; + +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlockBase { private boolean running = false; - private boolean p1, p2, p3, p4, p5, p6; public GT_MetaTileEntity_Charcoal_Pit(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -36,41 +39,9 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock super(aName); } - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Charcoal_Pit(this.mName); - } - - public String[] getDescription() { - final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Charcoal Pile Igniter") - .addInfo("Controller for the Charcoal Pit") - .addInfo("Converts Logs into Brittle Charcoal blocks") - .addInfo("Will automatically start when valid") - .addPollutionAmount(100) - .addSeparator() - .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) - .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") - .addOtherStructurePart("Bricks", "Bottom layer, under all wood logs") - .addOtherStructurePart("Dirt/Grass", "All logs must be covered by these, the controller, or bricks") - .addOtherStructurePart("Wood Logs", "Inside the previously mentioned blocks") - .addStructureInfo("No air between logs allowed") - .toolTipFinisher("Gregtech"); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - return tt.getInformation(); - } else { - return tt.getStructureInformation(); - } - } - - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == 1) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][10], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][10]}; - } - - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return null; + @Override + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; } @Override @@ -79,33 +50,31 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock return false; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } - public boolean isFacingValid(byte aFacing) { - return aFacing > 1; - } - + @Override public boolean checkRecipe(ItemStack aStack) { if (!checkRecursiveBlocks()) { - this.mEfficiency = 0; - this.mEfficiencyIncrease = 0; - this.mMaxProgresstime = 0; + mEfficiency = 0; + mEfficiencyIncrease = 0; + mMaxProgresstime = 0; running = false; return false; } if (mEfficiency == 0) { - this.mEfficiency = 10000; - this.mEfficiencyIncrease = 10000; - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime*10); + mEfficiency = 10000; + mEfficiencyIncrease = 10000; + mMaxProgresstime = Math.max(1, mMaxProgresstime); + GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime * 10); return true; } else { - this.mEfficiency = 0; - this.mEfficiencyIncrease = 0; - this.mMaxProgresstime = 0; + mEfficiency = 0; + mEfficiencyIncrease = 0; + mMaxProgresstime = 0; } return false; } @@ -114,12 +83,10 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock ArrayList<ChunkPosition> tList1 = new ArrayList<>(); ArrayList<ChunkPosition> tList2 = new ArrayList<>(); - Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(0, -1, 0); - if (!isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(0, -1, 0))) { - return false; - } else { + Block tBlock = getBaseMetaTileEntity().getBlockOffset(0, -1, 0); + if (isWoodLog(tBlock, getBaseMetaTileEntity().getMetaIDOffset(0, -1, 0))) { tList2.add(new ChunkPosition(0, -1, 0)); - } + } else return false; while (!tList2.isEmpty()) { ChunkPosition tPos = tList2.get(0); tList2.remove(0); @@ -129,91 +96,93 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } if (running) { for (ChunkPosition tPos : tList1) { - if (isWoodLog(this.getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), this.getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) - this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, this.getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, this.getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3); + if (isWoodLog(getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3); } running = false; return false; } else { - this.mMaxProgresstime = (int) Math.sqrt(tList1.size() * 240000); + mMaxProgresstime = (int) Math.sqrt(tList1.size() * 240000); } running = true; return true; } - private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1, ArrayList<ChunkPosition> aList2) { - p1 = false; - p2 = false; - p3 = false; - p4 = false; - p5 = false; - p6 = false; - Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ); - if (aX + 1 < 6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX + 1, aY, aZ)))) { + private boolean isWoodLog(Block log, int meta) { + for (int id : OreDictionary.getOreIDs(new ItemStack(log, 1, meta))) { + if (OreDictionary.getOreName(id).equals("logWood")) + return true; + } + String tTool = log.getHarvestTool(meta); + return OrePrefixes.log.contains(new ItemStack(log, 1, meta)) && ("axe".equals(tTool)) && (log.getMaterial() == Material.wood); + } + + private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<? super ChunkPosition> aList1, ArrayList<? super ChunkPosition> aList2) { + boolean expandToChunkXPos = false; + boolean expandToChunkXNeg = false; + boolean expandToChunkYPos = false; + boolean expandToChunkYNeg = false; + boolean expandToChunkZPos = false; + boolean expandToChunkZNeg = false; + + Block blockXPos = getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ); + if (aX + 1 < 6 && (isWoodLog(blockXPos, getBaseMetaTileEntity().getMetaIDOffset(aX + 1, aY, aZ)))) { if (!aList1.contains(new ChunkPosition(aX + 1, aY, aZ)) && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) - p1 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) { + expandToChunkXPos = true; + } else if (!(blockXPos == Blocks.dirt || blockXPos == Blocks.grass)) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ); - if (aX - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX - 1, aY, aZ)))) { + Block blockXNeg = getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ); + if (aX - 1 > -6 && (isWoodLog(blockXNeg, getBaseMetaTileEntity().getMetaIDOffset(aX - 1, aY, aZ)))) { if (!aList1.contains(new ChunkPosition(aX - 1, aY, aZ)) && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) - p2 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) { + expandToChunkXNeg = true; + } else if (!(blockXNeg == Blocks.dirt || blockXNeg == Blocks.grass)) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ); - if (aY + 1 < 1 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY + 1, aZ)))) { + Block blockYPos = getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ); + if (aY + 1 < 1 && (isWoodLog(blockYPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY + 1, aZ)))) { if (!aList1.contains(new ChunkPosition(aX, aY + 1, aZ)) && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ)))) - p3 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass || (aX == 0 && aY == -1 && aZ == 0 && tBlock == GregTech_API.sBlockMachines))) { + expandToChunkYPos = true; + } else if (!(blockYPos == Blocks.dirt || blockYPos == Blocks.grass || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ); - if (aY - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY - 1, aZ)))) { + Block blockYNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ); + if (aY - 1 > -6 && (isWoodLog(blockYNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY - 1, aZ)))) { if (!aList1.contains(new ChunkPosition(aX, aY - 1, aZ)) && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) - p4 = true; - } else if (tBlock != Blocks.brick_block) { + expandToChunkYNeg = true; + } else if (blockYNeg != Blocks.brick_block) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1); - if (aZ + 1 < 6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ + 1)))) { + Block blockZPos = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1); + if (aZ + 1 < 6 && (isWoodLog(blockZPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ + 1)))) { if (!aList1.contains(new ChunkPosition(aX, aY, aZ + 1)) && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) - p5 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) { + expandToChunkZPos = true; + } else if (!(blockZPos == Blocks.dirt || blockZPos == Blocks.grass)) { return false; } - tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1); - if (aZ - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ - 1)))) { + Block blockZNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1); + if (aZ - 1 > -6 && (isWoodLog(blockZNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ - 1)))) { if (!aList1.contains(new ChunkPosition(aX, aY, aZ - 1)) && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) - p6 = true; - } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) { + expandToChunkZNeg = true; + } else if (!(blockZNeg == Blocks.dirt || blockZNeg == Blocks.grass)) { return false; } aList1.add(new ChunkPosition(aX, aY, aZ)); - if (p1) aList2.add(new ChunkPosition(aX + 1, aY, aZ)); - if (p2) aList2.add(new ChunkPosition(aX - 1, aY, aZ)); - if (p3) aList2.add(new ChunkPosition(aX, aY + 1, aZ)); - if (p4) aList2.add(new ChunkPosition(aX, aY - 1, aZ)); - if (p5) aList2.add(new ChunkPosition(aX, aY, aZ + 1)); - if (p6) aList2.add(new ChunkPosition(aX, aY, aZ - 1)); + if (expandToChunkXPos) aList2.add(new ChunkPosition(aX + 1, aY, aZ)); + if (expandToChunkXNeg) aList2.add(new ChunkPosition(aX - 1, aY, aZ)); + if (expandToChunkYPos) aList2.add(new ChunkPosition(aX, aY + 1, aZ)); + if (expandToChunkYNeg) aList2.add(new ChunkPosition(aX, aY - 1, aZ)); + if (expandToChunkZPos) aList2.add(new ChunkPosition(aX, aY, aZ + 1)); + if (expandToChunkZNeg) aList2.add(new ChunkPosition(aX, aY, aZ - 1)); return true; } - private boolean isWoodLog(Block log, int meta){ - for (int id : OreDictionary.getOreIDs(new ItemStack(log, 1, meta))) { - if(OreDictionary.getOreName(id).equals("logWood")) - return true; - } - String tTool = log.getHarvestTool(meta); - return OrePrefixes.log.contains(new ItemStack(log, 1,meta)) && ((tTool != null) && (tTool.equals("axe"))) && (log.getMaterial() == Material.wood); - } - + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mWrench = true; mScrewdriver = true; @@ -224,19 +193,70 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock return true; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Charcoal_Pit(mName); + } + + @Override + public String[] getDescription() { + final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType("Charcoal Pile Igniter") + .addInfo("Controller for the Charcoal Pit") + .addInfo("Converts Logs into Brittle Charcoal blocks") + .addInfo("Will automatically start when valid") + .addPollutionAmount(100) + .addSeparator() + .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) + .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") + .addOtherStructurePart("Bricks", "Bottom layer, under all wood logs") + .addOtherStructurePart("Dirt/Grass", "All logs must be covered by these, the controller, or bricks") + .addOtherStructurePart("Wood Logs", "Inside the previously mentioned blocks") + .addStructureInfo("No air between logs allowed") + .toolTipFinisher("Gregtech"); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + return tt.getStructureInformation(); + } else { + return tt.getInformation(); + } + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == 1) { + if (aActive) return new ITexture[]{ + casingTexturePages[0][10], + new GT_RenderedTexture(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + new GT_RenderedGlowTexture(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW)}; + return new ITexture[]{ + casingTexturePages[0][10], + new GT_RenderedTexture(OVERLAY_FRONT_ROCK_BREAKER)}; + } + return new ITexture[]{casingTexturePages[0][10]}; + } } diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE.png Binary files differindex 872154d256..356895ce31 100644 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE.png +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE.png.mcmeta deleted file mode 100644 index 8e55e43baf..0000000000 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "animation": { - "frametime": 3 - } -} diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW.png Binary files differnew file mode 100644 index 0000000000..872154d256 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW.png.mcmeta new file mode 100644 index 0000000000..07dc1943ab --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "frametime": 3 + } +} + |