From 691767326453c14bd0e596399658bd0f3f708e88 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Wed, 17 Aug 2016 06:09:55 +0100 Subject: Initial Fixed Materials limitation Added ability to add Materials via a config Added ability to change all properties of a Material via a config --- .../common/blocks/GT_Block_Ores_Abstract.java | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') 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 17351475b2..82ef4f4fec 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 @@ -90,28 +90,28 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } public String getLocalizedName(Materials aMaterial) { - switch (aMaterial) { - case InfusedAir: - case InfusedDull: - case InfusedEarth: - case InfusedEntropy: - case InfusedFire: - case InfusedOrder: - case InfusedVis: - case InfusedWater: + switch (aMaterial.mName) { + case "InfusedAir": + case "InfusedDull": + case "InfusedEarth": + case "InfusedEntropy": + case "InfusedFire": + case "InfusedOrder": + case "InfusedVis": + case "InfusedWater": return aMaterial.mDefaultLocalName + " Infused Stone"; - case Vermiculite: - case Bentonite: - case Kaolinite: - case Talc: - case BasalticMineralSand: - case GraniticMineralSand: - case GlauconiteSand: - case CassiteriteSand: - case GarnetSand: - case QuartzSand: - case Pitchblende: - case FullersEarth: + case "Vermiculite": + case "Bentonite": + case "Kaolinite": + case "Talc": + case "BasalticMineralSand": + case "GraniticMineralSand": + case "GlauconiteSand": + case "CassiteriteSand": + case "GarnetSand": + case "QuartzSand": + case "Pitchblende": + case "FullersEarth": return aMaterial.mDefaultLocalName; default: return aMaterial.mDefaultLocalName + OrePrefixes.ore.mLocalizedMaterialPost; -- cgit From 46daf120bb00b03a4889863466a74b00e15468d8 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Fri, 19 Aug 2016 12:15:05 +0100 Subject: initMaterialProperties --- src/main/java/gregtech/common/blocks/GT_Block_Ores.java | 2 +- src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java | 4 ++-- src/main/java/gregtech/common/blocks/GT_Block_Ores_GC.java | 2 +- src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java | 2 +- src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java | 2 +- src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') 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 66e2f76d05..d852aebdcb 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", 7, false, Material.rock); + super("gt.blockores", 7, Material.rock); } @Override 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 82ef4f4fec..b1cba7aa7e 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 @@ -38,7 +38,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public static boolean tHideOres; public static int tOreMetaCount; - protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) { + protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, Material aMaterial) { super(GT_Item_Ores.class, aUnlocalizedName, aMaterial); this.isBlockContainer = true; setStepSound(soundTypeStone); @@ -58,7 +58,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements 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) { - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, (j == 0 && aHideFirstMeta) ? i : i + (j * 1000))); + if (!aUnlocalizedName.equals("gt.blockores") && !(i + (j * 1000) < 1000)) 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))); } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_GC.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_GC.java index 23061baada..eddbbda9d0 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_GC.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_GC.java @@ -15,7 +15,7 @@ public class GT_Block_Ores_GC extends GT_Block_Ores_Abstract { Block aMarsBlock = GameRegistry.findBlock("GalacticraftMars", "tile.mars"); public GT_Block_Ores_GC() { - super("gt.blockores.gc", 4, true, Material.rock); + super("gt.blockores.gc", 4, Material.rock); if (aMoonBlock == null) aMoonBlock = Blocks.stone; if (aMarsBlock == null) aMarsBlock = Blocks.stone; } 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 ac17e65b93..f1089a52bb 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 @@ -14,7 +14,7 @@ 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", 8, true, Material.rock); + super("gt.blockores.ub1", 8, Material.rock); if (aUBBlock == null) aUBBlock = Blocks.stone; } 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 e4caa95db7..5306b964cb 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 @@ -14,7 +14,7 @@ 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", 8, true, Material.rock); + super("gt.blockores.ub2", 8, Material.rock); if (aUBBlock == null) aUBBlock = Blocks.stone; } 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 4cf76dfb1d..6867de10dd 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 @@ -14,7 +14,7 @@ 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", 8, true, Material.rock); + super("gt.blockores.ub3", 8, Material.rock); if (aUBBlock == null) aUBBlock = Blocks.stone; } -- cgit From c0f1fce8597a1fddab378c0e090b153b70cdc895 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Thu, 29 Sep 2016 07:36:45 +0100 Subject: Small fixes & Stop storage blocks and fluids for disabled materials --- src/main/java/gregtech/common/blocks/GT_Block_Metal.java | 15 +++++++++------ .../java/gregtech/common/blocks/GT_Block_Storage.java | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java index 58e1996b9b..56c920c6d1 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java @@ -5,7 +5,6 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IIconContainer; import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; @@ -15,18 +14,23 @@ public class GT_Block_Metal extends GT_Block_Storage { public Materials[] mMats; public OrePrefixes mPrefix; public IIconContainer[] mBlockIcons; + public boolean mHideBlocks; public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) { super(GT_Item_Storage.class, aName, Material.iron); mMats = aMats; mPrefix = aPrefix; mBlockIcons = aBlockIcons; + mHideBlocks = Loader.isModLoaded("NotEnoughItems"); + for (int i = 0; i < aMats.length; i++) { - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + aMats[i].mDefaultLocalName); - GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i)); + if (aMats[i].mMetaItemSubID > 0) { + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + aMats[i].mDefaultLocalName); + GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i)); + } } - if(aMats.length<16 && Loader.isModLoaded("NotEnoughItems")){ - for( int i = aMats.length;i<16;i++)codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); + if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) { + for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); } } @@ -36,5 +40,4 @@ public class GT_Block_Metal extends GT_Block_Storage { } return null; } - } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Storage.java b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java index e2272a6503..768fed6619 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java @@ -95,7 +95,7 @@ public class GT_Block_Storage extends GT_Generic_Block { @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { for (int i = 0; i < 16; i++) { - aList.add(new ItemStack(aItem, 1, i)); + if (!(new ItemStack(aItem, 1, i).getDisplayName().contains(".name"))) aList.add(new ItemStack(aItem, 1, i)); } } } -- cgit From 173700a611a36a0f0b30c2a0e2b72ebd739e158a Mon Sep 17 00:00:00 2001 From: Muramasa Date: Tue, 4 Oct 2016 04:12:40 +0100 Subject: Computronics support & Improved mod dependant Materials --- src/main/java/gregtech/common/blocks/GT_Block_Metal.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java index 56c920c6d1..2f54c9c415 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java @@ -24,7 +24,7 @@ public class GT_Block_Metal extends GT_Block_Storage { mHideBlocks = Loader.isModLoaded("NotEnoughItems"); for (int i = 0; i < aMats.length; i++) { - if (aMats[i].mMetaItemSubID > 0) { + if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + aMats[i].mDefaultLocalName); GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i)); } -- cgit From ce632479bc53e16fcfcb780e509f4ac463c76bc8 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Thu, 13 Oct 2016 18:52:21 +0100 Subject: Hide some unused blocks in NEI --- .../java/gregtech/common/blocks/GT_Block_Casings_Abstract.java | 3 ++- src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java index 6f9c7cf411..8b03a10b29 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java @@ -115,7 +115,8 @@ public abstract class GT_Block_Casings_Abstract @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { for (int i = 0; i < 16; i++) { - aList.add(new ItemStack(aItem, 1, i)); + ItemStack aStack = new ItemStack(aItem, 1, i); + if (!aStack.getDisplayName().contains(".name")) aList.add(aStack); } } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 99c16b1db9..558505356f 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -13,8 +13,9 @@ import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import ic2.core.block.EntityIC2Explosive; +import ic2.core.block.EntityItnt; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; @@ -30,9 +31,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import ic2.core.IC2; -import ic2.core.block.EntityIC2Explosive; -import ic2.core.block.EntityItnt; import java.util.List; import java.util.Random; @@ -278,7 +276,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { for (int i = 0; i < 16; i++) { - aList.add(new ItemStack(aItem, 1, i)); + ItemStack aStack = new ItemStack(aItem, 1, i); + if (!aStack.getDisplayName().contains(".name")) aList.add(aStack); } } } -- cgit From fa79dcd2635a317972ca0a8400cf8820c40e72de Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Sun, 16 Oct 2016 18:08:26 +0200 Subject: Base IC2 Classic compat. Reactor components disabled, some recipes likely missing/broken --- .../common/blocks/GT_Block_Reinforced.java | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 558505356f..a2d46f3922 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -21,6 +21,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -209,11 +210,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) { if(world.getBlockMetadata(x, y, z)==5){ - EntityIC2Explosive entitytntprimed = getExplosionEntity(world, x, y, z, player == null ? null : player); - if (entitytntprimed == null) { - return false; - } - + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x, y, z, player == null ? null : player); world.spawnEntityInWorld(entitytntprimed); world.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F); @@ -223,15 +220,6 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return super.removedByPlayer(world, player, x, y, z); } - public EntityIC2Explosive getExplosionEntity(World world, int x, int y, int z, EntityLivingBase igniter) - { - EntityIC2Explosive ret; - ret = new EntityItnt(world, x + 0.5D, y + 0.5D, z + 0.5D); - ret.setIgniter(igniter); - - return ret; - } - public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); @@ -249,10 +237,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) { - EntityIC2Explosive entitytntprimed = getExplosionEntity(world, x, y, z, explosion == null ? null : explosion.getExplosivePlacedBy()); - if (entitytntprimed == null) { - return; - } + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x, y, z, explosion.getExplosivePlacedBy()); entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8); world.spawnEntityInWorld(entitytntprimed); } @@ -261,7 +246,6 @@ public class GT_Block_Reinforced extends GT_Generic_Block { { if ((player.getCurrentEquippedItem() != null) && (player.getCurrentEquippedItem().getItem() == Items.flint_and_steel)&&par1World.getBlockMetadata(x, y, z)==5) { -// par1World.setBlockMetadataWithNotify(x, y, z, 6, 7); removedByPlayer(par1World, player, x, y, z); return true; -- cgit From a70ce1a67b0b196fcfefadcb65dfa2e8f514e2cf Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 19 Oct 2016 13:37:36 +0200 Subject: Cleanup recipe classes --- .../common/blocks/GT_Block_Stones_Abstract.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java index 5a5e49b5aa..a681e7139f 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java @@ -50,20 +50,20 @@ public class GT_Block_Stones_Abstract GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 15), new ItemStack(this, 1, 8)); GT_Values.RA.addAssemblerRecipe(new ItemStack(this, 1, 0), ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), new ItemStack(this, 1, 3), 50, 4); GT_Values.RA.addAssemblerRecipe(new ItemStack(this, 1, 8), ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), new ItemStack(this, 1, 11), 50, 4); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", Character.valueOf('X'), new ItemStack(this, 1, 7)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 14), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", Character.valueOf('X'), new ItemStack(this, 1, 15)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", Character.valueOf('X'), new ItemStack(this, 1, 3)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 12), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", Character.valueOf('X'), new ItemStack(this, 1, 11)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", Character.valueOf('X'), new ItemStack(this, 1, 0)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 9), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", Character.valueOf('X'), new ItemStack(this, 1, 8)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", 'X', new ItemStack(this, 1, 7)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 14), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", 'X', new ItemStack(this, 1, 15)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 3)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 12), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 11)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 0)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 9), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 8)}); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 3), new ItemStack(this, 1, 4), 16, 10); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 11), new ItemStack(this, 1, 12), 16, 10); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 1), 16, 10); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 8), new ItemStack(this, 1, 9), 16, 10); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", Character.valueOf('X'), new ItemStack(this, 4, 0)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", Character.valueOf('X'), new ItemStack(this, 4, 8)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", Character.valueOf('X'), new ItemStack(this, 4, 7)}); - GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", Character.valueOf('X'), new ItemStack(this, 4, 15)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 0)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 8)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 7)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 15)}); } public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { -- cgit From 187a49f43c3523eb3ab17dced052722825681d4a Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 19 Oct 2016 22:27:27 +0200 Subject: Some Block fixes --- .../common/blocks/GT_Block_Reinforced.java | 8 ++++++- .../common/blocks/GT_Block_Stones_Abstract.java | 27 +++++++++++----------- 2 files changed, 21 insertions(+), 14 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index a2d46f3922..fa5e8162eb 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -21,6 +21,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -237,9 +238,10 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) { + if(world.getBlockMetadata(x, y, z)==5){ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x, y, z, explosion.getExplosivePlacedBy()); entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8); - world.spawnEntityInWorld(entitytntprimed); + world.spawnEntityInWorld(entitytntprimed);} } public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset) @@ -264,4 +266,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { if (!aStack.getDisplayName().contains(".name")) aList.add(aStack); } } + + public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { + return !(entity instanceof EntityWither); + } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java index a681e7139f..064f684168 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java @@ -72,43 +72,43 @@ public class GT_Block_Stones_Abstract GT_Values.RA.addLaserEngraverRecipe(new ItemStack(this, 1, 15), GT_Utility.copyAmount(0L, new Object[]{aStack}), new ItemStack(this, 1, 14), 50, 16); } } - + @Override public String getHarvestTool(int aMeta) { return "pickaxe"; } - + @Override public int getHarvestLevel(int aMeta) { return 1; } - + @Override public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { return this.blockHardness = Blocks.stone.getBlockHardness(aWorld, aX, aY, aZ) * 3.0F; } - + @Override public String getUnlocalizedName() { return this.mUnlocalizedName; } - + @Override public String getLocalizedName() { return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); } - + @Override public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { return false; } - + @Override public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { return true; } - + @Override public boolean renderAsNormalBlock() { return true; } - + @Override public boolean isOpaqueCube() { return true; } - + @Override public IIcon getIcon(int aSide, int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { return gregtech.api.enums.Textures.BlockIcons.GRANITES[aMeta].getIcon(); @@ -116,18 +116,19 @@ public class GT_Block_Stones_Abstract return null; } + @Override public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { return world.getBlockMetadata(x, y, z) % 8 < 3; } - + @Override public int damageDropped(int par1) { return par1 % 8 == 0 ? par1 + 1 : par1; } - + @Override public int getDamageValue(World par1World, int par2, int par3, int par4) { return par1World.getBlockMetadata(par2, par3, par4); } - + @Override public int quantityDropped(Random par1Random) { return 1; } -- cgit From 49ff6ffa31ce3f63fe878c683ef29f02b031b815 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Fri, 21 Oct 2016 20:12:23 +0200 Subject: Wrench shift click can move machine front direction --- src/main/java/gregtech/common/blocks/GT_Block_Machines.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index d9c05fd17a..3d8a814260 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -259,7 +259,7 @@ public class GT_Block_Machines if(aPlayer.isSneaking()){ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if(tCurrentItem!=null){ - if(!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)){ + if(!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)){ return false; } }else {return false;} -- cgit From 2d5c40ef8f77287547f437fdcf493f5040494414 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 26 Oct 2016 00:57:33 +0200 Subject: some bugfixes --- src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index fa5e8162eb..f73fba773e 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -238,7 +238,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) { - if(world.getBlockMetadata(x, y, z)==5){ + if(!world.isRemote && world.getBlockMetadata(x, y, z)==5){ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x, y, z, explosion.getExplosivePlacedBy()); entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8); world.spawnEntityInWorld(entitytntprimed);} -- cgit From 11130dd43526139c26673f3f13a7d699d9dfdf70 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 26 Oct 2016 21:57:20 +0200 Subject: More Translation stuff. Hope it does not lag. --- src/main/java/gregtech/common/blocks/GT_Item_Machines.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index 281176542f..4014b01f39 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -45,8 +45,14 @@ public class GT_Item_Machines int i = 0; for (String tDescription : tTileEntity.getDescription()) { if (GT_Utility.isStringValid(tDescription)) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished )); - } + if(tDescription.contains("%%%")){ + String[] tString = tDescription.split("%%%"); + if(tString.length>=2){ + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tString[0], !GregTech_API.sPostloadFinished )+" "+tString[1]); + } + }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished ); + aList.add(tTranslated.equals("") ? tDescription : tTranslated);} + }else i++; } } if (tTileEntity.getEUCapacity() > 0L) { -- cgit From d51f43f97bfdda3bf7b024d141225e249cdc36bf Mon Sep 17 00:00:00 2001 From: Dimach Date: Mon, 28 Nov 2016 22:13:06 +0200 Subject: Ore harvest level rework. Fixed #730. --- src/main/java/gregtech/common/blocks/GT_Block_Ores.java | 14 ++++++++++++++ .../gregtech/common/blocks/GT_Block_Ores_Abstract.java | 4 ++++ .../java/gregtech/common/blocks/GT_Block_Ores_UB1.java | 5 +++++ .../java/gregtech/common/blocks/GT_Block_Ores_UB2.java | 5 +++++ .../java/gregtech/common/blocks/GT_Block_Ores_UB3.java | 5 +++++ src/main/java/gregtech/common/blocks/GT_Item_Ores.java | 2 +- .../java/gregtech/common/blocks/GT_TileEntity_Ores.java | 12 ++++++------ 7 files changed, 40 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') 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 66e2f76d05..c754e79bd8 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java @@ -26,6 +26,20 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.oreNetherrack, OrePrefixes.oreEndstone, OrePrefixes.oreBlackgranite, OrePrefixes.oreRedgranite, OrePrefixes.oreMarble, OrePrefixes.oreBasalt, null}; } + @Override + public int getBaseBlockHarvestLevel(int aMeta) { + switch (aMeta) { + case 3: + case 4:return 3; + case 0: + case 1: + case 2: + case 5: + case 6: + default:return 0; + } + } + @Override public Block getDroppedBlock() { return GregTech_API.sBlockOres1; 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 e554777be2..4b61da0f3f 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 @@ -70,6 +70,10 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } } + public int getBaseBlockHarvestLevel(int aMeta) { + return 0; + } + public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) { if (!FUCKING_LOCK) { FUCKING_LOCK = true; 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 ac17e65b93..52c5710ae9 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 @@ -28,6 +28,11 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { return new OrePrefixes[]{OrePrefixes.oreRedgranite, OrePrefixes.oreBlackgranite, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreBasalt, OrePrefixes.ore, OrePrefixes.ore}; } + @Override + public int getBaseBlockHarvestLevel(int aMeta) { + return aUBBlock.getHarvestLevel(aMeta); + } + @Override public Block getDroppedBlock() { return GregTech_API.sBlockOresUb1; 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 e4caa95db7..78526c84c5 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 @@ -28,6 +28,11 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreMarble, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore}; } + @Override + public int getBaseBlockHarvestLevel(int aMeta) { + return aUBBlock.getHarvestLevel(aMeta); + } + @Override public Block getDroppedBlock() { return GregTech_API.sBlockOresUb2; 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 4cf76dfb1d..7866264738 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 @@ -28,6 +28,11 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore}; } + @Override + public int getBaseBlockHarvestLevel(int aMeta) { + return aUBBlock.getHarvestLevel(aMeta); + } + @Override public Block getDroppedBlock() { return GregTech_API.sBlockOresUb3; diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java index 68b0518096..399c5d6bdd 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java @@ -27,7 +27,7 @@ public class GT_Item_Ores public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) getDamage(aStack); if (tDamage > 0) { - if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, GT_TileEntity_Ores.getHarvestData(tDamage), 3)) { + if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, GT_TileEntity_Ores.getHarvestData(tDamage, ((GT_Block_Ores_Abstract) field_150939_a).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), 3)) { return false; } GT_TileEntity_Ores tTileEntity = (GT_TileEntity_Ores) aWorld.getTileEntity(aX, aY, aZ); 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 c7dd416e5e..baae25274d 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -28,11 +28,11 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit public boolean mNatural = false; public boolean mBlocked = true; - public static byte getHarvestData(short aMetaData) { + public static byte getHarvestData(short aMetaData, int aBaseBlockHarvestLevel) { Materials aMaterial = GregTech_API.sGeneratedMaterials[(aMetaData % 1000)]; - byte tByte = aMaterial == null ? 0 : (byte) Math.max((aMetaData % 16000 / 1000 == 3) || (aMetaData % 16000 / 1000 == 4) ? 3 : 0, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1))); + byte tByte = aMaterial == null ? 0 : (byte) Math.max(aBaseBlockHarvestLevel, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1))); if(GT_Mod.gregtechproxy.mChangeHarvestLevels ){ - tByte = aMaterial == null ? 0 : (byte) Math.max((aMetaData % 16000 / 1000 == 3) || (aMetaData % 16000 / 1000 == 4) ? GT_Mod.gregtechproxy.mGraniteHavestLevel : 0, Math.min(GT_Mod.gregtechproxy.mMaxHarvestLevel, GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] - (aMetaData < 16000 ? 0 : 1))); + tByte = aMaterial == null ? 0 : (byte) Math.max(aBaseBlockHarvestLevel, Math.min(GT_Mod.gregtechproxy.mMaxHarvestLevel, GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] - (aMetaData < 16000 ? 0 : 1))); } return tByte; } @@ -107,7 +107,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { return false; } - aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData), 0); + aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData, ((GT_Block_Ores_Abstract) tOreBlock).getBaseBlockHarvestLevel(aMetaData % 16000 / 1000)), 0); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { ((GT_TileEntity_Ores) tTileEntity).mMetaData = ((short) aMetaData); @@ -173,7 +173,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit this.mMetaData = ((short) (this.mMetaData + 5000)); } } - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0); + this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData, ((GT_Block_Ores_Abstract) blockType).getBaseBlockHarvestLevel(mMetaData % 16000 / 1000)), 0); } public void convertOreBlock(World aWorld, int aX, int aY, int aZ) { @@ -182,7 +182,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof GT_TileEntity_Ores) { ((GT_TileEntity_Ores) tTileEntity).mMetaData = aMeta; - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(aMeta), 0); + this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(aMeta, ((GT_Block_Ores_Abstract) tTileEntity.blockType).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), 0); } } -- cgit From b6674c9d96775103322820665046a3d1db508e24 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Sat, 11 Feb 2017 01:04:46 +0100 Subject: Finish Cleanroom --- src/main/java/gregtech/common/blocks/GT_Block_Casings3.java | 2 +- src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java index a01e08ddb8..62259cca36 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java @@ -25,7 +25,7 @@ public class GT_Block_Casings3 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Frost Hazard Sign Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Noise Hazard Sign Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Grate Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Vent Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Filter Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Radiation Proof Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Bronze Firebox Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Steel Firebox Casing"); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index f73fba773e..1dc26088ad 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -8,6 +8,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; import gregtech.api.items.GT_Generic_Block; +import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_LanguageManager; @@ -41,6 +42,9 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public GT_Block_Reinforced(String aName) { super(GT_Item_Storage.class, aName, new GT_Material_Reinforced()); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + Textures.BlockIcons.CASING_BLOCKS[(i + 80)] = new GT_CopiedBlockTexture(this, 6, i); + } setStepSound(soundTypeStone); setCreativeTab(GregTech_API.TAB_GREGTECH); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Bronzeplate Reinforced Block"); -- cgit From 5a7e797883be698c59b8702c2a3cda2d41d220b4 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Thu, 23 Mar 2017 20:34:54 +0100 Subject: Reduce Plascrete Mininglevel and hardness/resistance --- src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 1dc26088ad..860760a789 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -57,7 +57,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Magic Solid Super Fuel"); ItemList.Block_BronzePlate.set(new ItemStack(this.setHardness(60.0f).setResistance(150.0f), 1, 0)); ItemList.Block_IridiumTungstensteel.set(new ItemStack(this.setHardness(200.0f).setResistance(600.0f), 1, 1)); - ItemList.Block_Plascrete.set(new ItemStack(this.setHardness(80.0f).setResistance(350.0f), 1, 2)); + ItemList.Block_Plascrete.set(new ItemStack(this.setHardness(40.0f).setResistance(100.0f), 1, 2)); ItemList.Block_TungstenSteelReinforced.set(new ItemStack(this.setHardness(100.0f).setResistance(400.0f), 1, 3)); ItemList.Block_BrittleCharcoal.set(new ItemStack(this.setHardness(0.5f).setResistance(8.0f), 1, 4)); ItemList.Block_Powderbarrel.set(new ItemStack(this.setHardness(2.5f).setResistance(2.0f), 1, 5)); @@ -79,6 +79,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public int getHarvestLevel(int aMeta) { if (aMeta == 4||aMeta == 5 || aMeta == 6 || aMeta == 7) return 1; + if (aMeta == 2) return 2; return 4; } @@ -121,7 +122,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return 200.0F; } if (tMeta == 2) { - return 80.0F; + return 40.0F; } if (tMeta == 3) { return 100.0F; @@ -144,7 +145,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return 600.0F; } if (tMeta == 2) { - return 350.0F; + return 100.0F; } if (tMeta == 3) { return 400.0F; -- cgit From 945a13d4ae4c4f1cd47e481a0f3d3f980e353ae5 Mon Sep 17 00:00:00 2001 From: dohyun22 Date: Fri, 24 Mar 2017 12:24:02 +0900 Subject: Fixed various Bugs on the Powderbarrel. Fixed PrimedTNT Entity being spawned on client side when destroyed by player. Fixed PrimedTNT Entity spawning at misplaced location (about 0.5m from the center of the block). Fixed fuse sound not being played when ignited. Fixed Powderbarrel not being able to spawn PrimedTNT Entity when destroyed by explosion. --- .../gregtech/common/blocks/GT_Block_Reinforced.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 860760a789..40d2d1a5fe 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -215,10 +215,10 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) { - if(world.getBlockMetadata(x, y, z)==5){ - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x, y, z, player == null ? null : player); + if(!world.isRemote && world.getBlockMetadata(x, y, z)==5){ + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, player == null ? null : player); world.spawnEntityInWorld(entitytntprimed); - world.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F); + world.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); world.setBlockToAir(x, y, z); return false; @@ -241,12 +241,13 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } } - public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) - { - if(!world.isRemote && world.getBlockMetadata(x, y, z)==5){ - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x, y, z, explosion.getExplosivePlacedBy()); - entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8); - world.spawnEntityInWorld(entitytntprimed);} + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { + if (!world.isRemote && world.getBlockMetadata(x, y, z)==5){ + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, explosion.getExplosivePlacedBy()); + entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8); + world.spawnEntityInWorld(entitytntprimed); + } + super.onBlockExploded(world, x, y, z, explosion); } public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset) -- cgit From 15db129b1d381045e4eefae8277597cf5a659780 Mon Sep 17 00:00:00 2001 From: dohyun22 Date: Sat, 25 Mar 2017 18:53:21 +0900 Subject: simplified the code. --- src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 40d2d1a5fe..d7a47c0bb6 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -216,7 +216,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) { if(!world.isRemote && world.getBlockMetadata(x, y, z)==5){ - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, player == null ? null : player); + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, player); world.spawnEntityInWorld(entitytntprimed); world.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); -- cgit From d725c463e5d134223fb4daf321d67babb1ca4de4 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Fri, 31 Mar 2017 16:14:36 +0200 Subject: null check to prevent bukkit crash --- src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/gregtech/common/blocks') 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 baae25274d..cd133100db 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -147,6 +147,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) { + if(this.worldObj == null || blockType==null)return; this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L)); if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) { this.mMetaData = ((short) (this.mMetaData + 1000)); -- cgit From f2b8bbdde8c7ebac99e5e6fdb3cc497d39dd575e Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 1 May 2017 10:24:30 +0200 Subject: Optimize imports --- src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index d7a47c0bb6..05caf4cb6a 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -14,13 +14,10 @@ import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; -import ic2.core.block.EntityIC2Explosive; -import ic2.core.block.EntityItnt; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.item.EntityTNTPrimed; -- cgit From 7bc06a39698fc74f8ce33f82e7e1ec2a4b350401 Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Mon, 8 May 2017 00:11:36 +0200 Subject: Implemented checkMachine for the LCR, added machine casings --- src/main/java/gregtech/common/blocks/GT_Block_Casings4.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index 3c3535e4da..da775be69d 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -37,6 +37,8 @@ public class GT_Block_Casings4 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Titanium Turbine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Tungstensteel Turbine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Engine Intake Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Inert Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "PTFE Pipe Casing"); ItemList.Casing_RobustTungstenSteel.set(new ItemStack(this, 1, 0)); ItemList.Casing_CleanStainlessSteel.set(new ItemStack(this, 1, 1)); @@ -50,6 +52,8 @@ public class GT_Block_Casings4 ItemList.Casing_Turbine2.set(new ItemStack(this, 1, 11)); ItemList.Casing_Turbine3.set(new ItemStack(this, 1, 12)); ItemList.Casing_EngineIntake.set(new ItemStack(this, 1, 13)); + ItemList.Casing_Inert.set(new ItemStack(this, 1, 14)); + ItemList.Casing_Pipe_Polytetrafluoroethylene.set(new ItemStack(this, 1, 15)); } public IIcon getIcon(int aSide, int aMeta) { @@ -83,9 +87,9 @@ public class GT_Block_Casings4 case 13: return Textures.BlockIcons.MACHINE_CASING_ENGINE_INTAKE.getIcon(); case 14: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + return Textures.BlockIcons.MACHINE_CASING_INERT.getIcon(); case 15: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + return Textures.BlockIcons.MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE.getIcon(); } return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } -- cgit From 0c2dee56daeb7b94208a581f1dc9f21edbb5e2f6 Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Tue, 9 May 2017 21:51:49 +0200 Subject: Added new textures for the LCM, using them now --- src/main/java/gregtech/common/blocks/GT_Block_Casings4.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index da775be69d..9de9c3d323 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -37,7 +37,7 @@ public class GT_Block_Casings4 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Titanium Turbine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Tungstensteel Turbine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Engine Intake Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Inert Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Chemically Inert Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "PTFE Pipe Casing"); ItemList.Casing_RobustTungstenSteel.set(new ItemStack(this, 1, 0)); @@ -52,7 +52,7 @@ public class GT_Block_Casings4 ItemList.Casing_Turbine2.set(new ItemStack(this, 1, 11)); ItemList.Casing_Turbine3.set(new ItemStack(this, 1, 12)); ItemList.Casing_EngineIntake.set(new ItemStack(this, 1, 13)); - ItemList.Casing_Inert.set(new ItemStack(this, 1, 14)); + ItemList.Casing_Chemically_Inert.set(new ItemStack(this, 1, 14)); ItemList.Casing_Pipe_Polytetrafluoroethylene.set(new ItemStack(this, 1, 15)); } @@ -87,7 +87,7 @@ public class GT_Block_Casings4 case 13: return Textures.BlockIcons.MACHINE_CASING_ENGINE_INTAKE.getIcon(); case 14: - return Textures.BlockIcons.MACHINE_CASING_INERT.getIcon(); + return Textures.BlockIcons.MACHINE_CASING_CHEMICALLY_INERT.getIcon(); case 15: return Textures.BlockIcons.MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE.getIcon(); } -- cgit From a6a2e600a9ffa12f4eb193dcffa1e5f0b66cc9a9 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Fri, 12 May 2017 09:43:23 +0200 Subject: Powder barrel using Plate Wood --- src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 05caf4cb6a..b4a068949a 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -65,7 +65,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { GT_ModHandler.addCraftingRecipe(ItemList.Block_IridiumTungstensteel.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hBP", 'P', OrePrefixes.plate.get(Materials.Iridium), 'B', ItemList.Block_TungstenSteelReinforced.get(1L, new Object[0])}); GT_OreDictUnificator.setItemData(ItemList.Block_IridiumTungstensteel.get(1, new Object[0]), new ItemData(new MaterialStack(Materials.Iridium, OrePrefixes.plate.mMaterialAmount), new MaterialStack(Materials.TungstenSteel, 2*OrePrefixes.plate.mMaterialAmount),new MaterialStack(Materials.Concrete, OrePrefixes.dust.mMaterialAmount))); GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.coal, 1, 1), new Object[]{ItemList.Block_BrittleCharcoal.get(1, new Object[0])}); - GT_ModHandler.addCraftingRecipe(ItemList.Block_Powderbarrel.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WSW","GGG","WGW", 'W', OrePrefixes.plank.get(Materials.Wood), 'G', new ItemStack(Items.gunpowder,1),'S',new ItemStack(Items.string,1)}); + GT_ModHandler.addCraftingRecipe(ItemList.Block_Powderbarrel.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WSW","GGG","WGW", 'W', OrePrefixes.plate.get(Materials.Wood), 'G', new ItemStack(Items.gunpowder,1),'S',new ItemStack(Items.string,1)}); } -- cgit From 3cf169b5c3f1b346b249704f6a3992ce3a591dea Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Fri, 12 May 2017 22:50:29 +0200 Subject: Added crafting recipes for the LCH --- src/main/java/gregtech/common/blocks/GT_Block_Casings4.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index 9de9c3d323..1f3c117620 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -38,7 +38,7 @@ public class GT_Block_Casings4 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Tungstensteel Turbine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Engine Intake Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Chemically Inert Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "PTFE Pipe Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "PTFE Pipe Machine Casing"); ItemList.Casing_RobustTungstenSteel.set(new ItemStack(this, 1, 0)); ItemList.Casing_CleanStainlessSteel.set(new ItemStack(this, 1, 1)); -- cgit From a16ea6bbc7d45695da017ca440985fa77ca337ed Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Sat, 13 May 2017 23:08:50 +0200 Subject: Changed the Layout of the LCM to 3x3x3, tweaked the name of casings and the descriptions of multiblocks to make them consistent. --- src/main/java/gregtech/common/blocks/GT_Block_Casings2.java | 8 ++++---- src/main/ja