diff options
| author | Technus <daniel112092@gmail.com> | 2017-08-12 14:07:53 +0200 |
|---|---|---|
| committer | Technus <daniel112092@gmail.com> | 2017-08-12 14:07:53 +0200 |
| commit | 48b4b1e15e14bc5e9d2a95f16eca24aee771ae34 (patch) | |
| tree | baf7faf50d6dc595d7d9245ef89b31e96a76aed5 /src/main/java | |
| parent | da45e9bf093e5a07f4f7ba34d0f12a618d67314d (diff) | |
| download | GT5-Unofficial-48b4b1e15e14bc5e9d2a95f16eca24aee771ae34.tar.gz GT5-Unofficial-48b4b1e15e14bc5e9d2a95f16eca24aee771ae34.tar.bz2 GT5-Unofficial-48b4b1e15e14bc5e9d2a95f16eca24aee771ae34.zip | |
Refactor constructible interface
Diffstat (limited to 'src/main/java')
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/ConstructibleTr |
