diff options
Diffstat (limited to 'src/main')
28 files changed, 483 insertions, 170 deletions
diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index cf039bcb8d..f01c755e0b 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -12,6 +12,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; @@ -307,17 +308,29 @@ public class Util { byte[] blockMeta,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset, IGregTechTileEntity aBaseMetaTileEntity, boolean hintsOnly) { - World world = aBaseMetaTileEntity.getWorld(); + byte facing = aBaseMetaTileEntity.getFrontFacing(); + return StructureBuilder(structure,blockType,blockMeta, + horizontalOffset,verticalOffset,depthOffset, + aBaseMetaTileEntity.getTileEntity(aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord()), + facing,hintsOnly); + } + + public static boolean StructureBuilder(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR+1 blocks + Block[] blockType,//use numbers 0-9 for casing types + byte[] blockMeta,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + TileEntity tileEntity, int facing, boolean hintsOnly) { + if(!tileEntity.hasWorldObj()) return false; + World world = tileEntity.getWorldObj(); if ((world.isRemote && !hintsOnly)||(!world.isRemote && hintsOnly)) return false; //TE Rotation - byte facing = aBaseMetaTileEntity.getFrontFacing(); int x, y, z, a, b, c, pointer; final int - baseX=aBaseMetaTileEntity.getXCoord(), - baseZ=aBaseMetaTileEntity.getZCoord(), - baseY=aBaseMetaTileEntity.getYCoord(); + baseX=tileEntity.xCoord, + baseZ=tileEntity.zCoord, + baseY=tileEntity.yCoord; //a,b,c - relative to block face! //x,y,z - relative to block position on map! @@ -393,18 +406,8 @@ public class Util { TecTech.proxy.hint_particle(world,x, y, z, blockType[pointer], blockMeta[pointer]); } else if ((pointer = block - ' ') >= 0) { switch(pointer){ - case 0: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 0); break; - case 1: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 1); break; - case 2: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 2); break; - case 3: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 3); break; - case 4: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 4); break; - case 5: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 5); break; - case 6: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 6); break; - case 7: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 7); break; - case 8: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 8); break; - case 9: TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 9); break; - case 10:TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 10); break; - case 11:TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 11); break; + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: + TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, pointer); break; default:TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 12); } } else TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 15); @@ -422,18 +425,8 @@ public class Util { world.setBlock(x, y, z, blockType[pointer], blockMeta[pointer], 2); } else if ((pointer = block - ' ') >= 0) { switch(pointer){ - case 0: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 0, 2); break; - case 1: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 1,2); break; - case 2: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 2,2); break; - case 3: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 3,2); break; - case 4: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 4,2); break; - case 5: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 5, 2); break; - case 6: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 6, 2); break; - case 7: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 7,2); break; - case 8: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 8,2); break; - case 9: world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 9,2); break; - case 10:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 10,2); break; - case 11:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 11, 2); break; + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: + world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, pointer, 2); break; default:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 12, 2); } } else world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 15,2); diff --git a/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java new file mode 100644 index 0000000000..f893b70cf6 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java @@ -0,0 +1,15 @@ +package com.github.technus.tectech.loader; + +import com.github.technus.tectech.recipe.TT_recipeAdder; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +/** + * Created by Tec on 06.08.2017. + */ +public class BloodyRecipeLoader implements Runnable { + @Override + public void run() { + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(Blocks.cobblestone),100,new ItemStack[]{new ItemStack(Blocks.stone)},null,new ItemStack(Blocks.stone_button),30,30); + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java index cfa6191a6f..3e99920c9e 100644 --- a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java @@ -1,11 +1,7 @@ package com.github.technus.tectech.loader; import com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition; -import com.github.technus.tectech.recipe.TT_recipeAdder; import cpw.mods.fml.common.Loader; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; /** * Created by danie_000 on 16.11.2016. @@ -21,11 +17,6 @@ public class RecipeLoader implements Runnable { if (Loader.isModLoaded("dreamcraft")) new DreamCraftRecipeLoader().run();//TODO init recipes for GTNH version - else runBloodRun();//TODO init recipes for NON-GTNH version - } - - private void runBloodRun(){ - //Don't init things after UV!!! They don't conform to the standards. - TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(Blocks.stone),100,new ItemStack[]{new ItemStack(Blocks.cobblestone)},null,new ItemStack(Blocks.stone),30,30); + else new BloodyRecipeLoader().run();//TODO init recipes for NON-GTNH version } } diff --git a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index f33d486662..e3b8199681 100644 --- a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -1,18 +1,22 @@ package com.github.technus.tectech.magicAddon.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; import com.github.technus.tectech.magicAddon.definitions.ePrimalAspectDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.magicAddon.EssentiaCompat.essentiaContainerCompat; @@ -24,24 +28,31 @@ import static gregtech.api.enums.GT_Values.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private TileEntity container; //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"!!!","!.!","!!!",}, + {" "," . "," ",}, {"0A0",E,"0A0",}, {"121","232","121",}, {"\"\"\"","\"2\"","\"\"\"",}, - {"202","0 0","202",}, + {"202","0!0","202",}, }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0,0,4,10}; - private static final String[] addingMethods = new String[]{"addElementalInputToMachineList", "addClassicToMachineList", "addElementalMufflerToMachineList"}; - private static final short[] casingTextures = new short[]{textureOffset + 4, textureOffset, textureOffset + 4}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalInputToMachineList", "addElementalMufflerToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{4, 0, 4}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Input Hatch", + "3 - Elemental Overflow Hatches or Elemental Casing", + "Default - Some sort of Essentia Storage", + }; //endregion public GT_MetaTileEntity_EM_essentiaDequantizer(int aID, String aName, String aNameRegional) { @@ -62,8 +73,31 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ } @Override - public void construct(int qty, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + if(hintsOnly){ + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12); + } else{ + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) + iGregTechTileEntity.getWorld().setBlock( + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12,2); + } + StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } @Override diff --git a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index 85da98508d..371a1eb13b 100644 --- a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -1,18 +1,22 @@ package com.github.technus.tectech.magicAddon.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; import com.github.technus.tectech.magicAddon.definitions.ePrimalAspectDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_MultiblockBase_EM; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.magicAddon.EssentiaCompat.essentiaContainerCompat; @@ -24,24 +28,31 @@ import static gregtech.api.enums.GT_Values.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private TileEntity container; //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"!!!","!.!","!!!",}, + {" "," . "," ",}, {"0A0",E,"0A0",}, {"121","232","121",}, {"\"\"\"","\"1\"","\"\"\"",}, - {"010","1 1","010",}, + {"010","1!1","010",}, }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0,4,0,10}; - private static final String[] addingMethods = new String[]{"addElementalOutputToMachineList", "addClassicToMachineList", "addElementalMufflerToMachineList"}; - private static final short[] casingTextures = new short[]{textureOffset + 4, textureOffset, textureOffset + 4}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalOutputToMachineList", "addElementalMufflerToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset+4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{4, 0, 4}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Output Hatch", + "3 - Elemental Overflow Hatches or Elemental Casing", + "Default - Some sort of Essentia Storage", + }; //endregion public GT_MetaTileEntity_EM_essentiaQuantizer(int aID, String aName, String aNameRegional) { @@ -62,8 +73,31 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public void construct(int qty, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + if(hintsOnly){ + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12); + } else{ + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) + iGregTechTileEntity.getWorld().setBlock( + iGregTechTileEntity.getXCoord()+xDir, + iGregTechTileEntity.getYCoord()+yDir, + iGregTechTileEntity.getZCoord()+zDir, + TT_Container_Casings.sHintCasingsTT,12,2); + } + StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } @Override diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index cfcc0057b8..c414220922 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -22,7 +22,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_GUIContainer_FusionReactor; -import gregtech.nei.GT_NEI_DefaultHandler; import gregtech.nei.NEI_GT_Config; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; @@ -206,22 +205,22 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { public void drawExtras(int aRecipeIndex) { int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + int computation = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; String[] recipeDesc = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); if (recipeDesc == null) { - if (tEUt != 0) { - drawText(10, 73, trans("152","Total: ") + tDuration * tEUt + " EU", -16777216); - drawText(10, 83, trans("153","Usage: ") + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 93, trans("154","Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); - drawText(10, 103, trans("155","Amperage: ") + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, trans("156","Voltage: unspecified"), -16777216); - drawText(10, 103, trans("157","Amperage: unspecified"), -16777216); - } - } - if (tDuration > 0) { - drawText(10, 113, "Computation: "+String.format("%.2f ", 0.05F * tDuration), -16777216); + //if (tEUt != 0) { + // drawText(10, 73, trans("152","Total: ") + computation * tEUt + " EU", -16777216); + // drawText(10, 83, trans("153","Usage: ") + tEUt + " EU/t", -16777216); + // if (this.mRecipeMap.mShowVoltageAmperageInNEI) { + // drawText(10, 93, trans("154","Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216); + // drawText(10, 103, trans("155","Amperage: ") + this.mRecipeMap.mAmperage, -16777216); + // } else { + // drawText(10, 93, trans("156","Voltage: unspecified"), -16777216); + // drawText(10, 103, trans("157","Amperage: unspecified"), -16777216); + // } + //} + if (computation > 0) { + drawText(10, 113, "Computation: "+String.format("%.2f ", 0.05F * computation), -16777216); } int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; if (tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 3fc49def16..ab1307cb3e 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -13,10 +13,12 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiNewChat; import net.minecraft.client.particle.EntityExplodeFX; import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.util.ForgeDirection; @@ -110,4 +112,12 @@ public class ClientProxy extends CommonProxy { } else fontRenderer.drawSplitString(str, x, y, maxWidth, color); } + + @Override + public void printInchat(String... strings) { + GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); + for (String s : strings) { + chat.printChatMessage(new ChatComponentText(s)); + } + } } diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index efba0f1fda..6bc3fb026e 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -40,4 +40,6 @@ public class CommonProxy implements IGuiHandler { public void broadcast(String str) { MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(str)); } + + public void printInchat(String... strings){} } diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java index c223446813..6f1196f0aa 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java @@ -1,18 +1,13 @@ package com.github.technus.tectech.recipe; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Recipe; -import gregtech.common.GT_RecipeAdder; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import java.util.Collection; import java.util.HashSet; public class TT_recipe /*extends GT_Recipe*/ { public static class TT_Recipe_Map extends GT_Recipe.GT_Recipe_Map { - public static TT_Recipe_Map sResearchableFakeRecipes =new TT_Recipe_Map(new HashSet(300), "gt.recipe.researchStation", "Research station", (String)null, "gregtech:textures/gui/basicmachines/Scanner", 1, 1, 1, 0, 1, "", 1, "", true, true); + public static TT_Recipe_Map sResearchableFakeRecipes =new TT_Recipe_Map(new HashSet(30), "gt.recipe.researchStation", "Research station", (String)null, "gregtech:textures/gui/basicmachines/Scanner", 1, 1, 1, 0, 1, "", 1, "", false, true); public TT_Recipe_Map (Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java index 688a01175b..d700514903 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java @@ -9,7 +9,7 @@ import net.minecraftforge.fluids.FluidStack; public class TT_recipeAdder extends GT_RecipeAdder { public static boolean addResearchableAssemblylineRecipe(ItemStack aResearchItem, int computationRequired, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { - if ((aResearchItem==null)||(computationRequired<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { + if ((aResearchItem==null)||(computationRequired<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15) { return false; } if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) { diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java index a536ad52af..404d5ae4f8 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java @@ -1,10 +1,15 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -13,9 +18,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import java.util.HashMap; import java.util.List; +import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; +import static gregtech.api.GregTech_API.sBlockCasings1; /** * Created by Tec on 15.03.2017. @@ -23,9 +32,10 @@ import static com.github.technus.tectech.auxiliary.Reference.MODID; public class ConstructibleTriggerItem extends Item { public static ConstructibleTriggerItem INSTANCE; + public static HashMap<Class,MultiblockInfoContainer> multiblockMap= new HashMap<>(); + private ConstructibleTriggerItem() { super(); - //setMaxStackSize(1); setUnlocalizedName("em.debugBuilder"); setTextureName(MODID + ":itemDebugBuilder"); } @@ -35,29 +45,64 @@ public class ConstructibleTriggerItem extends Item { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if(tTileEntity==null) return aPlayer instanceof EntityPlayerMP; if (aPlayer instanceof EntityPlayerMP) { + //struct gen if (aPlayer.isSneaking() && aPlayer.capabilities.isCreativeMode) { - if(tTileEntity instanceof IGregTechTileEntity) { + if (tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE != null && metaTE instanceof iConstructible) { - ((iConstructible) metaTE).construct(aStack.stackSize, false); + if (metaTE instanceof IConstructable) { + ((IConstructable) metaTE).construct(aStack.stackSize, false); return true; + } else if (multiblockMap.containsKey(metaTE.getClass())) { + multiblockMap.get(metaTE.getClass()).construct(aStack.stackSize, false, tTileEntity, ((IGregTechTileEntity) tTileEntity).getFrontFacing()); } - }else if(tTileEntity instanceof iConstructible){ - ((iConstructible) tTileEntity).construct(aStack.stackSize, false); + } else if (tTileEntity instanceof IConstructable) { + ((IConstructable) tTileEntity).construct(aStack.stackSize, false); + return true; + } else if (multiblockMap.containsKey(tTileEntity.getClass())) { + multiblockMap.get(tTileEntity.getClass()).construct(aStack.stackSize, false, tTileEntity, aSide); return true; } } } + //particles and text client side if(aWorld.isRemote){ if ((!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode)) { if(tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE != null && metaTE instanceof iConstructible) { - ((iConstructible) metaTE).construct(aStack.stackSize, true); + if (metaTE instanceof IConstructable) { + ((IConstructable) metaTE).construct(aStack.stackSize, true); + TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); + return true; + } else if(multiblockMap.containsKey(metaTE.getClass())){ + multiblockMap.get(metaTE.getClass()).construct(aStack.stackSize,true,tTileEntity,((IGregTechTileEntity) tTileEntity).getFrontFacing()); + TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass()).getDescription(aStack.stackSize)); return true; } - } else if(tTileEntity instanceof iConstructible){ - ((iConstructible) tTileEntity).construct(aStack.stackSize,true); + } else if(tTileEntity instanceof IConstructable){ + ((IConstructable) tTileEntity).construct(aStack.stackSize,true); + TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); + return true; + } else if(multiblockMap.containsKey(tTileEntity.getClass())){ + multiblockMap.get(tTileEntity.getClass()).construct(aStack.stackSize,true,tTileEntity, aSide); + TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass()).getDescription(aStack.stackSize)); + return true; + } + } else { + if(tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (metaTE instanceof IConstructable) { + TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); + return true; + } else if(multiblockMap.containsKey(metaTE.getClass())){ + TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass()).getDescription(aStack.stackSize)); + return true; + } + } else if(tTileEntity instanceof IConstructable){ + TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); + return true; + } else if(multiblockMap.containsKey(tTileEntity.getClass())){ + TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass()).getDescription(aStack.stackSize)); + return true; } } } @@ -67,15 +112,49 @@ public class ConstructibleTriggerItem extends Item { @Override public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { aList.add(CommonValues.tecMark); - aList.add("Triggers Constructible Interface"); + aList.add("Triggers Constructable Interface"); aList.add(EnumChatFormatting.BLUE + "Shows multiblock construction details,"); aList.add(EnumChatFormatting.BLUE + "just Use on a multiblock controller."); aList.add(EnumChatFormatting.BLUE + "(Sneak Use in creative to build)"); - aList.add(EnumChatFormatting.BLUE + "Quantity affects construction details"); + aList.add(EnumChatFormatting.BLUE + "Quantity affects tier/mode/type"); } public static void run() { INSTANCE = new ConstructibleTriggerItem(); GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + + multiblockMap.put(GT_MetaTileEntity_ElectricBlastFurnace.class, new MultiblockInfoContainer() { + //region Structure + private final String[][] shape = new String[][]{ + {"000","111","111"," . ",}, + {"0!0","1A1","1A1"," ",}, + {"000","111","111"," ",}, + }; + private final Block[] blockType = new Block[]{sBlockCasings1, sHintCasingsTT}; + private final byte[] blockMeta = new byte[]{11, 12}; + private final String[] desc=new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or Heat Proof Casing", + "2 - Muffler Hatch", + "Default - Coil blocks" + }; + //endregion + + @Override + public void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide) { + StructureBuilder(shape, blockType, blockMeta, 1, 3, 0, tileEntity, aSide, hintsOnly); + } + + @Override + public String[] getDescription(int stackSize) { + return desc; + } + }); + } + + public abstract static class MultiblockInfoContainer { + public abstract void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide); + @SideOnly(Side.CLIENT) + public abstract String[] getDescription(int stackSize); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java new file mode 100644 index 0000000000..4bfe104894 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.thing.metaTileEntity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Created by Tec on 24.03.2017. + */ +public interface IConstructable { + void construct(int stackSize, boolean hintsOnly); + @SideOnly(Side.CLIENT) + String[] getStructureDescription(int stackSize); +} + diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/iConstructible.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/iConstructible.java deleted file mode 100644 index 63055a83a1..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/iConstructible.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity; - -/** - * Created by Tec on 24.03.2017. - */ -public interface iConstructible { - void construct(int qty, boolean hintsOnly); -} - diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index ef2bb0480a..71f17d8fe0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -16,7 +16,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ {"\u0002","D000","C0 0","C0 . 0","C0 0","D000"}, @@ -37,6 +37,11 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_annihilation(int aID, String aName, String aNameRegional) { @@ -57,11 +62,16 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta, 5, 5, 0,getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index e0ace3f6b5..7c1fa2f0b5 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -24,7 +24,7 @@ import static gregtech.api.enums.GT_Values.E; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; @@ -76,6 +76,11 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion //region Structure dank - glass sphere for the looks @@ -132,25 +137,30 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - //TODO enable later when you implement 3d models - //if(EM_StructureCheckAdvanced(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ - // glassDome=true; - // return true; - //} + if(EM_StructureCheckAdvanced(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ + glassDome=true; + return true; + } if(EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ glassDome=false; return true; } + //todo check tiers of hatches!!!! return false; } @Override - public void construct(int qty, boolean hintsOnly) { - if((qty&1)==1) StructureBuilder(shape, blockType, blockMeta,16, 16, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + if((stackSize &1)==1) StructureBuilder(shape, blockType, blockMeta,16, 16, 0, getBaseMetaTileEntity(),hintsOnly); else StructureBuilder(shape2, blockType2, blockMeta2,16, 16, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_BHG"); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index a6c6ff4183..83c3820f41 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -28,7 +28,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; private byte eTier = 0; @@ -72,6 +72,14 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Input Hatches or Molecular Casing", + "3 - Elemental Output Hatches or Molecular Casing", + "4 - Elemental Overflow Hatches or Molecular Casing", + "Default - Another Controller facing opposite direction", + }; //endregion public GT_MetaTileEntity_EM_collider(int aID, String aName, String aNameRegional) { @@ -155,7 +163,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX*4; int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ*4; @@ -173,13 +181,18 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB iGregTechTileEntity.getZCoord()+zDir, TT_Container_Casings.sHintCasingsTT,12,2); } - if ((qty & 1) == 1) + if ((stackSize & 1) == 1) StructureBuilder(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity,hintsOnly); else StructureBuilder(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity,hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index df717c8b90..d263da1d6d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -3,13 +3,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; +import com.github.technus.tectech.Vec3pos; import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.dataFramework.QuantumDataPacket; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; -import com.github.technus.tectech.Vec3pos; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -32,7 +32,7 @@ import static gregtech.api.enums.GT_Values.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private final ArrayList<GT_MetaTileEntity_Hatch_Rack> eRacks = new ArrayList<>(); private int maxTemp = 0; @@ -47,6 +47,11 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{1, 3}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic/Data Hatches or Computer casing", + "2 - Rack Hatches or Advanced computer casing", + }; //endregion public GT_MetaTileEntity_EM_computer(int aID, String aName, String aNameRegional) { @@ -211,13 +216,13 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { IGregTechTileEntity igt=getBaseMetaTileEntity(); StructureBuilder(front, blockType, blockMeta, 1, 2, 0, igt,hintsOnly); StructureBuilder(cap, blockType, blockMeta, 1, 2, -1, igt,hintsOnly); byte offset=-2; - for (int rackSlices = qty>12?12:qty; rackSlices>0 ; rackSlices--) { + for (int rackSlices = stackSize >12?12: stackSize; rackSlices>0 ; rackSlices--) { StructureBuilder(slice, blockType, blockMeta, 1, 2, offset--, igt,hintsOnly); } @@ -226,6 +231,11 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override protected void EM_extraExplosions() { for (MetaTileEntity tTileEntity : eRacks) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java index d4ecd5e378..1fa36038b2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -16,7 +16,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ {"A000","0 0","0 . 0","0 0","A000",}, @@ -37,6 +37,11 @@ public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBa private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_crafter(int aID, String aName, String aNameRegional) { @@ -57,11 +62,16 @@ public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 99f48c25ff..11d3f8094e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; @@ -21,7 +21,7 @@ import static gregtech.api.enums.GT_Values.VN; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ {"0C0","A ","A . ","A ","0C0",}, @@ -40,6 +40,11 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_decay(int aID, String aName, String aNameRegional) { @@ -60,11 +65,16 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index e7b6acc5ee..5341a63f6f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -8,7 +8,7 @@ import com.github.technus.tectech.elementalMatter.interfaces.iExchangeInfo; import com.github.technus.tectech.elementalMatter.interfaces.iHasElementalDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -29,22 +29,28 @@ import static gregtech.api.enums.GT_Values.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"!!!", "!.!", "!!!",}, + {" ", " . ", " ",}, {"010", "111", "010",}, {"\"\"\"", "\"1\"", "\"\"\"",}, - {"121", "2 2", "121",}, + {"121", "2!2", "121",}, }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{0, 4, 0}; - private static final String[] addingMethods = new String[]{"addElementalInputToMachineList", "addClassicToMachineList", "addElementalMufflerToMachineList"}; - private static final short[] casingTextures = new short[]{textureOffset + 4, textureOffset, textureOffset + 4}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalInputToMachineList", "addElementalMufflerToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{4, 0, 4}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA + "Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Input Hatch", + "3 - Elemental Overflow Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_dequantizer(int aID, String aName, String aNameRegional) { @@ -65,8 +71,13 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo } @Override - public void construct(int qty, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 12948f1ecb..48d32a47df 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -4,7 +4,7 @@ import cofh.api.energy.IEnergyContainerItem; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.auxiliary.TecTechConfig; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import ic2.api.item.ElectricItem; @@ -22,7 +22,7 @@ import static gregtech.api.GregTech_API.mEUtoRF; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region Structure private static final String[][] shape = new String[][]{ {" ", "000", "1.1", "000", " ",}, @@ -35,6 +35,10 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa private static final short[] casingTextures = new short[]{textureOffset}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + }; //endregion public GT_MetaTileEntity_EM_infuser(int aID, String aName, String aNameRegional) { @@ -62,11 +66,16 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,1, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public boolean EM_checkRecipe(ItemStack itemStack) { if (itemStack != null && itemStack.stackSize == 1) { Item ofThis = itemStack.getItem(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index e659116a28..ecd6e052b8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -3,7 +3,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputElemental; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -18,7 +18,7 @@ import static gregtech.api.enums.GT_Values.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ @@ -33,6 +33,11 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_junction(int aID, String aName, String aNameRegional) { @@ -53,11 +58,16 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index cc79a9fc12..7680fe9e24 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.*; import com.github.technus.tectech.elementalMatter.interfaces.iHasElementalDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -27,21 +27,27 @@ import static gregtech.api.enums.GT_Values.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region Structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"!!!", "!.!", "!!!",}, + {" ", " . ", " ",}, {"010", "101", "010",}, {"\"\"\"", "\"0\"", "\"\"\"",}, - {"202", "0 0", "202",}, + {"202", "0!0", "202",}, }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; - private static final String[] addingMethods = new String[]{"addElementalOutputToMachineList", "addClassicToMachineList", "addElementalMufflerToMachineList"}; - private static final short[] casingTextures = new short[]{textureOffset + 4, textureOffset, textureOffset + 4}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalOutputToMachineList", "addElementalMufflerToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{4, 0, 4}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Output Hatch", + "3 - Elemental Overflow Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_quantizer(int aID, String aName, String aNameRegional) { @@ -62,11 +68,16 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index 94ad820361..53bf42b665 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -3,7 +3,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -28,7 +28,7 @@ import static gregtech.api.enums.GT_Values.V; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private final ArrayList<GT_MetaTileEntity_Hatch_Holder> eHolders = new ArrayList<>(); //region structure @@ -47,6 +47,11 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset + 3, textureOffset + 3}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, Blocks.air}; private static final byte[] blockMetaFallback = new byte[]{3, 0}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic/Data Hatches or Computer casing", + "2 - Holder Hatch", + }; //endregion public GT_MetaTileEntity_EM_research(int aID, String aName, String aNameRegional) { @@ -78,11 +83,16 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,1, 3, 4, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public boolean EM_checkRecipe(ItemStack itemStack) { //for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { // r.getBaseMetaTileEntity().setActive(true); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index c69167f5b0..18a22ae125 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -16,7 +16,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ @@ -27,18 +27,25 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa {"01110", "1C1", "1C1", "1C1", "01110",}, {"01110", "1C1", "1C1", "1C1", "01110",}, {"00100", "01110", "11\"11", "01110", "00100",}, - {"!!!!!", "!000!", "!0#0!", "!000!", "!!!!!",}, + {"#####", "#000#", "#0!0#", "#000#", "#####",}, }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; private static final String[] addingMethods = new String[]{ "addClassicToMachineList", - "addElementalMufflerToMachineList", + "addElementalInputToMachineList", "addElementalOutputToMachineList", - "addElementalInputToMachineList"}; + "addElementalMufflerToMachineList"}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Input Hatches or Molecular Casing", + "3 - Elemental Output Hatches or Molecular Casing", + "4 - Elemental Overflow Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_scanner(int aID, String aName, String aNameRegional) { @@ -61,11 +68,16 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index 2ae8da7587..dd2b8b3ec5 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -16,7 +16,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ {"A010","0 0","1 . 1","0 0","A010",}, @@ -31,6 +31,11 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_stabilizer(int aID, String aName, String aNameRegional) { @@ -51,11 +56,16 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 1a22640b19..cc236828d5 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -24,7 +24,7 @@ import static gregtech.api.enums.GT_Values.E; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible {//TODO MAKE COMPATIBLE WITH STARGATES XD +public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {//TODO MAKE COMPATIBLE WITH STARGATES XD private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; @@ -48,6 +48,11 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + }; //endregion public GT_MetaTileEntity_EM_wormhole(int aID, String aName, String aNameRegional) { @@ -84,11 +89,16 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int qty, boolean hintsOnly) { + public void construct(int stackSize, boolean hintsOnly) { StructureBuilder(shape, blockType, blockMeta,4, 4, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.tecMark, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index b371cb25de..da8290bed7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.auxiliary.Reference; -import com.github.technus.tectech.thing.metaTileEntity.iConstructible; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -31,7 +31,7 @@ import static gregtech.api.GregTech_API.sBlockCasings4; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM implements iConstructible { +public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private int powerSetting = 1000; private int timerSetting = 0; private int timerValue = 0; @@ -61,6 +61,11 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock private static final short[] casingTextures = new short[]{49}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4}; private static final byte[] blockMetaFallback = new byte[]{1}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "Also acts like a hopper so give it an Output Bus", + }; //endregion public GT_MetaTileEntity_TM_microwave(int aID, String aName, String aNameRegional) { @@ -115,12 +120,17 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public void construct(int qty, boolean hintsOnly) { - if((qty&0x1)==1) StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + public void construct(int stackSize, boolean hintsOnly) { + if((stackSize &0x1)==1) StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); else StructureBuilder(shapeFlipped, blockType, blockMeta,2, 1, 0, getBaseMetaTileEntity(),hintsOnly); } @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override public String[] getDescription() { return new String[]{ CommonValues.bassMark, |