diff options
Diffstat (limited to 'src/main/java/gregtech/common')
11 files changed, 484 insertions, 163 deletions
diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 74dd9d5788..5a036a6648 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -769,6 +769,29 @@ public class GT_RecipeAdder return true; } + @Override + public boolean addAssemblylineRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt) { + if ((aInputs == null) || (aOutput1 == null) || aInputs.length>15 || aInputs.length<4) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput1, aDuration)) <= 0) { + return false; + } + String tRecipe = ""; + for(ItemStack sStack: aInputs){ + tRecipe += sStack.getItem().getItemStackDisplayName(sStack)+" x"+sStack.stackSize+"; "; + } + + for(FluidStack sStack: aFluidInputs){ + tRecipe += sStack.getLocalizedName()+" "+sStack.amount+"L; "; + } + + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "tRecipe", new Object[0])}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); + + GT_Recipe.GT_Recipe_Map.sAssemblylineRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, aFluidInputs, null, aDuration, aEUt, 0); + return true; + } + diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java index c9eec65b97..0a01488f68 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java @@ -22,7 +22,7 @@ public class GT_Block_Casings2 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Bronze Gear Box Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Steel Gear Box Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Titanium Gear Box Casing");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Tungstensteel Gear Box Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Assembling Line Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Processor Machine Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Data Drive Machine Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Containment Field Machine Casing");
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index 3705ce2204..f19219323c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -33,6 +33,9 @@ public class GT_Block_Casings4 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Fusion Coil"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Fusion Casing MK II"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Turbine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Stainless Steel Turbine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Titanium Turbine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Tungstensteel Turbine Casing"); ItemList.Casing_RobustTungstenSteel.set(new ItemStack(this, 1, 0)); ItemList.Casing_CleanStainlessSteel.set(new ItemStack(this, 1, 1)); @@ -42,6 +45,9 @@ public class GT_Block_Casings4 ItemList.Casing_Fusion_Coil.set(new ItemStack(this, 1, 7)); ItemList.Casing_Fusion2.set(new ItemStack(this, 1, 8)); ItemList.Casing_Turbine.set(new ItemStack(this, 1, 9)); + ItemList.Casing_Turbine1.set(new ItemStack(this, 1, 10)); + ItemList.Casing_Turbine2.set(new ItemStack(this, 1, 11)); + ItemList.Casing_Turbine3.set(new ItemStack(this, 1, 12)); } public IIcon getIcon(int aSide, int aMeta) { @@ -67,9 +73,9 @@ public class GT_Block_Casings4 case 9: return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); case 10: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); case 11: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); case 12: return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); case 13: @@ -82,118 +88,176 @@ public class GT_Block_Casings4 return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } + public IIcon getTurbineCasing(int meta, int iconIndex, boolean active) { + switch (meta) { + case 9: + return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE[iconIndex].getIcon(); + case 10: + return active ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() : Textures.BlockIcons.TURBINE1[iconIndex].getIcon(); + case 11: + return active ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() : Textures.BlockIcons.TURBINE2[iconIndex].getIcon(); + case 12: + return active ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() : Textures.BlockIcons.TURBINE3[iconIndex].getIcon(); + default: + return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE[iconIndex].getIcon(); + } + } + @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) { int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); - if (((tMeta != 6) && (tMeta != 8) && (tMeta != 9)) || (!mConnectedMachineTextures)) { + if ((tMeta != 6) && (tMeta != 8) && (tMeta != 9) && (tMeta != 10) && (tMeta != 11) && (tMeta != 12) || (!mConnectedMachineTextures)) { return getIcon(aSide, tMeta); } int tStartIndex = tMeta == 6 ? 1 : 13; - if (tMeta == 9) { + if ((tMeta == 9) || (tMeta == 10) || (tMeta == 11) || (tMeta == 12)) { if ((aSide == 2) || (aSide == 3)) { TileEntity tTileEntity; IMetaTileEntity tMetaTileEntity; if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[0].getIcon(); + return getTurbineCasing(tMeta, 0, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[0].getIcon(); } - return Textures.BlockIcons.TURBINE[0].getIcon(); + return getTurbineCasing(tMeta, 0, false); + //return Textures.BlockIcons.TURBINE[0].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[3].getIcon(); + return getTurbineCasing(tMeta, 3, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[3].getIcon(); } - return Textures.BlockIcons.TURBINE[3].getIcon(); + return getTurbineCasing(tMeta, 3, false); + //return Textures.BlockIcons.TURBINE[3].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[6].getIcon(); + return getTurbineCasing(tMeta, 6, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[6].getIcon(); } - return Textures.BlockIcons.TURBINE[6].getIcon(); + return getTurbineCasing(tMeta, 6, false); + //return Textures.BlockIcons.TURBINE[6].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[1].getIcon(); + return getTurbineCasing(tMeta, 1, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[1].getIcon(); } - return Textures.BlockIcons.TURBINE[1].getIcon(); + return getTurbineCasing(tMeta, 1, false); + //return Textures.BlockIcons.TURBINE[1].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[7].getIcon(); + return getTurbineCasing(tMeta, 7, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[7].getIcon(); } - return Textures.BlockIcons.TURBINE[7].getIcon(); + return getTurbineCasing(tMeta, 7, false); + //return Textures.BlockIcons.TURBINE[7].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[8].getIcon(); + return getTurbineCasing(tMeta, 8, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[8].getIcon(); } - return Textures.BlockIcons.TURBINE[8].getIcon(); + return getTurbineCasing(tMeta, 8, false); + //return Textures.BlockIcons.TURBINE[8].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[5].getIcon(); + return getTurbineCasing(tMeta, 5, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[5].getIcon(); } - return Textures.BlockIcons.TURBINE[5].getIcon(); + return getTurbineCasing(tMeta, 5, false); + //return Textures.BlockIcons.TURBINE[5].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[2].getIcon(); + return getTurbineCasing(tMeta, 2, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[2].getIcon(); } - return Textures.BlockIcons.TURBINE[2].getIcon(); + return getTurbineCasing(tMeta, 2, false); + //return Textures.BlockIcons.TURBINE[2].getIcon(); } } else if ((aSide == 4) || (aSide == 5)) { TileEntity tTileEntity; Object tMetaTileEntity; if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[0].getIcon(); + return getTurbineCasing(tMeta, 0, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[0].getIcon(); } - return Textures.BlockIcons.TURBINE[0].getIcon(); + return getTurbineCasing(tMeta, 0, false); + //return Textures.BlockIcons.TURBINE[0].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[3].getIcon(); + return getTurbineCasing(tMeta, 3, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[3].getIcon(); } - return Textures.BlockIcons.TURBINE[3].getIcon(); + return getTurbineCasing(tMeta, 3, false); + //return Textures.BlockIcons.TURBINE[3].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[6].getIcon(); + return getTurbineCasing(tMeta, 6, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[6].getIcon(); } - return Textures.BlockIcons.TURBINE[6].getIcon(); + return getTurbineCasing(tMeta, 6, false); + //return Textures.BlockIcons.TURBINE[6].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[1].getIcon(); + return getTurbineCasing(tMeta, 1, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[1].getIcon(); } - return Textures.BlockIcons.TURBINE[1].getIcon(); + return getTurbineCasing(tMeta, 1, false); + //return Textures.BlockIcons.TURBINE[1].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[7].getIcon(); + return getTurbineCasing(tMeta, 7, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[7].getIcon(); } - return Textures.BlockIcons.TURBINE[7].getIcon(); + return getTurbineCasing(tMeta, 7, false); + //return Textures.BlockIcons.TURBINE[7].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[8].getIcon(); + return getTurbineCasing(tMeta, 8, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[8].getIcon(); } - return Textures.BlockIcons.TURBINE[8].getIcon(); + return getTurbineCasing(tMeta, 8, false); + //return Textures.BlockIcons.TURBINE[8].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[5].getIcon(); + return getTurbineCasing(tMeta, 5, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[5].getIcon(); } - return Textures.BlockIcons.TURBINE[5].getIcon(); + return getTurbineCasing(tMeta, 5, false); + //return Textures.BlockIcons.TURBINE[5].getIcon(); } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine))) { if (((IGregTechTileEntity) tTileEntity).isActive()) { - return Textures.BlockIcons.TURBINE_ACTIVE[2].getIcon(); + return getTurbineCasing(tMeta, 2, true); + //return Textures.BlockIcons.TURBINE_ACTIVE[2].getIcon(); } - return Textures.BlockIcons.TURBINE[2].getIcon(); + return getTurbineCasing(tMeta, 2, false); + //return Textures.BlockIcons.TURBINE[2].getIcon(); } } - return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + switch (tMeta) { + case 9: + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + case 10: + return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); + case 11: + return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + case 12: + return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + default: + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + } } boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == this) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == this) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == this) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == this) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == this) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == this) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)}; switch (aSide) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index cd4ab71ea8..801cdbd321 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -40,7 +40,7 @@ import java.util.Random; public class GT_Block_Reinforced extends GT_Generic_Block { public GT_Block_Reinforced(String aName) { - super(GT_Item_Storage.class, aName, Material.rock); + super(GT_Item_Storage.class, aName, new Material(net.minecraft.block.material.MapColor.stoneColor)); setStepSound(soundTypeStone); setCreativeTab(GregTech_API.TAB_GREGTECH); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Bronzeplate Reinforced Block"); @@ -65,7 +65,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } public String getHarvestTool(int aMeta) { - if (aMeta == 4||aMeta == 5) return "axe"; + if (aMeta == 4) return "shovel"; + if (aMeta == 5) return "axe"; return "pickaxe"; } @@ -98,6 +99,9 @@ public class GT_Block_Reinforced extends GT_Generic_Block { if (aWorld == null) { return 0.0F; } + if (aWorld.isAirBlock(aX, aY, aZ)) { + return 0.0F; + } int tMeta = aWorld.getBlockMetadata(aX, aY, aZ); if (tMeta == 0) { return 60.0F; diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java index 6e98629fdc..5f6ef0c6bb 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java @@ -66,7 +66,7 @@ public class GT_MetaGenerated_Tool_01 addTool(8, "Hoe", "", new GT_Tool_Hoe(), new Object[]{ToolDictNames.craftingToolHoe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 4L)});
addTool(10, "Saw", "Can also harvest Ice", new GT_Tool_Saw(), new Object[]{ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)});
GregTech_API.registerTool(addTool(12, "Hammer", "Crushes Ores instead of harvesting them", new GT_Tool_HardHammer(), new Object[]{ToolDictNames.craftingToolHardHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)}), GregTech_API.sHardHammerList);
- GregTech_API.registerTool(addTool(14, "Soft Hammer", "", new GT_Tool_SoftHammer(), new Object[]{ToolDictNames.craftingToolSoftHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)}), GregTech_API.sSoftHammerList);
+ GregTech_API.registerTool(addTool(14, "Soft Mallet", "", new GT_Tool_SoftHammer(), new Object[]{ToolDictNames.craftingToolSoftHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)}), GregTech_API.sSoftHammerList);
GregTech_API.registerTool(addTool(WRENCH, "Wrench", "Hold Leftclick to dismantle Machines", new GT_Tool_Wrench(), new Object[]{ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)}), GregTech_API.sWrenchList);
addTool(18, "File", "", new GT_Tool_File(), new Object[]{ToolDictNames.craftingToolFile, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)});
GregTech_API.registerTool(addTool(20, "Crowbar", "Dismounts Covers and Rotates Rails", new GT_Tool_Crowbar(), new Object[]{ToolDictNames.craftingToolCrowbar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L)}), GregTech_API.sCrowbarList);
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java new file mode 100644 index 0000000000..e292c4a1c3 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -0,0 +1,230 @@ +package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.Arrays; + +public class GT_MetaTileEntity_AssemblyLine + extends GT_MetaTileEntity_MultiBlockBase { + public GT_MetaTileEntity_AssemblyLine(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_AssemblyLine(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_AssemblyLine(this.mName); + } + + public String[] getDescription() { + return new String[]{"Assembly line", + "Size: 3x(2-16)x4, variable lenght", + "Bottom: Steel Casing(or Maintainance or Input Hatch), Input Bus(Last Output Bus), Steel Casing", + "Middle: Reinforced Glass, Assembling Line, Reinforced Glass", + "UpMiddle: Grate Casing(or Controller), Assambling Casing, Grate Casing", + "Top: Steel Casing(or Energy Hatch)", + "Up to 16 repeating slices, last is Output Bus"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sImplosionRecipes; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public boolean checkRecipe(ItemStack aStack) { + ArrayList<ItemStack> tInputList = getStoredInputs(); + for (int i = 0; i < tInputList.size() - 1; i++) { + for (int j = i + 1; j < tInputList.size(); j++) { + if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { + if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) { + tInputList.remove(j--); + } else { + tInputList.remove(i--); + break; + } + } + } + } + ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); + + ArrayList<FluidStack> tFluidList = getStoredFluids(); + for (int i = 0; i < tFluidList.size() - 1; i++) { + for (int j = i + 1; j < tFluidList.size(); j++) { + if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { + if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { + tFluidList.remove(j--); + } else { + tFluidList.remove(i--); + break; + } + } + } + } + FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); + if (tInputList.size() > 0) { + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAssemblylineRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + if (tRecipe.mEUt <= 16) { + this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + } else { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + updateSlots(); + return true; + } + } + return false; + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 20) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); + } + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + if (xDir != 0) { + for(int r = 0; r <= 16; r++){ + int i = r*xDir; + + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(0, 0, i)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(0, 0, i)!=10){return false;} + if(!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")){return false;} + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){ + if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) {return false;} + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 1, i); + if (!addEnergyInputToMachineList(tTileEntity, 16)){ + if (aBaseMetaTileEntity.getBlockOffset(xDir, 1, i) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(xDir, 1, i) != 0) {return false;} + } + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(xDir, 0, i)!=GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(xDir, 0, i)!=9){return false;} + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(xDir,-1, i)!=GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(xDir,-1, i)!=5){return false;} + + + if(aBaseMetaTileEntity.getBlockOffset(xDir*2, 0, i)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(xDir*2, 0, i)!=10){return false;} + if(!aBaseMetaTileEntity.getBlockOffset(xDir*2, -1, i).getUnlocalizedName().equals("blockAlloyGlass")){return false;} + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir*2, -2, i); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){ + if (aBaseMetaTileEntity.getBlockOffset(xDir*2, -2, i) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(xDir*2, -2, i) != 0) {return false;} + } + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i); + if (!addInputToMachineList(tTileEntity, 16)){ + if (!addOutputToMachineList(tTileEntity, 16)){;return false; + }else{if(r>0){return true;}else{return false;}} + } + } + }else{ + for(int r = 0; r <= 16; r++){ + int i = r*-zDir; + + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(i, 0, 0)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0)!=10){return false;} + if(!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")){return false;} + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){ + if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) {return false;} + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 1, zDir); + if (!addEnergyInputToMachineList(tTileEntity, 16)){ + if (aBaseMetaTileEntity.getBlockOffset(i, 1, zDir) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(i, 1, zDir) != 0) {return false;} + } + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(i, 0, zDir)!=GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir)!=9){return false;} + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(i,-1, zDir)!=GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(i,-1, zDir)!=5){return false;} + + + if(aBaseMetaTileEntity.getBlockOffset(i, 0, zDir*2)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir*2)!=10){return false;} + if(!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir*2).getUnlocalizedName().equals("blockAlloyGlass")){return false;} + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir*2); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){ + if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir*2) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir*2) != 0) {return false;} + } + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir); + if (!addInputToMachineList(tTileEntity, 16)){ + if (!addOutputToMachineList(tTileEntity, 16)){ + }else{if(r>0){return true;}else{return false;}} + } + } |
