From e7ac28da98670e475b0b10f6a4e929330ca6596d Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 13 Feb 2022 09:55:13 +1100 Subject: Fix disstank, add textures to multis --- dependencies.gradle | 4 +- .../java/com/elisis/gtnhlanth/GTNHLanthanides.java | 1 + .../elisis/gtnhlanth/common/register/ItemList.java | 3 +- .../common/register/WerkstoffMaterialPool.java | 45 ++++++++++-- .../gtnhlanth/common/tileentity/Digester.java | 26 +++++-- .../common/tileentity/DissolutionTank.java | 81 +++++++++++++++------ .../com/elisis/gtnhlanth/loader/RecipeAdder.java | 6 +- .../com/elisis/gtnhlanth/loader/RecipeLoader.java | 15 ++++ .../textures/gui/multimachines/Digester.png | Bin 0 -> 4379 bytes .../assets/gtnhlanth/textures/gui/Digester.png | Bin 0 -> 4248 bytes .../assets/gtnhlanth/textures/gui/Disstank.png | Bin 0 -> 4782 bytes 11 files changed, 144 insertions(+), 37 deletions(-) create mode 100644 src/main/resources/assets/gregtech/textures/gui/multimachines/Digester.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/gui/Digester.png create mode 100644 src/main/resources/assets/gtnhlanth/textures/gui/Disstank.png diff --git a/dependencies.gradle b/dependencies.gradle index 5cfbdd2b04..6117db220f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -3,6 +3,7 @@ dependencies { compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.31:dev") + compile("com.github.GTNewHorizons:NewHorizonsCoreMod:1.9.20:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.14:dev") compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") @@ -15,6 +16,7 @@ dependencies { compile("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-75-GTNH:dev") compile("com.github.GTNewHorizons:bartworks:0.5.36:dev") + compile files('bartworks-1.7.10-0.5.34.dirty-dev.jar') compileOnly("com.github.GTNewHorizons:GTplusplus:1.7.27:dev") { transitive = false } @@ -29,7 +31,7 @@ dependencies { compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.28:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:BuildCraft:7.1.24:dev") { + compile("com.github.GTNewHorizons:BuildCraft:7.1.24:dev") { transitive = false } diff --git a/src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java b/src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java index b973aec26a..ac871508db 100644 --- a/src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java +++ b/src/main/java/com/elisis/gtnhlanth/GTNHLanthanides.java @@ -29,6 +29,7 @@ import gregtech.api.util.GT_Log; + "required-after:bartworks; " + "required-after:GoodGenerator; " + "before:miscutils; " + + "required-after:dreamcraft; " ) public class GTNHLanthanides { diff --git a/src/main/java/com/elisis/gtnhlanth/common/register/ItemList.java b/src/main/java/com/elisis/gtnhlanth/common/register/ItemList.java index c910a22ef3..aeea5b1236 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/register/ItemList.java +++ b/src/main/java/com/elisis/gtnhlanth/common/register/ItemList.java @@ -1,6 +1,7 @@ package com.elisis.gtnhlanth.common.register; import com.elisis.gtnhlanth.common.tileentity.Digester; +import com.elisis.gtnhlanth.common.tileentity.DissolutionTank; import net.minecraft.item.ItemStack; @@ -12,7 +13,7 @@ public final class ItemList { public static void register() { ItemList.DIGESTER = new Digester(10500, "Digester", "Digester").getStackForm(1L); - //ItemList.DISSOLUTION_TANK = new DissolutionTank(10501, "Dissolution Tank", "Dissolution Tank").getStackForm(1L); + ItemList.DISSOLUTION_TANK = new DissolutionTank(10501, "Dissolution Tank", "Dissolution Tank").getStackForm(1L); } diff --git a/src/main/java/com/elisis/gtnhlanth/common/register/WerkstoffMaterialPool.java b/src/main/java/com/elisis/gtnhlanth/common/register/WerkstoffMaterialPool.java index 39d59309b4..e653d1b52c 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/register/WerkstoffMaterialPool.java +++ b/src/main/java/com/elisis/gtnhlanth/common/register/WerkstoffMaterialPool.java @@ -506,18 +506,30 @@ public class WerkstoffMaterialPool implements Runnable { subscriptNumbers("KMnO4"), new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), + new Werkstoff.GenerationFeatures().disable().onlyDust(), offsetID + 43, + TextureSet.SET_DULL + ); + + public static final Werkstoff PotassiumPermanganateSolution = new Werkstoff( + new short[] {165, 50, 138}, + "Potassium Permanganate Solution", + subscriptNumbers("KMnO4"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + offsetID + 44, TextureSet.SET_FLUID ); + public static final Werkstoff SeaweedByproducts = new Werkstoff( new short[] {125, 50, 138}, "Seaweed Byproducts", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), - offsetID + 44, + offsetID + 45, TextureSet.SET_FLUID ); @@ -527,7 +539,7 @@ public class WerkstoffMaterialPool implements Runnable { new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), - offsetID + 45, + offsetID + 46, TextureSet.SET_FLUID ); @@ -538,7 +550,7 @@ public class WerkstoffMaterialPool implements Runnable { new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust(), - offsetID + 46, + offsetID + 47, TextureSet.SET_DULL ); @@ -549,7 +561,7 @@ public class WerkstoffMaterialPool implements Runnable { new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust(), - offsetID + 47, + offsetID + 48, TextureSet.SET_DULL ); @@ -560,7 +572,7 @@ public class WerkstoffMaterialPool implements Runnable { new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), - offsetID + 48, + offsetID + 49, TextureSet.SET_DULL ); @@ -983,6 +995,27 @@ public class WerkstoffMaterialPool implements Runnable { ); + public static final Werkstoff MagnesiumPeroxide = new Werkstoff( + new short[] {255, 255, 255}, + "Magnesium Peroxide", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + offsetID3 + 13, + TextureSet.SET_METALLIC + ); + + public static final Werkstoff PotassiumChlorate = new Werkstoff( + new short[] {255, 255, 255}, + "Potassium Chlorate", + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten(), + offsetID3 + 14, + TextureSet.SET_DULL + ); + + public static void runInit() { addSubTags(); diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/Digester.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/Digester.java index c0ffbfb795..08d3ea73db 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/Digester.java +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/Digester.java @@ -4,6 +4,11 @@ import static com.elisis.gtnhlanth.util.DescTextLocalization.BLUEPRINT_INFO; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.util.GT_StructureUtility.ofCoil; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @@ -23,6 +28,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; @@ -174,11 +180,21 @@ public class Digester extends GT_MetaTileEntity_EnhancedMultiBlockBase } @Override - public ITexture[] getTexture(IGregTechTileEntity arg0, byte arg1, byte arg2, byte arg3, boolean arg4, - boolean arg5) { - // TODO Auto-generated method stub - return null; - } + public ITexture[] getTexture(IGregTechTileEntity te, byte side, byte facing, byte colorIndex, boolean active, + boolean redstone) { + + // Oil Cracker textures cuz I'm lazy + + if (side == facing) { + if (active) return new ITexture[]{casingTexturePages[0][47], + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow().build()}; + return new ITexture[]{casingTexturePages[0][47], + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).extFacing().glow().build()}; + } + return new ITexture[]{casingTexturePages[0][47]}; + } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/DissolutionTank.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/DissolutionTank.java index 0c194570ca..f43a77f143 100644 --- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/DissolutionTank.java +++ b/src/main/java/com/elisis/gtnhlanth/common/tileentity/DissolutionTank.java @@ -2,16 +2,25 @@ package com.elisis.gtnhlanth.common.tileentity; import static com.elisis.gtnhlanth.util.DescTextLocalization.BLUEPRINT_INFO; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAdder; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import java.util.ArrayList; +import java.util.Arrays; import org.lwjgl.input.Keyboard; import com.elisis.gtnhlanth.loader.RecipeAdder; import com.elisis.gtnhlanth.util.DescTextLocalization; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; @@ -22,15 +31,17 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; +import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public class DissolutionTank extends GT_MetaTileEntity_EnhancedMultiBlockBase implements IConstructable { - @SuppressWarnings("deprecation") private IStructureDefinition multiDefinition = StructureDefinition.builder() .addShape(mName, transpose(new String[][] { {"-sss-", "sssss", "sssss", "sssss", "-sss-"}, @@ -40,15 +51,15 @@ public class DissolutionTank extends GT_MetaTileEntity_EnhancedMultiBlockBase tFluidInputs = this.getStoredFluids(); FluidStack[] tFluidInputArray = tFluidInputs.toArray(new FluidStack[0]); - ArrayList tItems = this.getStoredInputs(); + ItemStack[] tItems = this.getStoredInputs().toArray(new ItemStack[0]); long tVoltage = this.getMaxInputVoltage(); + for (GT_Recipe aRecipe : RecipeAdder.instance.DissolutionTankRecipes.mRecipeList) { + GT_Log.out.print("input: " + aRecipe.mFluidInputs[0] + "\n"); + GT_Log.out.print("output: " + aRecipe.mFluidOutputs[0] + "\n"); + } + + GT_Log.out.print("tFluidInputArray " + Arrays.toString(tFluidInputArray)); + //Collection tRecipes = RecipeAdder.instance.DigesterRecipes.mRecipeList; GT_Recipe tRecipe = RecipeAdder.instance.DissolutionTankRecipes.findRecipe( this.getBaseMetaTileEntity(), this.doTickProfilingInThisTick, tVoltage, - this.mOutputFluids, - this.mInventory + tFluidInputArray ); - - if (tRecipe == null) return false; - - if (tRecipe.isRecipeInputEqual(true, tFluidInputArray, mInventory[1])) { + GT_Log.out.print("Recipe not null\n"); + if (tRecipe.isRecipeInputEqual(true, tFluidInputArray)) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -165,6 +192,9 @@ public class DissolutionTank extends GT_MetaTileEntity_EnhancedMultiBlockBase