From aad7dba1e59db2d9e4e55585d51d2013162d71ba Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Wed, 28 Sep 2016 23:09:15 +0200 Subject: [PATCH 01/24] Processing Ore code changes from Blood asps gt code --- .../loaders/oreprocessing/ProcessingOre.java | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java index b0b2604b..7d112298 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java @@ -32,7 +32,6 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra GT_ModHandler.addValuableOre(GT_Utility.getBlockFromStack(aOreStack), aOreStack.getItemDamage(), aMaterial.mOreValue); Materials tMaterial = aMaterial.mOreReplacement; Materials tPrimaryByMaterial = null; - Materials tSecondaryByMaterial = null; aMultiplier = Math.max(1, aMultiplier); aOreStack = GT_Utility.copyAmount(1L, new Object[]{aOreStack}); aOreStack.stackSize = 1; @@ -42,14 +41,10 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra ItemStack tGem = GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial, 1L); ItemStack tSmeltInto = tIngot == null ? null : aMaterial.contains(SubTag.SMELTING_TO_GEM) ? GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial.mDirectSmelting, GT_OreDictUnificator.get(OrePrefixes.crystal, tMaterial.mDirectSmelting, GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial, GT_OreDictUnificator.get(OrePrefixes.crystal, tMaterial, 1L), 1L), 1L), 1L) : tIngot; - ItemStack tSmall = GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMaterial, 1L); ItemStack tDust = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, tGem, 1L); ItemStack tCleaned = GT_OreDictUnificator.get(OrePrefixes.crushedPurified, tMaterial, tDust, 1L); ItemStack tCrushed = GT_OreDictUnificator.get(OrePrefixes.crushed, tMaterial, aMaterial.mOreMultiplier * aMultiplier); ItemStack tPrimaryByProduct = null; - ItemStack tPrimaryByProductSmall = null; - ItemStack tSecondaryByProduct = null; - ItemStack tSecondaryByProductSmall = null; if (tCrushed == null) { tCrushed = GT_OreDictUnificator.get(OrePrefixes.dustImpure, tMaterial, GT_Utility.copyAmount(aMaterial.mOreMultiplier * aMultiplier, new Object[]{tCleaned, tDust, tGem}), aMaterial.mOreMultiplier * aMultiplier); @@ -63,17 +58,12 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra if (tPrimaryByProduct == null) { tPrimaryByMaterial = tMat; tPrimaryByProduct = GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L); - tPrimaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L); - if (tPrimaryByProductSmall == null) - tPrimaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L); + if (GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L) == null) + GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L); } - if ((tSecondaryByProduct == null) || (tSecondaryByMaterial == tPrimaryByMaterial)) { - tSecondaryByMaterial = tMat; - tSecondaryByProduct = GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L); - tSecondaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L); - if (tSecondaryByProductSmall == null) { - tSecondaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L); - } + GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L); + if (GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L) == null) { + GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L); } } if ((!tByProductStacks.isEmpty()) && (!this.mAlreadyListedOres.contains(aMaterial))) { @@ -83,14 +73,6 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra if (tPrimaryByMaterial == null) tPrimaryByMaterial = tMaterial; if (tPrimaryByProduct == null) tPrimaryByProduct = tDust; - if (tPrimaryByProductSmall == null) { - tPrimaryByProductSmall = tSmall; - } - if (tSecondaryByMaterial == null) tSecondaryByMaterial = tPrimaryByMaterial; - if (tSecondaryByProduct == null) tSecondaryByProduct = tPrimaryByProduct; - if (tSecondaryByProductSmall == null) { - tSecondaryByProductSmall = tPrimaryByProductSmall; - } boolean tHasSmelting = false; if (tSmeltInto != null) { @@ -110,7 +92,9 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra } if (!tHasSmelting) { - tHasSmelting = GT_ModHandler.addSmeltingRecipe(aOreStack, GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial.mDirectSmelting, Math.max(1, aMultiplier * aMaterial.mSmeltingMultiplier / 2))); + //dead code? + //tHasSmelting = GT_ModHandler.addSmeltingRecipe(aOreStack, GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial.mDirectSmelting, Math.max(1, aMultiplier * aMaterial.mSmeltingMultiplier / 2))); + GT_ModHandler.addSmeltingRecipe(aOreStack, GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial.mDirectSmelting, Math.max(1, aMultiplier * aMaterial.mSmeltingMultiplier / 2))); } if (tCrushed != null) { From d61b120ce40be4601168084216ef641934c3ca01 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Wed, 28 Sep 2016 23:31:49 +0200 Subject: [PATCH 02/24] Adding UBC Support from Blood asps code --- .../gregtech/common/blocks/GT_Block_Ores.java | 7 +-- .../common/blocks/GT_Block_Ores_Abstract.java | 62 +++++-------------- .../common/blocks/GT_Block_Ores_UB1.java | 4 +- .../common/blocks/GT_Block_Ores_UB2.java | 4 +- .../common/blocks/GT_Block_Ores_UB3.java | 6 +- 5 files changed, 27 insertions(+), 56 deletions(-) diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java index b7585f17..530a67dd 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java @@ -13,7 +13,7 @@ import net.minecraft.init.Blocks; public class GT_Block_Ores extends GT_Block_Ores_Abstract { public GT_Block_Ores() { - super("gt.blockores", false, Material.rock); + super("gt.blockores", 7, false, Material.rock); } @Override @@ -36,11 +36,6 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { return new Materials[]{Materials.Stone, Materials.Netherrack, Materials.Endstone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Marble, Materials.Basalt, Materials.Stone}; } - @Override - public int getHarvestLevel(int aMeta) { - return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8; - } - @Override public ITexture[] getTextureSet() { //Must have 16 entries. return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE), new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)}; diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index e69404f2..d0eaaae0 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -36,64 +36,34 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public static ThreadLocal mTemporaryTileEntity = new ThreadLocal(); public static boolean FUCKING_LOCK = false; public static boolean tHideOres; + public static int tOreMetaCount; private final String aTextName = ".name"; private final String aTextSmall = "Small "; - private final String aTextDot = "."; - private final String aTextNothing = ""; - protected GT_Block_Ores_Abstract(String aUnlocalizedName, boolean aHideFirstMeta, Material aMaterial) { + protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) { super(GT_Item_Ores.class, aUnlocalizedName, aMaterial); this.isBlockContainer = true; setStepSound(soundTypeStone); setCreativeTab(GregTech_API.TAB_GREGTECH_ORES); tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres; + tOreMetaCount = aOreMetaCount; + if(aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8; + for (int i = 0; i < 16; i++) { GT_ModHandler.addValuableOre(this, i, 1); } for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) { if (GregTech_API.sGeneratedMaterials[i] != null) { - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + i + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 1000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 2000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 3000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 4000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 5000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 6000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 7000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 16000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 17000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 18000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 19000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 20000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 21000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 22000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 23000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) { - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[0] != null ? this.getProcessingPrefix()[0].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i)); - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[1] != null ? this.getProcessingPrefix()[1].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 1000)); - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[2] != null ? this.getProcessingPrefix()[2].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 2000)); - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[3] != null ? this.getProcessingPrefix()[3].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 3000)); - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[4] != null ? this.getProcessingPrefix()[4].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 4000)); - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[5] != null ? this.getProcessingPrefix()[5].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 5000)); - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[6] != null ? this.getProcessingPrefix()[6].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 6000)); - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[7] != null ? this.getProcessingPrefix()[7].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 7000)); - if (tHideOres) { - if (aHideFirstMeta) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 2000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 3000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 4000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 5000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 6000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 7000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 16000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 17000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 22000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 23000)); + for (int j = 0; j < aOreMetaCount; j++) { + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) { + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000))); + if (tHideOres) { + if(!(j == 0 && !aHideFirstMeta)){ + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + (j * 1000)));} + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, (i + 16000) + (j * 1000))); + } } } } @@ -166,7 +136,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } public int getHarvestLevel(int aMeta) { - return 2; + return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8; } public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java index f1b00558..ac17e65b 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java @@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_CopiedBlockTexture; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "igneousStone"); public GT_Block_Ores_UB1() { - super("gt.blockores.ub1", true, Material.rock); + super("gt.blockores.ub1", 8, true, Material.rock); + if (aUBBlock == null) aUBBlock = Blocks.stone; } @Override diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java index 7b2ff5cd..e4caa95d 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java @@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_CopiedBlockTexture; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "metamorphicStone"); public GT_Block_Ores_UB2() { - super("gt.blockores.ub2", true, Material.rock); + super("gt.blockores.ub2", 8, true, Material.rock); + if (aUBBlock == null) aUBBlock = Blocks.stone; } @Override diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java index b2dc7d92..85721556 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java @@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_CopiedBlockTexture; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "sedimentaryStone"); public GT_Block_Ores_UB3() { - super("gt.blockores.ub3", true, Material.rock); + super("gt.blockores.ub3", 8, true, Material.rock); + if (aUBBlock == null) aUBBlock = Blocks.stone; } @Override @@ -40,4 +42,4 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { public ITexture[] getTextureSet() { //Must have 16 entries. return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)}; } -} \ No newline at end of file +} From 829c7911aa7ebb12f7aed1cf741112376e554920 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Wed, 28 Sep 2016 23:34:13 +0200 Subject: [PATCH 03/24] changes Disel gen text --- .../machines/multi/GT_MetaTileEntity_DieselEngine.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index 087c58fa..c5658799 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -42,6 +42,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock "Size(WxHxD): 3x3x4, Controller (front centered)", "3x3x4 of Stable Titanium Casing (hollow, Min 24!)", "2x Titanium Gear Box Casing inside the Hollow Casing", + "8x Engine Intake Casings (around controller, Min 8!)", "1x Input Hatch (one of the Casings)", "1x Maintenance Hatch (one of the Casings)", "1x Muffler Hatch (top middle back)", From 4659eb185e33f3b5687441ef73dd51d74f14f950 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Thu, 29 Sep 2016 03:42:44 +0100 Subject: [PATCH 04/24] Temp fix for missing Greg'd recipes (Muramasa) --- src/main/java/gregtech/GT_Mod.java | 18 +- .../java/gregtech/api/util/GT_ModHandler.java | 163 +++++++----------- .../api/util/GT_RecipeRegistrator.java | 71 +++----- 3 files changed, 102 insertions(+), 150 deletions(-) diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index bca97198..01c50905 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -78,15 +78,15 @@ public class GT_Mod implements IGT_Mod { public GT_Mod() { try { - Class.forName("ic2.core.IC2").getField("enableOreDictCircuit").set(null, Boolean.valueOf(true)); + Class.forName("ic2.core.IC2").getField("enableOreDictCircuit").set(null, Boolean.FALSE); } catch (Throwable e) { } try { - Class.forName("ic2.core.IC2").getField("enableCraftingBucket").set(null, Boolean.valueOf(false)); + Class.forName("ic2.core.IC2").getField("enableCraftingBucket").set(null, Boolean.FALSE); } catch (Throwable e) { } try { - Class.forName("ic2.core.IC2").getField("enableEnergyInStorageBlockItems").set(null, Boolean.valueOf(false)); + Class.forName("ic2.core.IC2").getField("enableEnergyInStorageBlockItems").set(null, Boolean.FALSE); } catch (Throwable e) { } GT_Values.GT = this; @@ -100,6 +100,7 @@ public class GT_Mod implements IGT_Mod { @Mod.EventHandler public void onPreLoad(FMLPreInitializationEvent aEvent) { + Locale.setDefault(Locale.ENGLISH); if (GregTech_API.sPreloadStarted) { return; } @@ -231,6 +232,14 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mNerfedCombs = tMainConfig.get(aTextGeneral, "NerfCombs", true).getBoolean(true); gregtechproxy.mHideUnusedOres = tMainConfig.get(aTextGeneral, "HideUnusedOres", true).getBoolean(true); gregtechproxy.mHideRecyclingRecipes = tMainConfig.get(aTextGeneral, "HideRecyclingRecipes", true).getBoolean(true); + gregtechproxy.mArcSmeltIntoAnnealed = tMainConfig.get(aTextGeneral, "ArcSmeltIntoAnnealedWrought", true).getBoolean(true); + gregtechproxy.mMagneticraftRecipes = tMainConfig.get(aTextGeneral, "EnableMagneticraftSupport", true).getBoolean(true); + gregtechproxy.mMagneticraftBonusOutputPercent = tMainConfig.get(aTextGeneral, "MagneticraftBonusOutputPercent", 100.0f).getDouble(); + gregtechproxy.mPollution = tMainConfig.get("Pollution", "EnablePollution", true).getBoolean(true); + gregtechproxy.mPollutionSmogLimit = tMainConfig.get("Pollution", "SmogLimit", 500000).getInt(500000); + gregtechproxy.mPollutionPoisonLimit = tMainConfig.get("Pollution", "PoisonLimit", 750000).getInt(750000); + gregtechproxy.mPollutionVegetationLimit = tMainConfig.get("Pollution", "VegetationLimit", 1000000).getInt(1000000); + gregtechproxy.mPollutionSourRainLimit = tMainConfig.get("Pollution", "SourRainLimit", 2000000).getInt(2000000); GregTech_API.mOutputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "OutputRF", true); GregTech_API.mInputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "InputRF", false); @@ -450,7 +459,7 @@ public class GT_Mod implements IGT_Mod { GT_Log.out.println("GT_Mod: List of Lists of Tool Recipes: "+GT_ModHandler.sSingleNonBlockDamagableRecipeList_list.toString()); GT_Log.out.println("GT_Mod: Vanilla Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sVanillaRecipeList_warntOutput.toString()); GT_Log.out.println("GT_Mod: Single Non Block Damagable Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sSingleNonBlockDamagableRecipeList_warntOutput.toString()); - GT_Log.out.println("GT_Mod: sRodMaterialList cycles: " + GT_RecipeRegistrator.sRodMaterialList_cycles); + //GT_Log.out.println("GT_Mod: sRodMaterialList cycles: " + GT_RecipeRegistrator.sRodMaterialList_cycles); if (GT_Values.D1) { IRecipe tRecipe; for (Iterator i$ = GT_ModHandler.sSingleNonBlockDamagableRecipeList.iterator(); i$.hasNext(); GT_Log.out.println("=> " + tRecipe.getRecipeOutput().getDisplayName())) { @@ -683,7 +692,6 @@ public class GT_Mod implements IGT_Mod { } achievements = new GT_Achievements(); - Map.Entry tRecipe; GT_Log.out.println("GT_Mod: Loading finished, deallocating temporary Init Variables."); GregTech_API.sBeforeGTPreload = null; GregTech_API.sAfterGTPreload = null; diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 30b996a5..4822c0be 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -1228,12 +1228,11 @@ public class GT_ModHandler { sAllRecipeList.clear(); sAllRecipeList.addAll(tList); } - int sAllRecipeList_sS=sAllRecipeList.size(); - for (int i = 0, j = sAllRecipeList_sS; i < j; i++) { + for (int i = 0, j = sAllRecipeList.size(); i < j; i++) { IRecipe tRecipe = sAllRecipeList.get(i); if (tRecipe.matches(aCrafting, aWorld)) { if (i > 10) { - sAllRecipeList.remove(i); sAllRecipeList_sS=sAllRecipeList.size(); + sAllRecipeList.remove(i); sAllRecipeList.add(i - 10, tRecipe); } return tRecipe.getCraftingResult(aCrafting); @@ -1293,23 +1292,25 @@ public class GT_ModHandler { }, 3, 3); for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); ArrayList tList = (ArrayList) CraftingManager.getInstance().getRecipeList(); - int tList_sS=tList.size(); - try { - for (int i = 0; i < tList_sS; i++) { - temp = false; + for (int i = 0; i < tList.size(); i++) { + temp = false; + try { temp = tList.get(i).matches(aCrafting, DW); - if (temp) { - ItemStack tOutput = aUncopiedStack ? tList.get(i).getRecipeOutput() : tList.get(i).getCraftingResult(aCrafting); - if (tOutput == null || tOutput.stackSize <= 0) { - // Seriously, who would ever do that shit? - if (!GregTech_API.sPostloadFinished) - throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); - } else { - if (aUncopiedStack) return tOutput; - return GT_Utility.copy(tOutput); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + if (temp) { + ItemStack tOutput = aUncopiedStack ? tList.get(i).getRecipeOutput() : tList.get(i).getCraftingResult(aCrafting); + if (tOutput == null || tOutput.stackSize <= 0) { + // Seriously, who would ever do that shit? + if (!GregTech_API.sPostloadFinished) + throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); + } else { + if (aUncopiedStack) return tOutput; + return GT_Utility.copy(tOutput); } - }} catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } + } return null; } @@ -1319,69 +1320,47 @@ public class GT_ModHandler { * This also removes old Recipes from the List. */ public static ArrayList getVanillyToolRecipeOutputs(ItemStack... aRecipe) { - ArrayList rList = new ArrayList(); - if (aRecipe == null) {return rList;} - if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) { - sSingleNonBlockDamagableRecipeList.clear();sSingleNonBlockDamagableRecipeList_create = true;sSingleNonBlockDamagableRecipeList_validsShapes1.clear();} - if (sSingleNonBlockDamagableRecipeList_create/*sSingleNonBlockDamagableRecipeList.isEmpty()*/) { + if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) + sSingleNonBlockDamagableRecipeList.clear(); + if (sSingleNonBlockDamagableRecipeList.isEmpty()) { for (IRecipe tRecipe : (ArrayList) CraftingManager.getInstance().getRecipeList()) { ItemStack tStack = tRecipe.getRecipeOutput(); if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 && tStack.getMaxDamage() > 0 && !(tStack.getItem() instanceof ItemBlock) && !(tStack.getItem() instanceof IReactorComponent) && !isElectricItem(tStack) && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) { - //if (!(tRecipe instanceof ShapelessRecipes) || tRecipe instanceof ShapelessOreRecipe) { - if (tRecipe instanceof ShapedOreRecipe) { - boolean temp = true; - for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput()) { - if (tObject != null) { - if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { + if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) { + if (tRecipe instanceof ShapedOreRecipe) { + boolean temp = true; + for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput()) + if (tObject != null) { + if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { + temp = false; + break; + } + if (tObject instanceof List && ((List) tObject).isEmpty()) { + temp = false; + break; + } + } + if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe); + } else if (tRecipe instanceof ShapedRecipes) { + boolean temp = true; + for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) { + if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) { temp = false; break; } - if (tObject instanceof List && ((List) tObject).isEmpty()) { - temp = false; - break; - } - }} - if (temp) {sSingleNonBlockDamagableRecipeList.add(tRecipe);} - } else if (tRecipe instanceof ShapedRecipes) { - boolean temp = true; - for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) { - if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) { - temp = false; - break; } + if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe); + } else { + sSingleNonBlockDamagableRecipeList.add(tRecipe); } - if (temp) {sSingleNonBlockDamagableRecipeList.add(tRecipe);} - } else { - sSingleNonBlockDamagableRecipeList.add(tRecipe); } - //} } } GT_Log.out.println("GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() + " Recipes for recycling." + (sSingleNonBlockDamagableRecipeList.size() > 1024 ? " Scanning all these Recipes is the reason for the startup Lag you receive right now." : E)); - int aList_move = sSingleNonBlockDamagableRecipeList.size(); - sSingleNonBlockDamagableRecipeList_list.add(aList_move); - sSingleNonBlockDamagableRecipeList_create = false; - sSingleNonBlockDamagableRecipeList_validsShapes1_update = true; - InventoryCrafting aCrafting = new InventoryCrafting(new Container() { - @Override - public boolean canInteractWith(EntityPlayer var1) {return false;}}, 3, 3); - for (int i = 0; i < aList_move; i++) { - for (int j = 0; j < sShapes1.length; j++) { - ItemStack[] sRecipe = sShapes1[j]; - for (int l = 0; l < 9 && l < sRecipe.length; l++) {aCrafting.setInventorySlotContents(l, sRecipe[l]);} - IRecipe vRecipe = sSingleNonBlockDamagableRecipeList.get(i); - if (vRecipe.matches(aCrafting, DW)) { - if (!(sSingleNonBlockDamagableRecipeList_validsShapes1.contains(j))) {sSingleNonBlockDamagableRecipeList_validsShapes1.add(j);} - sSingleNonBlockDamagableRecipeList_verified.add(vRecipe); - } - } - } - } - /*ArrayList */ - if (sSingleNonBlockDamagableRecipeList_verified.size() != 0) {rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList_verified, true, aRecipe);} - if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) { - sSingleNonBlockDamagableRecipeList.clear();sSingleNonBlockDamagableRecipeList_create = true;sSingleNonBlockDamagableRecipeList_validsShapes1.clear();} + ArrayList rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList, true, aRecipe); + if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) + sSingleNonBlockDamagableRecipeList.clear(); return rList; } @@ -1399,7 +1378,7 @@ public class GT_ModHandler { */ public static ArrayList getRecipeOutputs(List aList, boolean aDeleteFromList, ItemStack... aRecipe) { ArrayList rList = new ArrayList(); - if (aRecipe == null || aList.size() == 0) {return rList;} + if (aRecipe == null) return rList; boolean temp = false; for (byte i = 0; i < aRecipe.length; i++) { if (aRecipe[i] != null) { @@ -1407,51 +1386,33 @@ public class GT_ModHandler { break; } } - if (!temp) {return rList;} + if (!temp) return rList; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @Override public boolean canInteractWith(EntityPlayer var1) { return false; } }, 3, 3); - for (int i = 0; i < 9 && i < aRecipe.length; i++) {aCrafting.setInventorySlotContents(i, aRecipe[i]);} - int aList_sS=aList.size(); - ArrayList tempaList_list = new ArrayList(); - if(!aDeleteFromList) { - for (int i = 0; i < aList_sS; i++) { - IRecipe tempALg0 = aList.get(i); - if (tempALg0.matches(aCrafting, DW)) { - ItemStack tOutput = tempALg0.getCraftingResult(aCrafting); - if (tOutput == null || tOutput.stackSize <= 0) { - if (!(sVanillaRecipeList_warntOutput.contains(i))) {sVanillaRecipeList_warntOutput.add(i);} - } else { - rList.add(GT_Utility.copy(tOutput)); - if (aDeleteFromList) {tempaList_list.add(i);} - } - } + for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); + for (int i = 0; i < aList.size(); i++) { + temp = false; + try { + temp = aList.get(i).matches(aCrafting, DW); + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); } - } else { - for (int i = 0; i < aList_sS; i++) { - IRecipe tempALg0 = aList.get(i); - ItemStack tOutput = tempALg0.getCraftingResult(aCrafting); + if (temp) { + ItemStack tOutput = aList.get(i).getCraftingResult(aCrafting); if (tOutput == null || tOutput.stackSize <= 0) { - if (!(sSingleNonBlockDamagableRecipeList_warntOutput.contains(i))) {sSingleNonBlockDamagableRecipeList_warntOutput.add(i);} + // Seriously, who would ever do that shit? + if (!GregTech_API.sPostloadFinished) + throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); } else { rList.add(GT_Utility.copy(tOutput)); - if (aDeleteFromList) {tempaList_list.add(i);} + if (aDeleteFromList) aList.remove(i--); } } } - //boolean tempaList_list_b = tempaList_list.size() != 0 ? true : false; - if (aDeleteFromList && tempaList_list.size() != 0) { - List tempaList_2 = new ArrayList(); - for (int i = 0; i < aList_sS; i++) { - int k = 0, l = 0; - if (tempaList_list.get(k) == i) {k++;continue;} - tempaList_2.add(aList.get(l));l++; - } - aList = tempaList_2; - } return rList; } diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java index 27d3aed1..bbac9cd2 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java +++ b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java @@ -121,8 +121,6 @@ public class GT_RecipeRegistrator { {"Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R} }; public static volatile int VERSION = 509; - public static int sRodMaterialList_cycles = 0; - private static int i_count = 0; public static void registerMaterialRecycling(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByproduct) { if (GT_Utility.isStackInvalid(aStack)) return; @@ -153,8 +151,8 @@ public class GT_RecipeRegistrator { ItemData tData = GT_OreDictUnificator.getItemData(aStack); boolean tHide = (aMaterial != Materials.Iron)&&(GT_Mod.gregtechproxy.mHideRecyclingRecipes); if(tHide && tData!=null&&tData.hasValidPrefixData()&&tData.mPrefix==OrePrefixes.ingot){ - tHide=false; - } + tHide=false; + } RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, aStack), aByproduct == null ? null : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL) ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) ? GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2) : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) ? GT_OreDictUnificator.getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) : null : GT_OreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount), aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), 10000, (int) Math.max(1, (24 * aMaterialAmount) / M), Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())), tHide); } @@ -191,8 +189,8 @@ public class GT_RecipeRegistrator { for (MaterialStack tMaterial : aData.getAllMaterialStacks()) { if (tMaterial.mMaterial == Materials.Iron||tMaterial.mMaterial == Materials.Copper || - tMaterial.mMaterial == Materials.WroughtIron||tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true; - + tMaterial.mMaterial == Materials.WroughtIron||tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true; + if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) { tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto; continue; @@ -230,7 +228,7 @@ public class GT_RecipeRegistrator { long tAmount = 0; for (MaterialStack tMaterial : aData.getAllMaterialStacks()) tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass(); - + boolean tHide = !tIron && GT_Mod.gregtechproxy.mHideRecyclingRecipes; RA.addArcFurnaceRecipe(aStack, new ItemStack[]{GT_OreDictUnificator.getIngotOrDust(aData.mMaterial), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2))}, null, (int) Math.max(16, tAmount / M), 96, tHide); } @@ -274,7 +272,7 @@ public class GT_RecipeRegistrator { * You give this Function a Material and it will scan almost everything for adding recycling Recipes * * @param aMat a Material, for example an Ingot or a Gem. - * @param aPlate the Dust you usually get from macerating aMat + * @param aOutput the Dust you usually get from macerating aMat * @param aRecipeReplacing allows to replace the Recipe with a Plate variant */ public static synchronized void registerUsagesForMaterials(ItemStack aMat, String aPlate, boolean aRecipeReplacing) { @@ -282,11 +280,8 @@ public class GT_RecipeRegistrator { aMat = GT_Utility.copy(aMat); ItemStack tStack; ItemData aItemData = GT_OreDictUnificator.getItemData(aMat); - boolean aItemData_b_0 = aItemData != null ? true : false; - if (!aItemData_b_0 || aItemData.mPrefix != OrePrefixes.ingot) {aPlate = null;} + if (aItemData == null || aItemData.mPrefix != OrePrefixes.ingot) aPlate = null; if (aPlate != null && GT_OreDictUnificator.getFirstOre(aPlate, 1) == null) aPlate = null; - boolean aItemData_b_1 = aItemData.hasValidPrefixMaterialData() ? true : false; - boolean aPlate_b_0 = aPlate != null ? true : false; sMt1.func_150996_a(aMat.getItem()); sMt1.stackSize = 1; @@ -301,13 +296,12 @@ public class GT_RecipeRegistrator { for (ItemStack tMat : tRecipe) { if (tMat == sMt1) tAmount1++; } - if (aItemData_b_0 && aItemData_b_1) + if (aItemData != null && aItemData.hasValidPrefixMaterialData()) for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputs(tRecipe)) { GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1)); } } - GT_ModHandler.getVanillyToolRecipeOutputs(sShapes1[0]); for (Materials tMaterial : sRodMaterialList) { ItemStack tMt2 = GT_OreDictUnificator.get(OrePrefixes.stick, tMaterial, 1); if (tMt2 != null) { @@ -315,48 +309,37 @@ public class GT_RecipeRegistrator { sMt2.stackSize = 1; Items.feather.setDamage(sMt2, Items.feather.getDamage(tMt2)); - if (GT_ModHandler.sSingleNonBlockDamagableRecipeList.size() == 0 || GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size() == 0 || GT_ModHandler.sSingleNonBlockDamagableRecipeList_verified.size() == 0) { sRodMaterialList_cycles++;continue;} - int sShapes1_len = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size(); - for (int i = 0; i < sShapes1_len; i++) { - int i2 = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.get(i); - ItemStack[] tRecipe = sShapes1[i2]; - if (tRecipe == null) continue; + for (int i = 0; i < sShapes1.length; i++) { + ItemStack[] tRecipe = sShapes1[i]; int tAmount1 = 0, tAmount2 = 0; for (ItemStack tMat : tRecipe) { if (tMat == sMt1) tAmount1++; if (tMat == sMt2) tAmount2++; } - List tempTest = GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe); - if (GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1_update && GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size() != 0) {sShapes1_len = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size();GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1_update = false;} - int tempTest_size_sS = tempTest.size(); - if (tempTest_size_sS > 0) { - for (ItemStack tCrafted : tempTest/*GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)*/) { - if (aItemData_b_0 && aItemData_b_1) { - GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2))); - } + for (ItemStack tCrafted : GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)) { + if (aItemData != null && aItemData.hasValidPrefixMaterialData()) + GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2))); - if (aRecipeReplacing && aPlate_b_0 && sShapesA[i2] != null && sShapesA[i2].length > 1) { - //assert aItemData != null;//dead dev code or decomp JAD? - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, new StringBuilder().append(aItemData.mMaterial.mMaterial).append('.').append(sShapesA[i2][0]).toString(), true)) { - if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) { - switch (sShapesA[i].length) { - case 2: - GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); - break; - case 3: - GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], sShapesA[i2][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); - break; - default: - GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], sShapesA[i2][2], sShapesA[i2][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); - break; - } + if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) { + assert aItemData != null; + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], true)) { + if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) { + switch (sShapesA[i].length) { + case 2: + GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); + break; + case 3: + GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); + break; + default: + GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData}); + break; } } } } } - sRodMaterialList_cycles++; } } } From 1806dd0758659effe6478f3a7ea8976f5edd8d2d Mon Sep 17 00:00:00 2001 From: Muramasa- Date: Wed, 28 Sep 2016 05:45:30 +0100 Subject: [PATCH 05/24] fix interdimensional teleport(Blood asp) --- .../java/gregtech/api/util/GT_Utility.java | 172 ++++++++---------- .../basic/GT_MetaTileEntity_Teleporter.java | 72 ++++---- 2 files changed, 116 insertions(+), 128 deletions(-) diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index cfd0b4b8..c425278d 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -51,7 +51,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; @@ -95,14 +94,6 @@ public class GT_Utility { GregTech_API.sItemStackMappings.add(sEmptyContainerToFluidToData); } - public static int safeInt(long number, int margin){ - return number>Integer.MAX_VALUE-margin ? Integer.MAX_VALUE-margin :(int)number; - } - - public static int safeInt(long number){ - return number>GT_Values.V[GT_Values.V.length-1] ? safeInt(GT_Values.V[GT_Values.V.length-1],1) : number aRecipeList, ItemStack aOutput){ if ((isStackInvalid(aInput) && isStackInvalid(aOutput) && isStackInvalid(aContainer)) || aRecipeList == null) return false; boolean rReturn = false; @@ -869,10 +860,12 @@ public class GT_Utility { return false; } } + ItemStack[] tStack = GT_OreDictUnificator.getStackArray(true, aOutput); + if(tStack==null||(tStack.length>0&>_Utility.areStacksEqual(aInput, tStack[0])))return false; if (tOreName != null) { - aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, GT_OreDictUnificator.getStackArray(true, aOutput))); + aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack)); } else { - aRecipeList.put(new RecipeInputItemStack(copy(aInput), aInput.stackSize), new RecipeOutput(aNBT, GT_OreDictUnificator.getStackArray(true, aOutput))); + aRecipeList.put(new RecipeInputItemStack(copy(aInput), aInput.stackSize), new RecipeOutput(aNBT, tStack)); } return true; } @@ -929,7 +922,7 @@ public class GT_Utility { } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) { - return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 0.9F + new Random().nextFloat() * 0.2F, aX, aY, aZ); + return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ); } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) { @@ -1053,35 +1046,15 @@ public class GT_Utility { } public static boolean isOpaqueBlock(World aWorld, int aX, int aY, int aZ) { - boolean result; - try { - result=aWorld.getBlock(aX, aY, aZ).isOpaqueCube(); - } catch (Throwable e) { - result=true; - } - return result; - + return aWorld.getBlock(aX, aY, aZ).isOpaqueCube(); } public static boolean isBlockAir(World aWorld, int aX, int aY, int aZ) { - boolean result; - try { - result=aWorld.getBlock(aX, aY, aZ).isAir(aWorld, aX, aY, aZ); - } catch (Throwable e) { - result=false; - } - return result; - } + return aWorld.getBlock(aX, aY, aZ).isAir(aWorld, aX, aY, aZ); + } public static boolean hasBlockHitBox(World aWorld, int aX, int aY, int aZ) { - boolean result; - try { - result=aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null; - } catch (Throwable e) { - result=false; - } - return result; - + return aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null; } public static void setCoordsOnFire(World aWorld, int aX, int aY, int aZ, boolean aReplaceCenter) { @@ -1123,7 +1096,6 @@ public class GT_Utility { * Converts a Number to a String */ public static String parseNumberToString(int aNumber) { - String tString = E; boolean temp = true, negative = false; if (aNumber < 0) { @@ -1131,15 +1103,18 @@ public class GT_Utility { negative = true; } + StringBuilder tStringB = new StringBuilder(); for (int i = 1000000000; i > 0; i /= 10) { int tDigit = (aNumber / i) % 10; if (temp && tDigit != 0) temp = false; if (!temp) { - tString += tDigit; - if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tString += ","; + tStringB.append(tDigit); + if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tStringB.append(","); } } + String tString = tStringB.toString(); + if (tString.equals(E)) tString = "0"; return negative ? "-" + tString : tString; @@ -1438,7 +1413,7 @@ public class GT_Utility { Collections.sort(tEntrySet, new Comparator>() { @Override public int compare(Entry aValue1, Entry aValue2) { - return -aValue1.getValue().compareTo(aValue2.getValue()); + return aValue2.getValue().compareTo(aValue1.getValue());//FB: RV - RV_NEGATING_RESULT_OF_COMPARETO } }); LinkedHashMap rMap = new LinkedHashMap(); @@ -1480,26 +1455,27 @@ public class GT_Utility { if (tTargetWorld != null && tOriginalWorld != null && tTargetWorld != tOriginalWorld) { if (aEntity.ridingEntity != null) aEntity.mountEntity(null); if (aEntity.riddenByEntity != null) aEntity.riddenByEntity.mountEntity(null); - if (aEntity instanceof EntityPlayerMP) { EntityPlayerMP aPlayer = (EntityPlayerMP) aEntity; - aPlayer.dimension = aDimension; - aPlayer.playerNetServerHandler.sendPacket(new S07PacketRespawn(aPlayer.dimension, aPlayer.worldObj.difficultySetting, aPlayer.worldObj.getWorldInfo().getTerrainType(), aPlayer.theItemInWorldManager.getGameType())); - tOriginalWorld.removePlayerEntityDangerously(aPlayer); - aPlayer.isDead = false; - aPlayer.setWorld(tTargetWorld); - MinecraftServer.getServer().getConfigurationManager().func_72375_a(aPlayer, tOriginalWorld); +// aPlayer.dimension = aDimension; +// aPlayer.playerNetServerHandler.sendPacket(new S07PacketRespawn(aPlayer.dimension, aPlayer.worldObj.difficultySetting, aPlayer.worldObj.getWorldInfo().getTerrainType(), aPlayer.theItemInWorldManager.getGameType())); +// tOriginalWorld.removePlayerEntityDangerously(aPlayer); +// aPlayer.isDead = false; +// aPlayer.setWorld(tTargetWorld); +// MinecraftServer.getServer().getConfigurationManager().func_72375_a(aPlayer, tOriginalWorld); +// aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch); +// aPlayer.theItemInWorldManager.setWorld(tTargetWorld); +// MinecraftServer.getServer().getConfigurationManager().updateTimeAndWeatherForPlayer(aPlayer, tTargetWorld); +// MinecraftServer.getServer().getConfigurationManager().syncPlayerInventory(aPlayer); +// Iterator tIterator = aPlayer.getActivePotionEffects().iterator(); +// while (tIterator.hasNext()) { +// PotionEffect potioneffect = (PotionEffect) tIterator.next(); +// aPlayer.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(aPlayer.getEntityId(), potioneffect)); +// } +// FMLCommonHandler.instance().firePlayerChangedDimensionEvent(aPlayer, tOriginalWorld.provider.dimensionId, aDimension); + aPlayer.travelToDimension(aDimension); aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch); - aPlayer.theItemInWorldManager.setWorld(tTargetWorld); - MinecraftServer.getServer().getConfigurationManager().updateTimeAndWeatherForPlayer(aPlayer, tTargetWorld); - MinecraftServer.getServer().getConfigurationManager().syncPlayerInventory(aPlayer); - Iterator tIterator = aPlayer.getActivePotionEffects().iterator(); - while (tIterator.hasNext()) { - PotionEffect potioneffect = (PotionEffect) tIterator.next(); - aPlayer.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(aPlayer.getEntityId(), potioneffect)); - } - aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch); - FMLCommonHandler.instance().firePlayerChangedDimensionEvent(aPlayer, tOriginalWorld.provider.dimensionId, aDimension); + } else { aEntity.setPosition(aX + 0.5, aY + 0.5, aZ + 0.5); aEntity.worldObj.removeEntity(aEntity); @@ -1534,7 +1510,7 @@ public class GT_Utility { public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ) { - + Random tRandom = new Random((aWorld.getSeed() + (aX / 96) + (7 * (aZ / 96)))); int oil = tRandom.nextInt(3); double amount = tRandom.nextInt(50) + tRandom.nextDouble(); @@ -1561,17 +1537,17 @@ public class GT_Utility { int tAmount = (int) (Math.pow(amount, 5) / 100); ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); int[] tInts = new int[2]; - if(GT_Proxy.chunkData.containsKey(tPos)){ - tInts = GT_Proxy.chunkData.get(tPos); - if(tInts.length>0){ - if(tInts[0]>=0){tAmount = tInts[0];} - } - GT_Proxy.chunkData.remove(tPos); - } - tAmount = tAmount - 5; - tInts[0] = tAmount; - GT_Proxy.chunkData.put(tPos, tInts); - + if(GT_Proxy.chunkData.containsKey(tPos)){ + tInts = GT_Proxy.chunkData.get(tPos); + if(tInts.length>0){ + if(tInts[0]>=0){tAmount = tInts[0];} + } + GT_Proxy.chunkData.remove(tPos); + } + tAmount = tAmount - 5; + tInts[0] = tAmount; + GT_Proxy.chunkData.put(tPos, tInts); + return new FluidStack(tFluid, tAmount); } @@ -1585,15 +1561,15 @@ public class GT_Utility { Block tBlock = aWorld.getBlock(aX, aY, aZ); - tList.add("----- X: " +EnumChatFormatting.AQUA+ aX +EnumChatFormatting.RESET + " Y: " +EnumChatFormatting.AQUA+ aY +EnumChatFormatting.RESET+ " Z: " +EnumChatFormatting.AQUA+ aZ +EnumChatFormatting.RESET+ " -----"); + tList.add("----- X: " + aX + " Y: " + aY + " Z: " + aZ + " -----"); try { - if (tTileEntity != null && tTileEntity instanceof IInventory) - tList.add("Name: " + EnumChatFormatting.BLUE+ ((IInventory) tTileEntity).getInventoryName()+EnumChatFormatting.RESET + " MetaData: " +EnumChatFormatting.AQUA+ aWorld.getBlockMetadata(aX, aY, aZ)+EnumChatFormatting.RESET); + if (tTileEntity instanceof IInventory) + tList.add("Name: " + ((IInventory) tTileEntity).getInventoryName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); else - tList.add("Name: " +EnumChatFormatting.BLUE+ tBlock.getUnlocalizedName() +EnumChatFormatting.RESET+ " MetaData: " +EnumChatFormatting.AQUA+ aWorld.getBlockMetadata(aX, aY, aZ)+EnumChatFormatting.RESET); + tList.add("Name: " + tBlock.getUnlocalizedName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); - tList.add("Hardness: " +EnumChatFormatting.YELLOW+ tBlock.getBlockHardness(aWorld, aX, aY, aZ) +EnumChatFormatting.RESET+ " Blast Resistance: " +EnumChatFormatting.YELLOW+ tBlock.getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ)+EnumChatFormatting.RESET); - if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add(EnumChatFormatting.GOLD+"Is valid Beacon Pyramid Material"+EnumChatFormatting.RESET ); + tList.add("Hardness: " + tBlock.getBlockHardness(aWorld, aX, aY, aZ) + " Blast Resistance: " + tBlock.getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ)); + if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add("Is valid Beacon Pyramid Material"); } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } @@ -1603,7 +1579,7 @@ public class GT_Utility { rEUAmount += 500; FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity).getTankInfo(ForgeDirection.getOrientation(aSide)); if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) { - tList.add("Tank " + i + ": " +EnumChatFormatting.GREEN+ GT_Utility.formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) +EnumChatFormatting.RESET+ " L / " +EnumChatFormatting.YELLOW+ GT_Utility.formatNumbers(tTanks[i].capacity) +EnumChatFormatting.RESET+ " L of " +EnumChatFormatting.GOLD+ getFluidName(tTanks[i].fluid, true)+EnumChatFormatting.RESET); + tList.add("Tank " + i + ": " + GT_Utility.formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) + " / " + GT_Utility.formatNumbers(tTanks[i].capacity) + " " + getFluidName(tTanks[i].fluid, true)); } } } catch (Throwable e) { @@ -1620,8 +1596,8 @@ public class GT_Utility { try { if (tTileEntity instanceof ic2.api.reactor.IReactor) { rEUAmount += 500; - tList.add("Heat: " +EnumChatFormatting.GREEN+ ((ic2.api.reactor.IReactor) tTileEntity).getHeat() +EnumChatFormatting.RESET+ " / " +EnumChatFormatting.YELLOW+ ((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat()+EnumChatFormatting.RESET); - tList.add("HEM: " +EnumChatFormatting.YELLOW+((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() +EnumChatFormatting.RESET/*+ " Base EU Output: " + ((ic2.api.reactor.IReactor)tTileEntity).getOutput()*/);//TODO WHAT? + tList.add("Heat: " + ((ic2.api.reactor.IReactor) tTileEntity).getHeat() + "/" + ((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat() + + " HEM: " + ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() + " Base EU Output: "/* + ((ic2.api.reactor.IReactor)tTileEntity).getOutput()*/); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1629,8 +1605,8 @@ public class GT_Utility { try { if (tTileEntity instanceof ic2.api.tile.IWrenchable) { rEUAmount += 100; - tList.add("Facing: " +EnumChatFormatting.GREEN+ ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() +EnumChatFormatting.RESET+ " / Chance: " +EnumChatFormatting.YELLOW+ (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) +EnumChatFormatting.RESET+ "%"); - tList.add(((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) ? EnumChatFormatting.GREEN+"You can remove this with a Wrench"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"You can NOT remove this with a Wrench"+EnumChatFormatting.RESET); + tList.add("Facing: " + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() + " / Chance: " + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) + "%"); + tList.add(((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) ? "You can remove this with a Wrench" : "You can NOT remove this with a Wrench"); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1664,7 +1640,7 @@ public class GT_Utility { try { if (tTileEntity instanceof ic2.api.energy.tile.IEnergyConductor) { rEUAmount += 200; - tList.add("Conduction Loss: " +EnumChatFormatting.YELLOW+ ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss()+EnumChatFormatting.RESET); + tList.add("Conduction Loss: " + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss()); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1672,7 +1648,7 @@ public class GT_Utility { try { if (tTileEntity instanceof ic2.api.tile.IEnergyStorage) { rEUAmount += 200; - tList.add("Contained Energy: " +EnumChatFormatting.YELLOW+ ((ic2.api.tile.IEnergyStorage) tTileEntity).getStored() +EnumChatFormatting.RESET+ " EU / " +EnumChatFormatting.YELLOW+ ((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()+EnumChatFormatting.RESET+" EU"); + tList.add("Contained Energy: " + ((ic2.api.tile.IEnergyStorage) tTileEntity).getStored() + " of " + ((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()); //aList.add(((ic2.api.tile.IEnergyStorage)tTileEntity).isTeleporterCompatible(ic2.api.Direction.YP)?"Teleporter Compatible":"Not Teleporter Compatible"); } } catch (Throwable e) { @@ -1681,7 +1657,7 @@ public class GT_Utility { try { if (tTileEntity instanceof IUpgradableMachine) { rEUAmount += 500; - if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add(EnumChatFormatting.GREEN+"Has Muffler Upgrade"+EnumChatFormatting.RESET); + if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add("Has Muffler Upgrade"); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1691,7 +1667,7 @@ public class GT_Utility { rEUAmount += 400; int tValue = 0; if (0 < (tValue = ((IMachineProgress) tTileEntity).getMaxProgress())) - tList.add("Progress: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(((IMachineProgress) tTileEntity).getProgress()/20) +EnumChatFormatting.RESET+ " s / " +EnumChatFormatting.YELLOW+GT_Utility.formatNumbers(tValue/20) +EnumChatFormatting.RESET+" s"); + tList.add("Progress: " + GT_Utility.formatNumbers(tValue) + " / " + GT_Utility.formatNumbers(((IMachineProgress) tTileEntity).getProgress())); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1707,16 +1683,16 @@ public class GT_Utility { } try { if (tTileEntity instanceof IBasicEnergyContainer && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) { - tList.add("Max IN: " +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getInputVoltage() +EnumChatFormatting.RESET+ " EU at "+EnumChatFormatting.RED+((IBasicEnergyContainer)tTileEntity).getInputAmperage()+EnumChatFormatting.RESET+" A"); - tList.add("Max OUT: " +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getOutputVoltage() +EnumChatFormatting.RESET+ " EU at " +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getOutputAmperage() +EnumChatFormatting.RESET+ " A"); - tList.add("Energy: " +EnumChatFormatting.GREEN+ GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) +EnumChatFormatting.RESET+ " EU / " +EnumChatFormatting.YELLOW+ GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) +EnumChatFormatting.RESET+ " EU"); + tList.add("Max IN: " + ((IBasicEnergyContainer) tTileEntity).getInputVoltage() + " EU"); + tList.add("Max OUT: " + ((IBasicEnergyContainer) tTileEntity).getOutputVoltage() + " EU at " + ((IBasicEnergyContainer) tTileEntity).getOutputAmperage() + " Amperes"); + tList.add("Energy: " + GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) + " / " + GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) + "EU"); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } try { if (tTileEntity instanceof IGregTechTileEntity) { - tList.add("Owned by: " +EnumChatFormatting.BLUE+ ((IGregTechTileEntity) tTileEntity).getOwnerName()+EnumChatFormatting.RESET); + tList.add("Owned by: " + ((IGregTechTileEntity) tTileEntity).getOwnerName()); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -1750,10 +1726,11 @@ public class GT_Utility { + " Humidity: " + ((ic2.api.crops.ICropTile) tTileEntity).getHumidity() + " Air-Quality: " + ((ic2.api.crops.ICropTile) tTileEntity).getAirQuality() ); - String tString = E; + StringBuilder tStringB = new StringBuilder(); for (String tAttribute : ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].attributes()) { - tString += ", " + tAttribute; + tStringB.append(", ").append(tAttribute); } + String tString = tStringB.toString(); tList.add("Attributes:" + tString.replaceFirst(",", E)); tList.add("Discovered by: " + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].discoveredBy()); } @@ -1764,8 +1741,19 @@ public class GT_Utility { } if (aPlayer.capabilities.isCreativeMode&>_Values.D1) { FluidStack tFluid = getUndergroundOil(aWorld, aX, aZ); - tList.add(EnumChatFormatting.GOLD+"Oil"+EnumChatFormatting.RESET+" in Chunk: " +EnumChatFormatting.YELLOW+ tFluid.amount + " " + tFluid.getLocalizedName()+EnumChatFormatting.RESET); + tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName()); } +// if(aPlayer.capabilities.isCreativeMode){ + ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); + if(GT_Proxy.chunkData.containsKey(tPos)){ + int[] tPollution = GT_Proxy.chunkData.get(tPos); + if(tPollution.length>1){ + tList.add("Pollution in Chunk: "+tPollution[1]); + }else{ + tList.add("No Pollution in Chunk"); + } + } +// } try { if (tBlock instanceof IDebugableBlock) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index 42996841..3265c157 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -1,6 +1,5 @@ package gregtech.common.tileentities.machines.basic; -import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -9,6 +8,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Teleporter; @@ -22,16 +22,17 @@ import net.minecraft.entity.boss.EntityDragonPart; import net.minecraft.entity.effect.EntityWeatherEffect; import net.minecraft.entity.item.*; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fluids.FluidStack; @@ -45,7 +46,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { public int mTargetZ = 0; public int mTargetD = 0; public boolean mDebug = false; - public boolean hasBlock = false; + public boolean hasEgg = false; public GT_MetaTileEntity_Teleporter(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 3, "Teleport long distances with this little device."); @@ -137,7 +138,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - this.hasBlock = checkForBlock(); + this.hasEgg = checkForEgg(); aBaseMetaTileEntity.openGUI(aPlayer); return true; } @@ -161,16 +162,10 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { public boolean isGivingInformation() { return true; } - + public String[] getInfoData() { - return new String[]{ - "Coordinates:", - "X: "+ EnumChatFormatting.GREEN+ this.mTargetX+EnumChatFormatting.RESET, - "Y: "+EnumChatFormatting.GREEN+ this.mTargetY+EnumChatFormatting.RESET, - "Z: "+EnumChatFormatting.GREEN+ this.mTargetZ+EnumChatFormatting.RESET, - "Dimension: " + EnumChatFormatting.YELLOW+this.mTargetD+EnumChatFormatting.RESET - }; + return new String[]{"Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD}; } @Override @@ -200,24 +195,23 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); } - @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - if (aBaseMetaTileEntity.isServerSide()) { + public void onFirstTick() { + if (getBaseMetaTileEntity().isServerSide()) { if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) { - this.mTargetX = aBaseMetaTileEntity.getXCoord(); - this.mTargetY = aBaseMetaTileEntity.getYCoord(); - this.mTargetZ = aBaseMetaTileEntity.getZCoord(); - this.mTargetD = aBaseMetaTileEntity.getWorld().provider.dimensionId; + this.mTargetX = getBaseMetaTileEntity().getXCoord(); + this.mTargetY = getBaseMetaTileEntity().getYCoord(); + this.mTargetZ = getBaseMetaTileEntity().getZCoord(); + this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId; } - this.hasBlock = checkForBlock(); + this.hasEgg = checkForEgg(); } } - public boolean checkForBlock() { + public boolean checkForEgg() { for (byte i = -5; i <= 5; i = (byte) (i + 1)) { for (byte j = -5; j <= 5; j = (byte) (j + 1)) { for (byte k = -5; k <= 5; k = (byte) (k + 1)) { - if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == GregTech_API.sBlockMetal5 && getBaseMetaTileEntity().getMetaIDOffset(i, j, k) == 2){ + if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) { return true; } } @@ -227,7 +221,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } public boolean hasDimensionalTeleportCapability() { - return (this.mDebug) || (this.hasBlock) || (mFluid.isFluidEqual(Materials.Iron.getPlasma(1)) && mFluid.amount >= 1000); + return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 10); } public boolean isDimensionalTeleportAvailable() { @@ -237,16 +231,16 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mFluid == null) { - mFluid = Materials.Iron.getPlasma(0); + mFluid = Materials.Nitrogen.getPlasma(0); } super.onPostTick(aBaseMetaTileEntity, aTick); if (getBaseMetaTileEntity().isServerSide()) { if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { - this.hasBlock = checkForBlock(); + this.hasEgg = checkForEgg(); } if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) { if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)) { - if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) { + if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))&& new XSTR().nextInt(10)==0) { mFluid.amount--; if (mFluid.amount < 1) { mFluid = null; @@ -267,7 +261,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { int tStacksize = mInventory[0].stackSize; GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)tDistance * tDistance * ((long)tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)), false); + getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * tDistance * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize))), false); } } @@ -275,9 +269,10 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) { if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) { Entity tEntity = (Entity) tObject; - if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)(tDistance * tDistance * weightCalculation(tEntity)), false)) { - if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) { - mFluid.amount = mFluid.amount - (GT_Utility.safeInt(Math.min(1000L, (long)(tDistance * tDistance * weightCalculation(tEntity) / 8192)))); + System.out.println("teleport"+(Math.pow(tDistance, 1.5))); + if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity)), false)) { + if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) { + mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192))); if (mFluid.amount < 1) { mFluid = null; } @@ -289,11 +284,16 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { tEntity.riddenByEntity.mountEntity(null); } if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) { - if ((tEntity instanceof EntityLivingBase)) { - ((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); - } else { - tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); - } +// System.out.println("tele"); +//// System.out.println("tdim: "+mTargetD+" proDim: "+getBaseMetaTileEntity().getWorld().provider.dimensionId); +// if ((tEntity instanceof EntityLivingBase)) { +// if(this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId){ +// System.out.println("move dim"); +// GT_Utility.moveEntityToDimensionAtCoords(tEntity, mTargetD, mTargetX, mTargetY, mTargetZ); +// }else{((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);} +// } else { +// tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); +// } } } } @@ -307,7 +307,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } private int distanceCalculation() { - return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); + return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 4000 : (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)))); } @Override From 1972ee4076bffae3e308ba11da45157eaec05511 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 27 Sep 2016 18:11:19 +0200 Subject: [PATCH 06/24] Count pipe transfers on input not output side --- .../metatileentity/implementations/GT_MetaPipeEntity_Item.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java index 0a3ee8d5..e08ae2fb 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java @@ -210,7 +210,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE tPipeList.add(tTileEntity); while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity)) for (IMetaTileEntityItemPipe tPipe : tPipeList) - if (!tPipe.incrementTransferCounter(1)) temp = true; + if (!tPipe.incrementTransferCounter(1)) temp = false; } } } From 5eef2209fbb4b73f014215b85c77016f787ff184 Mon Sep 17 00:00:00 2001 From: Muramasa- Date: Mon, 26 Sep 2016 14:03:20 +0100 Subject: [PATCH 07/24] Possible fix for scanner TE error(Blood Asp) --- .../machines/basic/GT_MetaTileEntity_Scanner.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 99a63623..13c7ad2b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -226,11 +226,8 @@ public class GT_MetaTileEntity_Scanner @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime >= (mMaxProgresstime - 1)) { - try { - if (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")) { - GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); - } - } catch (Exception e) { + if (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")) { + GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); } } super.onPostTick(aBaseMetaTileEntity, aTick); From 9946e218dfc9bcffdf81e37206066a57fc8a062d Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Thu, 29 Sep 2016 10:44:12 +0200 Subject: [PATCH 08/24] revert some stuff --- src/main/java/gregtech/GT_Mod.java | 8 -------- src/main/java/gregtech/api/util/GT_Utility.java | 9 +++++++++ .../machines/basic/GT_MetaTileEntity_Teleporter.java | 5 +++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 01c50905..353ed342 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -232,14 +232,6 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mNerfedCombs = tMainConfig.get(aTextGeneral, "NerfCombs", true).getBoolean(true); gregtechproxy.mHideUnusedOres = tMainConfig.get(aTextGeneral, "HideUnusedOres", true).getBoolean(true); gregtechproxy.mHideRecyclingRecipes = tMainConfig.get(aTextGeneral, "HideRecyclingRecipes", true).getBoolean(true); - gregtechproxy.mArcSmeltIntoAnnealed = tMainConfig.get(aTextGeneral, "ArcSmeltIntoAnnealedWrought", true).getBoolean(true); - gregtechproxy.mMagneticraftRecipes = tMainConfig.get(aTextGeneral, "EnableMagneticraftSupport", true).getBoolean(true); - gregtechproxy.mMagneticraftBonusOutputPercent = tMainConfig.get(aTextGeneral, "MagneticraftBonusOutputPercent", 100.0f).getDouble(); - gregtechproxy.mPollution = tMainConfig.get("Pollution", "EnablePollution", true).getBoolean(true); - gregtechproxy.mPollutionSmogLimit = tMainConfig.get("Pollution", "SmogLimit", 500000).getInt(500000); - gregtechproxy.mPollutionPoisonLimit = tMainConfig.get("Pollution", "PoisonLimit", 750000).getInt(750000); - gregtechproxy.mPollutionVegetationLimit = tMainConfig.get("Pollution", "VegetationLimit", 1000000).getInt(1000000); - gregtechproxy.mPollutionSourRainLimit = tMainConfig.get("Pollution", "SourRainLimit", 2000000).getInt(2000000); GregTech_API.mOutputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "OutputRF", true); GregTech_API.mInputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "InputRF", false); diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index c425278d..a7a79141 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -51,6 +51,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; @@ -94,6 +95,14 @@ public class GT_Utility { GregTech_API.sItemStackMappings.add(sEmptyContainerToFluidToData); } + public static int safeInt(long number, int margin){ + return number>Integer.MAX_VALUE-margin ? Integer.MAX_VALUE-margin :(int)number; + } + + public static int safeInt(long number){ + return number>GT_Values.V[GT_Values.V.length-1] ? safeInt(GT_Values.V[GT_Values.V.length-1],1) : number Date: Thu, 29 Sep 2016 10:45:39 +0200 Subject: [PATCH 09/24] revert Teleporter code --- .../basic/GT_MetaTileEntity_Teleporter.java | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index fb99f4d6..c989cd33 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.basic; +import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -8,7 +9,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Teleporter; @@ -22,13 +22,11 @@ import net.minecraft.entity.boss.EntityDragonPart; import net.minecraft.entity.effect.EntityWeatherEffect; import net.minecraft.entity.item.*; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.entity.projectile.EntityThrowable; -import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -166,7 +164,13 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { public String[] getInfoData() { - return new String[]{"Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD}; + return new String[]{ + "Coordinates:", + "X: "+ EnumChatFormatting.GREEN+ this.mTargetX+EnumChatFormatting.RESET, + "Y: "+EnumChatFormatting.GREEN+ this.mTargetY+EnumChatFormatting.RESET, + "Z: "+EnumChatFormatting.GREEN+ this.mTargetZ+EnumChatFormatting.RESET, + "Dimension: " + EnumChatFormatting.YELLOW+this.mTargetD+EnumChatFormatting.RESET + }; } @Override @@ -196,23 +200,24 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); } - public void onFirstTick() { - if (getBaseMetaTileEntity().isServerSide()) { + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + if (aBaseMetaTileEntity.isServerSide()) { if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) { - this.mTargetX = getBaseMetaTileEntity().getXCoord(); - this.mTargetY = getBaseMetaTileEntity().getYCoord(); - this.mTargetZ = getBaseMetaTileEntity().getZCoord(); - this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId; + this.mTargetX = aBaseMetaTileEntity.getXCoord(); + this.mTargetY = aBaseMetaTileEntity.getYCoord(); + this.mTargetZ = aBaseMetaTileEntity.getZCoord(); + this.mTargetD = aBaseMetaTileEntity.getWorld().provider.dimensionId; } - this.hasEgg = checkForEgg(); + this.hasBlock = checkForBlock(); } } - public boolean checkForEgg() { + public boolean checkForBlock() { for (byte i = -5; i <= 5; i = (byte) (i + 1)) { for (byte j = -5; j <= 5; j = (byte) (j + 1)) { for (byte k = -5; k <= 5; k = (byte) (k + 1)) { - if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) { + if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == GregTech_API.sBlockMetal5 && getBaseMetaTileEntity().getMetaIDOffset(i, j, k) == 2){ return true; } } @@ -222,7 +227,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } public boolean hasDimensionalTeleportCapability() { - return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 10); + return (this.mDebug) || (this.hasBlock) || (mFluid.isFluidEqual(Materials.Iron.getPlasma(1)) && mFluid.amount >= 1000); } public boolean isDimensionalTeleportAvailable() { @@ -232,16 +237,16 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mFluid == null) { - mFluid = Materials.Nitrogen.getPlasma(0); + mFluid = Materials.Iron.getPlasma(0); } super.onPostTick(aBaseMetaTileEntity, aTick); if (getBaseMetaTileEntity().isServerSide()) { if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { - this.hasEgg = checkForEgg(); + this.hasBlock = checkForBlock(); } if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) { if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)) { - if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))&& new XSTR().nextInt(10)==0) { + if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) { mFluid.amount--; if (mFluid.amount < 1) { mFluid = null; @@ -262,7 +267,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { int tStacksize = mInventory[0].stackSize; GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * tDistance * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize))), false); + getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)tDistance * tDistance * ((long)tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)), false); } } @@ -270,10 +275,9 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) { if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) { Entity tEntity = (Entity) tObject; - System.out.println("teleport"+(Math.pow(tDistance, 1.5))); - if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity)), false)) { - if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) { - mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192))); + if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)(tDistance * tDistance * weightCalculation(tEntity)), false)) { + if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) { + mFluid.amount = mFluid.amount - (GT_Utility.safeInt(Math.min(1000L, (long)(tDistance * tDistance * weightCalculation(tEntity) / 8192)))); if (mFluid.amount < 1) { mFluid = null; } @@ -285,16 +289,11 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { tEntity.riddenByEntity.mountEntity(null); } if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) { -// System.out.println("tele"); -//// System.out.println("tdim: "+mTargetD+" proDim: "+getBaseMetaTileEntity().getWorld().provider.dimensionId); -// if ((tEntity instanceof EntityLivingBase)) { -// if(this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId){ -// System.out.println("move dim"); -// GT_Utility.moveEntityToDimensionAtCoords(tEntity, mTargetD, mTargetX, mTargetY, mTargetZ); -// }else{((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);} -// } else { -// tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); -// } + if ((tEntity instanceof EntityLivingBase)) { + ((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + } else { + tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + } } } } @@ -308,7 +307,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } private int distanceCalculation() { - return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 4000 : (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)))); + return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); } @Override From 761494de6f375973510124fff1d6f6a423732257 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 28 Sep 2016 20:42:41 +0200 Subject: [PATCH 10/24] temporary disable returning of slabs on paper craft because of bug --- .../gregtech/loaders/postload/GT_CraftingRecipeLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java index 75228329..ad513ecc 100644 --- a/src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java @@ -736,9 +736,9 @@ public class GT_CraftingRecipeLoader implements Runnable { GT_ModHandler.removeRecipeByOutput(new ItemStack(Items.sugar)); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 2), new Object[]{"SSS", " m ", 'S', new ItemStack(Items.reeds)}); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sugar, 1), new Object[]{"Sm ", 'S', new ItemStack(Items.reeds)}); - ItemStack brick = new ItemStack(new ItemStack(Blocks.stone_slab).getItem().setContainerItem(new ItemStack(Blocks.stone_slab).getItem())); -// ItemStack brick = new ItemStack(Items.brick.setContainerItem(Items.brick)); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick}); +// ItemStack brick = new ItemStack(new ItemStack(Blocks.stone_slab).getItem().setContainerItem(new ItemStack(Blocks.stone_slab).getItem())); +// GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick}); + GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', new ItemStack(Blocks.stone_slab)}); // GameRegistry.addRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), " C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick); } From c3c85319c07b1561907ce835cff0f403b80266f2 Mon Sep 17 00:00:00 2001 From: Technus Date: Sat, 1 Oct 2016 12:05:49 +0200 Subject: [PATCH 11/24] Fixes #714 - solar boiler --- .../boilers/GT_MetaTileEntity_Boiler_Solar.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java index 134905fe..4cd5047c 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -58,7 +58,6 @@ public class GT_MetaTileEntity_Boiler_Solar public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures); } - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { @@ -92,8 +91,7 @@ public class GT_MetaTileEntity_Boiler_Solar aBaseMetaTileEntity.doExplosion(2048L); return; } - - } + this.mFluid.amount -= 1; if (this.mSteam == null) { this.mSteam = GT_ModHandler.getSteam(150L); } else if (GT_ModHandler.isSteam(this.mSteam)) { @@ -122,4 +120,6 @@ public class GT_MetaTileEntity_Boiler_Solar aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); } } +} + From 372e5193ba78a02f889e54a29767edba8851d49d Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sat, 1 Oct 2016 02:03:29 +0100 Subject: [PATCH 12/24] 2f97e5e8901e35709239ecb6c157f93406f0de30 --- .../loaders/postload/GT_Worldgenloader.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java b/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java index 7fb8848d..2a8c4c93 100644 --- a/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java +++ b/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java @@ -49,16 +49,16 @@ public class GT_Worldgenloader new GT_Worldgen_Stone("overworld.stone.basalt.large", true, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false); new GT_Worldgen_Stone("overworld.stone.basalt.huge", true, GregTech_API.sBlockStones, 8, 0, 1, 400, 240, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.marble.tiny", true, GregTech_API.sBlockStones, 0, 0, 1, 50, 48, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.marble.small", true, GregTech_API.sBlockStones, 0, 0, 1, 100, 96, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.marble.medium", true, GregTech_API.sBlockStones, 0, 0, 1, 200, 144, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.marble.large", true, GregTech_API.sBlockStones, 0, 0, 1, 300, 192, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.marble.huge", true, GregTech_API.sBlockStones, 0, 0, 1, 400, 240, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.basalt.tiny", true, GregTech_API.sBlockStones, 8, 0, 1, 50, 48, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.basalt.small", true, GregTech_API.sBlockStones, 8, 0, 1, 100, 96, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.basalt.medium", true, GregTech_API.sBlockStones, 8, 0, 1, 200, 144, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.basalt.large", true, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false); - new GT_Worldgen_Stone("nether.stone.basalt.huge", true, GregTech_API.sBlockStones, 8, 0, 1, 400, 240, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.tiny", false, GregTech_API.sBlockStones, 0, 0, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.small", false, GregTech_API.sBlockStones, 0, 0, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.medium", false, GregTech_API.sBlockStones, 0, 0, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.large", false, GregTech_API.sBlockStones, 0, 0, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.huge", false, GregTech_API.sBlockStones, 0, 0, 1, 400, 240, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.tiny", false, GregTech_API.sBlockStones, 8, 0, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.small", false, GregTech_API.sBlockStones, 8, 0, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.medium", false, GregTech_API.sBlockStones, 8, 0, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.large", false, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.huge", false, GregTech_API.sBlockStones, 8, 0, 1, 400, 240, 0, 120, null, false); new GT_Worldgen_GT_Ore_SmallPieces("ore.small.copper", true, 60, 120, 32, !tPFAA, true, true, Materials.Copper); new GT_Worldgen_GT_Ore_SmallPieces("ore.small.tin", true, 60, 120, 32, !tPFAA, true, true, Materials.Tin); From b2d63bf1106070241ec4c0c4ec359cb4ced6c3e9 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sat, 1 Oct 2016 21:44:50 +0200 Subject: [PATCH 13/24] line fixes --- .../gregtech/loaders/postload/GT_CraftingRecipeLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java index ad513ecc..215e8014 100644 --- a/src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java @@ -736,10 +736,10 @@ public class GT_CraftingRecipeLoader implements Runnable { GT_ModHandler.removeRecipeByOutput(new ItemStack(Items.sugar)); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 2), new Object[]{"SSS", " m ", 'S', new ItemStack(Items.reeds)}); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sugar, 1), new Object[]{"Sm ", 'S', new ItemStack(Items.reeds)}); -// ItemStack brick = new ItemStack(new ItemStack(Blocks.stone_slab).getItem().setContainerItem(new ItemStack(Blocks.stone_slab).getItem())); -// GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick}); +// ItemStack brick = new ItemStack(new ItemStack(Blocks.stone_slab).getItem().setContainerItem(new ItemStack(Blocks.stone_slab).getItem())); +// GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick}); GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', new ItemStack(Blocks.stone_slab)}); -// GameRegistry.addRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), " C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick); +// GameRegistry.addRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), " C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick); } GT_Log.out.println("GT_Mod: Applying Recipes for Tools"); From 2bb563019413efa97c9905d64723ff4689765bf0 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sat, 1 Oct 2016 23:38:44 +0200 Subject: [PATCH 14/24] Try this to fix Lathe recipes --- .../oreprocessing/ProcessingIngot1.java | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java index 767ad575..26d2ec79 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java @@ -14,7 +14,9 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L), 8); + Object[] Ogem1 = new Object[]{aStack}; + if (aMaterial.mFuelPower > 0) { GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, Ogem1), null, aMaterial.mFuelPower, aMaterial.mFuelType); } @@ -40,28 +42,31 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(4L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(matgM1 * 4L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(5L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(matgM1 * 5L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(matgM1 * 9L, 1L), 96); + GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(matgM1 * 5L, 1L), 16); + } if (!OrePrefixes.block.isIgnored(aMaterial)) { - GT_ModHandler.addCompressionRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L));} + GT_ModHandler.addCompressionRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L)); + } if (!aMaterial.contains(SubTag.NO_WORKING)) { - long matgM1 = aMaterial.getMass(); - GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(matgM1 * 5L, 1L), 16);} - if (!aMaterial.contains(SubTag.NO_SMELTING)) { - GT_Values.RA.addAlloySmelterRecipe(GT_Utility.copyAmount(1L, Ogem1), ItemList.Shape_Mold_Nugget.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 9L), 100, 1); - if ((GT_ModHandler.getSmeltingOutput(aStack, false, null) == null) && (GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 1L) != null) && (!GT_ModHandler.addSmeltingRecipe(aStack, GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L)))) { - GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L), new Object[]{aOreDictName});} - } - ItemStack tStack; - if ((null != (tStack = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L))) && ( - (aMaterial.mBlastFurnaceRequired) || (aMaterial.contains(SubTag.NO_SMELTING)))) { - GT_ModHandler.removeFurnaceSmelting(tStack); - } + if (!aMaterial.contains(SubTag.NO_SMELTING)) { + GT_Values.RA.addAlloySmelterRecipe(GT_Utility.copyAmount(1L, Ogem1), ItemList.Shape_Mold_Nugget.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 9L), 100, 1); + if ((GT_ModHandler.getSmeltingOutput(aStack, false, null) == null) && (GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 1L) != null) && (!GT_ModHandler.addSmeltingRecipe(aStack, GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L)))) { + GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L), new Object[]{aOreDictName}); + } + } + ItemStack tStack; + if ((null != (tStack = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L))) && ( + (aMaterial.mBlastFurnaceRequired) || (aMaterial.contains(SubTag.NO_SMELTING)))) { + GT_ModHandler.removeFurnaceSmelting(tStack); + } - GT_RecipeRegistrator.registerUsagesForMaterials(GT_Utility.copyAmount(1L, Ogem1), OrePrefixes.plate.get(aMaterial).toString(), !BmatNSs1); + GT_RecipeRegistrator.registerUsagesForMaterials(GT_Utility.copyAmount(1L, Ogem1), OrePrefixes.plate.get(aMaterial).toString(), !BmatNSs1); - if (aMaterial == Materials.Mercury) { - System.err.println("Quicksilver Ingots?, Don't tell me there is an Armor made of that highly toxic and very likely to be melting Material!"); + if (aMaterial == Materials.Mercury) { + System.err.println("Quicksilver Ingots?, Don't tell me there is an Armor made of that highly toxic and very likely to be melting Material!"); + } } } } From 26300789bb4214020d2b82a52fb8a50546b80cda Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sun, 2 Oct 2016 02:22:12 +0200 Subject: [PATCH 15/24] Try this to fix Lathe recipes --- .../gregtech/loaders/oreprocessing/ProcessingIngot1.java | 2 +- .../gregtech/loaders/postload/GT_MachineRecipeLoader.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java index 26d2ec79..a53c4f93 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java @@ -12,6 +12,7 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis OrePrefixes.ingot.add(this); } + public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L), 8); @@ -42,7 +43,6 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(4L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(matgM1 * 4L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(5L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(matgM1 * 5L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(matgM1 * 9L, 1L), 96); - GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(matgM1 * 5L, 1L), 16); } diff --git a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java index d05ccf62..74553fc9 100644 --- a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java @@ -1135,7 +1135,7 @@ public class GT_MachineRecipeLoader implements Runnable { GT_Values.RA.addCutterRecipe(GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 6), ItemList.Plank_Maple.get(2L, new Object[0]), GT_Values.NI, 50, 8); GT_Values.RA.addCutterRecipe(GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 7), ItemList.Plank_Citrus.get(2L, new Object[0]), GT_Values.NI, 50, 8); - GT_Values.RA.addLatheRecipe(new ItemStack(Blocks.wooden_slab, 1, GT_Values.W), new ItemStack(Items.bowl,1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1), 50, 8); + GT_Values.RA.addLatheRecipe(new ItemStack(Blocks.wooden_slab, 1, GT_Values.W), new ItemStack(Items.bowl, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1), 50, 8); GT_Values.RA.addLatheRecipe(GT_ModHandler.getModItem(aTextForestry, "slabs", 1L, GT_Values.W), new ItemStack(Items.bowl,1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1), 50, 8); GT_Values.RA.addLatheRecipe(GT_ModHandler.getModItem(aTextEBXL, "woodslab", 1L, GT_Values.W), new ItemStack(Items.bowl,1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1), 50, 8); @@ -2175,4 +2175,7 @@ public class GT_MachineRecipeLoader implements Runnable { ItemList.Field_Generator_UV.get(1, new Object[]{}), 1800, 122880); } + public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 2L), (int) Math.max(aMaterial.getMass() * 5L, 1L), 16); + } } From e6c25e86ea4666a5e958eaf66a956d103dec409f Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sun, 2 Oct 2016 10:53:35 +0200 Subject: [PATCH 16/24] Revert "Try this to fix Lathe recipes" This reverts commit 26300789bb4214020d2b82a52fb8a50546b80cda. --- .../gregtech/loaders/oreprocessing/ProcessingIngot1.java | 2 +- .../gregtech/loaders/postload/GT_MachineRecipeLoader.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java index a53c4f93..26d2ec79 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java @@ -12,7 +12,6 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis OrePrefixes.ingot.add(this); } - public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L), 8); @@ -43,6 +42,7 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(4L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(matgM1 * 4L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(5L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(matgM1 * 5L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(matgM1 * 9L, 1L), 96); + GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(matgM1 * 5L, 1L), 16); } diff --git a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java index 74553fc9..d05ccf62 100644 --- a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java @@ -1135,7 +1135,7 @@ public class GT_MachineRecipeLoader implements Runnable { GT_Values.RA.addCutterRecipe(GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 6), ItemList.Plank_Maple.get(2L, new Object[0]), GT_Values.NI, 50, 8); GT_Values.RA.addCutterRecipe(GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 7), ItemList.Plank_Citrus.get(2L, new Object[0]), GT_Values.NI, 50, 8); - GT_Values.RA.addLatheRecipe(new ItemStack(Blocks.wooden_slab, 1, GT_Values.W), new ItemStack(Items.bowl, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1), 50, 8); + GT_Values.RA.addLatheRecipe(new ItemStack(Blocks.wooden_slab, 1, GT_Values.W), new ItemStack(Items.bowl,1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1), 50, 8); GT_Values.RA.addLatheRecipe(GT_ModHandler.getModItem(aTextForestry, "slabs", 1L, GT_Values.W), new ItemStack(Items.bowl,1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1), 50, 8); GT_Values.RA.addLatheRecipe(GT_ModHandler.getModItem(aTextEBXL, "woodslab", 1L, GT_Values.W), new ItemStack(Items.bowl,1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 1), 50, 8); @@ -2175,7 +2175,4 @@ public class GT_MachineRecipeLoader implements Runnable { ItemList.Field_Generator_UV.get(1, new Object[]{}), 1800, 122880); } - public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 2L), (int) Math.max(aMaterial.getMass() * 5L, 1L), 16); - } } From 8ee5705fb2b7467389fcd24fe3f7dc94712fa68e Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sun, 2 Oct 2016 10:54:07 +0200 Subject: [PATCH 17/24] Revert "Try this to fix Lathe recipes" This reverts commit 2bb563019413efa97c9905d64723ff4689765bf0. --- .../oreprocessing/ProcessingIngot1.java | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java index 26d2ec79..767ad575 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java @@ -14,9 +14,7 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L), 8); - Object[] Ogem1 = new Object[]{aStack}; - if (aMaterial.mFuelPower > 0) { GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, Ogem1), null, aMaterial.mFuelPower, aMaterial.mFuelType); } @@ -42,31 +40,28 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(4L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(matgM1 * 4L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(5L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(matgM1 * 5L, 1L), 96); GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(matgM1 * 9L, 1L), 96); - GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(matgM1 * 5L, 1L), 16); - } if (!OrePrefixes.block.isIgnored(aMaterial)) { - GT_ModHandler.addCompressionRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L)); - } + GT_ModHandler.addCompressionRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L));} if (!aMaterial.contains(SubTag.NO_WORKING)) { - if (!aMaterial.contains(SubTag.NO_SMELTING)) { - GT_Values.RA.addAlloySmelterRecipe(GT_Utility.copyAmount(1L, Ogem1), ItemList.Shape_Mold_Nugget.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 9L), 100, 1); - if ((GT_ModHandler.getSmeltingOutput(aStack, false, null) == null) && (GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 1L) != null) && (!GT_ModHandler.addSmeltingRecipe(aStack, GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L)))) { - GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L), new Object[]{aOreDictName}); - } - } - ItemStack tStack; - if ((null != (tStack = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L))) && ( - (aMaterial.mBlastFurnaceRequired) || (aMaterial.contains(SubTag.NO_SMELTING)))) { - GT_ModHandler.removeFurnaceSmelting(tStack); - } + long matgM1 = aMaterial.getMass(); + GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(matgM1 * 5L, 1L), 16);} + if (!aMaterial.contains(SubTag.NO_SMELTING)) { + GT_Values.RA.addAlloySmelterRecipe(GT_Utility.copyAmount(1L, Ogem1), ItemList.Shape_Mold_Nugget.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 9L), 100, 1); + if ((GT_ModHandler.getSmeltingOutput(aStack, false, null) == null) && (GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 1L) != null) && (!GT_ModHandler.addSmeltingRecipe(aStack, GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L)))) { + GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L), new Object[]{aOreDictName});} + } + ItemStack tStack; + if ((null != (tStack = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L))) && ( + (aMaterial.mBlastFurnaceRequired) || (aMaterial.contains(SubTag.NO_SMELTING)))) { + GT_ModHandler.removeFurnaceSmelting(tStack); + } - GT_RecipeRegistrator.registerUsagesForMaterials(GT_Utility.copyAmount(1L, Ogem1), OrePrefixes.plate.get(aMaterial).toString(), !BmatNSs1); + GT_RecipeRegistrator.registerUsagesForMaterials(GT_Utility.copyAmount(1L, Ogem1), OrePrefixes.plate.get(aMaterial).toString(), !BmatNSs1); - if (aMaterial == Materials.Mercury) { - System.err.println("Quicksilver Ingots?, Don't tell me there is an Armor made of that highly toxic and very likely to be melting Material!"); - } + if (aMaterial == Materials.Mercury) { + System.err.println("Quicksilver Ingots?, Don't tell me there is an Armor made of that highly toxic and very likely to be melting Material!"); } } } From 32fdda2a187205fd0eafc8a308664a1e051b3058 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sun, 2 Oct 2016 11:38:18 +0200 Subject: [PATCH 18/24] Rods out of Sticks works again --- .../java/gregtech/loaders/oreprocessing/ProcessingIngot1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java index 767ad575..65a7995c 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java @@ -13,7 +13,7 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis } public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L), 8); + //GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L), 8); Object[] Ogem1 = new Object[]{aStack}; if (aMaterial.mFuelPower > 0) { GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, Ogem1), null, aMaterial.mFuelPower, aMaterial.mFuelType); From 601264e4bf58e0b103e307c289734ecbdbf2daab Mon Sep 17 00:00:00 2001 From: Muramasa- Date: Mon, 26 Sep 2016 14:03:20 +0100 Subject: [PATCH 19/24] Possible fix for scanner TE error --- .../tileentities/machines/basic/GT_MetaTileEntity_Scanner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 13c7ad2b..1d8fa47f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -226,7 +226,7 @@ public class GT_MetaTileEntity_Scanner @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime >= (mMaxProgresstime - 1)) { - if (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")) { + if ((this.mOutputItems[0] != null) && (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); } } From c9c8184ae003464057ab2c3667113fbd696e3e49 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sun, 2 Oct 2016 12:45:54 +0200 Subject: [PATCH 20/24] remove code --- .../java/gregtech/loaders/oreprocessing/ProcessingIngot1.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java index 65a7995c..46323269 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java @@ -13,7 +13,6 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis } public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - //GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L), 8); Object[] Ogem1 = new Object[]{aStack}; if (aMaterial.mFuelPower > 0) { GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, Ogem1), null, aMaterial.mFuelPower, aMaterial.mFuelType); From 8261ada817655e113b09dda15637ac52f215439d Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 27 Sep 2016 20:31:04 +0200 Subject: [PATCH 21/24] Teleport1 --- .../java/gregtech/api/util/GT_Utility.java | 49 ++++++++++--------- .../basic/GT_MetaTileEntity_Teleporter.java | 31 +++++++----- 2 files changed, 45 insertions(+), 35 deletions(-) diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index a7a79141..40f50824 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -819,7 +819,7 @@ public class GT_Utility { return copyMetaData(Items.feather.getDamage(aStack) + 1, aStack); return null; } - + public static synchronized boolean removeIC2BottleRecipe(ItemStack aContainer, ItemStack aInput, Map aRecipeList, ItemStack aOutput){ if ((isStackInvalid(aInput) && isStackInvalid(aOutput) && isStackInvalid(aContainer)) || aRecipeList == null) return false; boolean rReturn = false; @@ -1464,6 +1464,7 @@ public class GT_Utility { if (tTargetWorld != null && tOriginalWorld != null && tTargetWorld != tOriginalWorld) { if (aEntity.ridingEntity != null) aEntity.mountEntity(null); if (aEntity.riddenByEntity != null) aEntity.riddenByEntity.mountEntity(null); + if (aEntity instanceof EntityPlayerMP) { EntityPlayerMP aPlayer = (EntityPlayerMP) aEntity; // aPlayer.dimension = aDimension; @@ -1482,9 +1483,9 @@ public class GT_Utility { // aPlayer.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(aPlayer.getEntityId(), potioneffect)); // } // FMLCommonHandler.instance().firePlayerChangedDimensionEvent(aPlayer, tOriginalWorld.provider.dimensionId, aDimension); - aPlayer.travelToDimension(aDimension); + aPlayer.travelToDimension(aDimension); aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch); - + } else { aEntity.setPosition(aX + 0.5, aY + 0.5, aZ + 0.5); aEntity.worldObj.removeEntity(aEntity); @@ -1519,7 +1520,7 @@ public class GT_Utility { public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ) { - + Random tRandom = new Random((aWorld.getSeed() + (aX / 96) + (7 * (aZ / 96)))); int oil = tRandom.nextInt(3); double amount = tRandom.nextInt(50) + tRandom.nextDouble(); @@ -1546,17 +1547,17 @@ public class GT_Utility { int tAmount = (int) (Math.pow(amount, 5) / 100); ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); int[] tInts = new int[2]; - if(GT_Proxy.chunkData.containsKey(tPos)){ - tInts = GT_Proxy.chunkData.get(tPos); - if(tInts.length>0){ - if(tInts[0]>=0){tAmount = tInts[0];} - } - GT_Proxy.chunkData.remove(tPos); - } - tAmount = tAmount - 5; - tInts[0] = tAmount; - GT_Proxy.chunkData.put(tPos, tInts); - + if(GT_Proxy.chunkData.containsKey(tPos)){ + tInts = GT_Proxy.chunkData.get(tPos); + if(tInts.length>0){ + if(tInts[0]>=0){tAmount = tInts[0];} + } + GT_Proxy.chunkData.remove(tPos); + } + tAmount = tAmount - 5; + tInts[0] = tAmount; + GT_Proxy.chunkData.put(tPos, tInts); + return new FluidStack(tFluid, tAmount); } @@ -1753,15 +1754,15 @@ public class GT_Utility { tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName()); } // if(aPlayer.capabilities.isCreativeMode){ - ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); - if(GT_Proxy.chunkData.containsKey(tPos)){ - int[] tPollution = GT_Proxy.chunkData.get(tPos); - if(tPollution.length>1){ - tList.add("Pollution in Chunk: "+tPollution[1]); - }else{ - tList.add("No Pollution in Chunk"); - } - } + ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); + if(GT_Proxy.chunkData.containsKey(tPos)){ + int[] tPollution = GT_Proxy.chunkData.get(tPos); + if(tPollution.length>1){ + tList.add("Pollution in Chunk: "+tPollution[1]); + }else{ + tList.add("No Pollution in Chunk"); + } + } // } try { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index c989cd33..e9233026 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -9,6 +9,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Teleporter; @@ -22,11 +23,13 @@ import net.minecraft.entity.boss.EntityDragonPart; import net.minecraft.entity.effect.EntityWeatherEffect; import net.minecraft.entity.item.*; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -161,7 +164,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { public boolean isGivingInformation() { return true; } - + public String[] getInfoData() { return new String[]{ @@ -246,7 +249,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) { if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)) { - if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) { + if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))&& new XSTR().nextInt(10)==0) { mFluid.amount--; if (mFluid.amount < 1) { mFluid = null; @@ -267,7 +270,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { int tStacksize = mInventory[0].stackSize; GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)tDistance * tDistance * ((long)tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)), false); + getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(tDistance, 1.5) * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)), false); } } @@ -275,9 +278,10 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) { if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) { Entity tEntity = (Entity) tObject; - if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)(tDistance * tDistance * weightCalculation(tEntity)), false)) { + //System.out.println("teleport"+(Math.pow(tDistance, 1.5))); + if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(tDistance, 1.5) * weightCalculation(tEntity), false)) { if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) { - mFluid.amount = mFluid.amount - (GT_Utility.safeInt(Math.min(1000L, (long)(tDistance * tDistance * weightCalculation(tEntity) / 8192)))); + mFluid.amount = mFluid.amount - GT_Utility.safeInt(Math.min(1000L, (long)Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192)); if (mFluid.amount < 1) { mFluid = null; } @@ -289,11 +293,16 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { tEntity.riddenByEntity.mountEntity(null); } if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) { - if ((tEntity instanceof EntityLivingBase)) { - ((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); - } else { - tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); - } +// System.out.println("tele"); +//// System.out.println("tdim: "+mTargetD+" proDim: "+getBaseMetaTileEntity().getWorld().provider.dimensionId); +// if ((tEntity instanceof EntityLivingBase)) { +// if(this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId){ +// System.out.println("move dim"); +// GT_Utility.moveEntityToDimensionAtCoords(tEntity, mTargetD, mTargetX, mTargetY, mTargetZ); +// }else{((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);} +// } else { +// tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); +// } } } } @@ -307,7 +316,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { } private int distanceCalculation() { - return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); + return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 4000 : (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)))); } @Override From c09ebb9e9b20755fcdef5782146fbde1cb4fc4ff Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 28 Sep 2016 14:05:10 +0200 Subject: [PATCH 22/24] Teleport2 and readd null checks on tools --- .../basic/GT_MetaTileEntity_Teleporter.java | 15 +++++---------- .../java/gregtech/common/tools/GT_Tool_File.java | 2 +- .../gregtech/common/tools/GT_Tool_Plunger.java | 2 +- .../gregtech/common/tools/GT_Tool_SoftHammer.java | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index e9233026..fe9d6d78 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -293,16 +293,11 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { tEntity.riddenByEntity.mountEntity(null); } if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) { -// System.out.println("tele"); -//// System.out.println("tdim: "+mTargetD+" proDim: "+getBaseMetaTileEntity().getWorld().provider.dimensionId); -// if ((tEntity instanceof EntityLivingBase)) { -// if(this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId){ -// System.out.println("move dim"); -// GT_Utility.moveEntityToDimensionAtCoords(tEntity, mTargetD, mTargetX, mTargetY, mTargetZ); -// }else{((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);} -// } else { -// tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); -// } + if ((tEntity instanceof EntityLivingBase)) { + ((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + } else { + tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + } } } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_File.java b/src/main/java/gregtech/common/tools/GT_Tool_File.java index 250edbe5..19975f12 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_File.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_File.java @@ -75,7 +75,7 @@ public class GT_Tool_File public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("file")); + return ((tTool != null) && tTool.equals("file")); } public ItemStack getBrokenItem(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java index fc4e6090..3fef69d7 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java @@ -43,7 +43,7 @@ public class GT_Tool_Plunger public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("plunger")); + return ((tTool != null) && tTool.equals("plunger")); } public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java index 0b77a45e..ecbb4381 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java @@ -84,7 +84,7 @@ public class GT_Tool_SoftHammer public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("softhammer")); + return ((tTool != null) && tTool.equals("softhammer")); } public ItemStack getBrokenItem(ItemStack aStack) { From b5ee460067cf585a8b22af5508b45b021a80d713 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 13:23:09 +0200 Subject: [PATCH 23/24] Teleporter3 --- .../machines/basic/GT_MetaTileEntity_Teleporter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index fe9d6d78..307d3542 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -23,13 +23,13 @@ import net.minecraft.entity.boss.EntityDragonPart; import net.minecraft.entity.effect.EntityWeatherEffect; import net.minecraft.entity.item.*; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; +//import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.entity.projectile.EntityThrowable; -import net.minecraft.init.Blocks; +//import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -270,7 +270,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { int tStacksize = mInventory[0].stackSize; GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(tDistance, 1.5) * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)), false); + getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) (Math.pow(tDistance, 1.5)) * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)), false); } } @@ -279,9 +279,9 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) { Entity tEntity = (Entity) tObject; //System.out.println("teleport"+(Math.pow(tDistance, 1.5))); - if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(tDistance, 1.5) * weightCalculation(tEntity), false)) { + if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(tDistance, 1.5) * (long)weightCalculation(tEntity), false)) { if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) { - mFluid.amount = mFluid.amount - GT_Utility.safeInt(Math.min(1000L, (long)Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192)); + mFluid.amount = mFluid.amount - GT_Utility.safeInt((long)Math.min(1000L, (long)Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192)); if (mFluid.amount < 1) { mFluid = null; } From 86a53b05a83cbfb5b3b940d3d93f00b76f638f93 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 13:36:34 +0200 Subject: [PATCH 24/24] remove oregen spam --- src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index 14e77ac7..a8cbcb33 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -96,7 +96,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { return false; } - System.out.println(tOreBlock); + //System.out.println(tOreBlock); aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData), 0); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) {