From 36ea2bdb43e1728706d6cfdaebda6240268c43d7 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Wed, 28 Nov 2012 20:03:55 -0500 Subject: [PATCH] v6 Polish #1 *Fixed Forestry integration. *Fixed being able to smelt all dusts into Platinum Dust. *Fixed being able to smelt all ores into Platinum Ingots. *Fixed Platinum Ore smelting recipe returning 2 Platinum Ingots. *Fixed crash when using Steve's Stopwatch. *Fixed client failing and textures glitching when using Steve's Stopwatch. *Fixed being able to set machines,' Advanced Solar Generators,' and Bio-Generators' orientation upwards. *Made Solar Generators be shaped like slabs. *Finally cleaned up tool and armor code. *Started work on Steel Tools and Armor. *Made client-to-server data transfer only work if Minecraft's snooper function is enabled. --- src/common/mekanism/common/Mekanism.java | 4 +- src/common/mekanism/common/MekanismHooks.java | 6 +-- src/common/mekanism/common/MekanismUtils.java | 2 +- src/common/mekanism/common/PacketHandler.java | 2 +- .../mekanism/common/TileEntityBasicBlock.java | 16 +++++++- .../common/TileEntityBasicMachine.java | 6 +++ .../generators/common/BlockGenerator.java | 27 ++++++++++--- .../common/TileEntityBioGenerator.java | 6 +++ .../common/TileEntitySolarGenerator.java | 12 ++++++ .../tools/common/ItemMekanismArmor.java | 4 +- .../tools/common/ItemMekanismAxe.java | 10 ++--- .../tools/common/ItemMekanismHoe.java | 34 ++++++++--------- .../tools/common/ItemMekanismKnife.java | 2 +- .../tools/common/ItemMekanismPickaxe.java | 28 +++++++------- .../tools/common/ItemMekanismSpade.java | 10 ++--- .../tools/common/ItemMekanismSword.java | 38 +++++++++---------- .../mekanism/tools/common/MekanismTools.java | 26 ++++++++++--- .../mekanism/client/ClientProxy.java | 7 +++- .../client/BlockRenderingHandler.java | 10 +++++ 19 files changed, 167 insertions(+), 83 deletions(-) diff --git a/src/common/mekanism/common/Mekanism.java b/src/common/mekanism/common/Mekanism.java index aeb822842..e36b210eb 100644 --- a/src/common/mekanism/common/Mekanism.java +++ b/src/common/mekanism/common/Mekanism.java @@ -253,8 +253,8 @@ public class Mekanism } //Furnace Recipes - GameRegistry.addSmelting(new ItemStack(OreBlock, 1, 0).itemID, new ItemStack(Ingot, 2, 1), 1.0F); - GameRegistry.addSmelting(new ItemStack(Dust, 1, 2).itemID, new ItemStack(Ingot, 1, 1), 1.0F); + FurnaceRecipes.smelting().addSmelting(oreBlockID, 0, new ItemStack(Ingot, 1, 1), 1.0F); + FurnaceRecipes.smelting().addSmelting(Dust.shiftedIndex, 2, new ItemStack(Ingot, 1, 1), 1.0F); //Enrichment Chamber Recipes RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Dust, 1, 4), new ItemStack(Item.diamond)); diff --git a/src/common/mekanism/common/MekanismHooks.java b/src/common/mekanism/common/MekanismHooks.java index 8ac78d062..d02be8525 100644 --- a/src/common/mekanism/common/MekanismHooks.java +++ b/src/common/mekanism/common/MekanismHooks.java @@ -101,7 +101,7 @@ public final class MekanismHooks return (ItemStack)ret; } else { - return null; + throw new Exception(); } } catch(Exception e) { System.out.println("[Mekanism] Unable to retrieve IC2 item " + name + "."); @@ -126,7 +126,7 @@ public final class MekanismHooks return new ItemStack((Item)ret); } else { - return null; + throw new Exception(); } } catch(Exception e) { System.out.println("[Mekanism] Unable to retrieve IC2 item " + name + "."); @@ -146,7 +146,7 @@ public final class MekanismHooks return new ItemStack((Item)ret); } else { - return null; + throw new Exception(); } } catch(Exception e) { System.out.println("[Mekanism] Unable to retrieve Forestry item " + name + "."); diff --git a/src/common/mekanism/common/MekanismUtils.java b/src/common/mekanism/common/MekanismUtils.java index cdec8a23e..8ab9d4ca8 100644 --- a/src/common/mekanism/common/MekanismUtils.java +++ b/src/common/mekanism/common/MekanismUtils.java @@ -27,7 +27,7 @@ import net.minecraftforge.oredict.ShapedOreRecipe; * @author AidanBrady * */ -public class MekanismUtils +public final class MekanismUtils { /** * Checks for a new version of Mekanism. diff --git a/src/common/mekanism/common/PacketHandler.java b/src/common/mekanism/common/PacketHandler.java index 78bfa0bb7..0813af287 100644 --- a/src/common/mekanism/common/PacketHandler.java +++ b/src/common/mekanism/common/PacketHandler.java @@ -45,7 +45,7 @@ public class PacketHandler implements IPacketHandler if(packetType == EnumPacketType.TIME.id) { System.out.println("[Mekanism] Received time update packet from " + entityplayer.username + "."); - MekanismUtils.setHourForward(FMLServerHandler.instance().getServer().worldServerForDimension(0), dataStream.readInt()); + MekanismUtils.setHourForward(entityplayer.worldObj, dataStream.readInt()); } if(packetType == EnumPacketType.WEATHER.id) { diff --git a/src/common/mekanism/common/TileEntityBasicBlock.java b/src/common/mekanism/common/TileEntityBasicBlock.java index ef1c531bd..01815b7e9 100644 --- a/src/common/mekanism/common/TileEntityBasicBlock.java +++ b/src/common/mekanism/common/TileEntityBasicBlock.java @@ -101,7 +101,11 @@ public abstract class TileEntityBasicBlock extends TileEntityDisableable impleme } initialized = false; - facing = direction; + + if(canSetFacing(direction)) + { + facing = direction; + } sendPacket(); @@ -111,6 +115,16 @@ public abstract class TileEntityBasicBlock extends TileEntityDisableable impleme } initialized = true; } + + /** + * Whether or not this block's orientation can be changed to a specific direction. True by default. + * @param facing - facing to check + * @return if the block's orientation can be changed + */ + public boolean canSetFacing(int facing) + { + return true; + } @Override public boolean wrenchCanRemove(EntityPlayer entityPlayer) diff --git a/src/common/mekanism/common/TileEntityBasicMachine.java b/src/common/mekanism/common/TileEntityBasicMachine.java index 22e96272f..6767ce752 100644 --- a/src/common/mekanism/common/TileEntityBasicMachine.java +++ b/src/common/mekanism/common/TileEntityBasicMachine.java @@ -294,6 +294,12 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp { return true; } + + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } @Override public void attach(IComputerAccess computer, String computerSide) {} diff --git a/src/common/mekanism/generators/common/BlockGenerator.java b/src/common/mekanism/generators/common/BlockGenerator.java index 66ac9eedf..7ea91b231 100644 --- a/src/common/mekanism/generators/common/BlockGenerator.java +++ b/src/common/mekanism/generators/common/BlockGenerator.java @@ -1,5 +1,7 @@ package mekanism.generators.common; +import ic2.api.EnergyNet; + import java.util.List; import java.util.Random; @@ -124,15 +126,19 @@ public class BlockGenerator extends BlockContainer { if(side == 3) { - return 5; + return 10; } else if(side == 1) { return 3; } - else { + else if(side == 0) + { return 4; } + else { + return 11; + } } else if(meta == 2) { @@ -184,15 +190,19 @@ public class BlockGenerator extends BlockContainer { if(side == tileEntity.facing) { - return 5; + return 10; } else if(side == 1) { return 3; } - else { + else if(side == 0) + { return 4; } + else { + return 11; + } } else if(metadata == 2) { @@ -314,6 +324,11 @@ public class BlockGenerator extends BlockContainer entityItem.motionZ = machineRand.nextGaussian() * motion; world.spawnEntityInWorld(entityItem); + if(Mekanism.hooks.IC2Loaded) + { + EnergyNet.getForWorld(tileEntity.worldObj).removeTileEntity(tileEntity); + } + if(tileEntity instanceof IMultiBlock) { ((IMultiBlock)tileEntity).onDestroy(tileEntity); @@ -426,7 +441,7 @@ public class BlockGenerator extends BlockContainer return null; } - /*@Override + @Override public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { int metadata = world.getBlockMetadata(x, y, z); @@ -438,7 +453,7 @@ public class BlockGenerator extends BlockContainer else { setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } - }*/ + } public static enum GeneratorType { diff --git a/src/common/mekanism/generators/common/TileEntityBioGenerator.java b/src/common/mekanism/generators/common/TileEntityBioGenerator.java index d01f04f16..67898d723 100644 --- a/src/common/mekanism/generators/common/TileEntityBioGenerator.java +++ b/src/common/mekanism/generators/common/TileEntityBioGenerator.java @@ -142,6 +142,12 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank return bioFuelSlot.liquidStored*i / bioFuelSlot.MAX_LIQUID; } + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } + @Override public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) { diff --git a/src/common/mekanism/generators/common/TileEntitySolarGenerator.java b/src/common/mekanism/generators/common/TileEntitySolarGenerator.java index e1ece4123..6606c5d41 100644 --- a/src/common/mekanism/generators/common/TileEntitySolarGenerator.java +++ b/src/common/mekanism/generators/common/TileEntitySolarGenerator.java @@ -10,6 +10,7 @@ import com.google.common.io.ByteArrayDataInput; import dan200.computer.api.IComputerAccess; import mekanism.common.PacketHandler; +import mekanism.generators.common.BlockGenerator.GeneratorType; import net.minecraft.src.*; public class TileEntitySolarGenerator extends TileEntityGenerator @@ -34,6 +35,12 @@ public class TileEntitySolarGenerator extends TileEntityGenerator inventory = new ItemStack[1]; } + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } + @Override public void onUpdate() { @@ -64,6 +71,11 @@ public class TileEntitySolarGenerator extends TileEntityGenerator else { seesSun = false; } + + if(worldObj.getBlockId(xCoord, yCoord+1, zCoord) == MekanismGenerators.generatorID && worldObj.getBlockMetadata(xCoord, yCoord+1, zCoord) == GeneratorType.SOLAR_GENERATOR.meta) + { + seesSun = false; + } } if(canOperate()) diff --git a/src/common/mekanism/tools/common/ItemMekanismArmor.java b/src/common/mekanism/tools/common/ItemMekanismArmor.java index 8b232cc0f..ebc3616ee 100644 --- a/src/common/mekanism/tools/common/ItemMekanismArmor.java +++ b/src/common/mekanism/tools/common/ItemMekanismArmor.java @@ -7,9 +7,9 @@ import net.minecraft.src.*; public class ItemMekanismArmor extends ItemArmor { - public ItemMekanismArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) + public ItemMekanismArmor(int id, EnumArmorMaterial par2EnumArmorMaterial, int renderIndex, int armorType) { - super(par1, par2EnumArmorMaterial, par3, par4); + super(id, par2EnumArmorMaterial, renderIndex, armorType); setCreativeTab(Mekanism.tabMekanism); } diff --git a/src/common/mekanism/tools/common/ItemMekanismAxe.java b/src/common/mekanism/tools/common/ItemMekanismAxe.java index 54813b168..442720c21 100644 --- a/src/common/mekanism/tools/common/ItemMekanismAxe.java +++ b/src/common/mekanism/tools/common/ItemMekanismAxe.java @@ -9,21 +9,21 @@ public class ItemMekanismAxe extends ItemMekanismTool { private static Block blocksEffectiveAgainst[]; - public ItemMekanismAxe(int par1, EnumToolMaterial par2EnumToolMaterial) + public ItemMekanismAxe(int id, EnumToolMaterial enumtoolmaterial) { - super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst); + super(id, 3, enumtoolmaterial, blocksEffectiveAgainst); } @Override - public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + public float getStrVsBlock(ItemStack itemstack, Block block) { - if (par2Block != null && par2Block.blockMaterial == Material.wood) + if (block != null && block.blockMaterial == Material.wood) { return efficiencyOnProperMaterial; } else { - return super.getStrVsBlock(par1ItemStack, par2Block); + return super.getStrVsBlock(itemstack, block); } } diff --git a/src/common/mekanism/tools/common/ItemMekanismHoe.java b/src/common/mekanism/tools/common/ItemMekanismHoe.java index 0d037f678..07f178c9f 100644 --- a/src/common/mekanism/tools/common/ItemMekanismHoe.java +++ b/src/common/mekanism/tools/common/ItemMekanismHoe.java @@ -13,27 +13,27 @@ import net.minecraftforge.event.entity.player.UseHoeEvent; public class ItemMekanismHoe extends ItemMekanism { - protected EnumToolMaterial theToolMaterial; + protected EnumToolMaterial toolMaterial; - public ItemMekanismHoe(int id, EnumToolMaterial par2EnumToolMaterial) + public ItemMekanismHoe(int id, EnumToolMaterial enumtoolmaterial) { super(id); - theToolMaterial = par2EnumToolMaterial; + toolMaterial = enumtoolmaterial; maxStackSize = 1; - setMaxDamage(par2EnumToolMaterial.getMaxUses()); + setMaxDamage(enumtoolmaterial.getMaxUses()); setCreativeTab(CreativeTabs.tabTools); } @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int x, int y, int z, int side, float entityX, float entityY, float entityZ) { - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) + if (!entityplayer.canPlayerEdit(x, y, z, side, itemstack)) { return false; } else { - UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6); + UseHoeEvent event = new UseHoeEvent(entityplayer, itemstack, world, x, y, z); if (MinecraftForge.EVENT_BUS.post(event)) { return false; @@ -41,38 +41,38 @@ public class ItemMekanismHoe extends ItemMekanism if (event.getResult() == Result.ALLOW) { - par1ItemStack.damageItem(1, par2EntityPlayer); + itemstack.damageItem(1, entityplayer); return true; } - int var11 = par3World.getBlockId(par4, par5, par6); - int var12 = par3World.getBlockId(par4, par5 + 1, par6); + int blockID = world.getBlockId(x, y, z); + int aboveBlockID = world.getBlockId(x, y + 1, z); - if ((par7 == 0 || var12 != 0 || var11 != Block.grass.blockID) && var11 != Block.dirt.blockID) + if ((side == 0 || aboveBlockID != 0 || blockID != Block.grass.blockID) && blockID != Block.dirt.blockID) { return false; } else { - Block var13 = Block.tilledField; - par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var13.stepSound.getStepSound(), (var13.stepSound.getVolume() + 1.0F) / 2.0F, var13.stepSound.getPitch() * 0.8F); + Block block = Block.tilledField; + world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, block.stepSound.getStepSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); - if (par3World.isRemote) + if (world.isRemote) { return true; } else { - par3World.setBlockWithNotify(par4, par5, par6, var13.blockID); - par1ItemStack.damageItem(1, par2EntityPlayer); + world.setBlockWithNotify(x, y, z, block.blockID); + itemstack.damageItem(1, entityplayer); return true; } } } } - @SideOnly(Side.CLIENT) @Override + @SideOnly(Side.CLIENT) public boolean isFull3D() { return true; diff --git a/src/common/mekanism/tools/common/ItemMekanismKnife.java b/src/common/mekanism/tools/common/ItemMekanismKnife.java index 3154a30f2..539486113 100644 --- a/src/common/mekanism/tools/common/ItemMekanismKnife.java +++ b/src/common/mekanism/tools/common/ItemMekanismKnife.java @@ -94,7 +94,7 @@ public class ItemMekanismKnife extends ItemMekanism } @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, int i, int j, int k, int l, EntityLiving entityliving) + public boolean onBlockDestroyed(ItemStack itemstack, World world, int x, int y, int z, int side, EntityLiving entityliving) { itemstack.damageItem(blockDamage, entityliving); return true; diff --git a/src/common/mekanism/tools/common/ItemMekanismPickaxe.java b/src/common/mekanism/tools/common/ItemMekanismPickaxe.java index 2fec34713..b0753eea4 100644 --- a/src/common/mekanism/tools/common/ItemMekanismPickaxe.java +++ b/src/common/mekanism/tools/common/ItemMekanismPickaxe.java @@ -10,62 +10,62 @@ public class ItemMekanismPickaxe extends ItemMekanismTool { private static Block blocksEffectiveAgainst[]; - public ItemMekanismPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial) + public ItemMekanismPickaxe(int id, EnumToolMaterial enumtoolmaterial) { - super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst); + super(id, 2, enumtoolmaterial, blocksEffectiveAgainst); } @Override - public boolean canHarvestBlock(Block par1Block) + public boolean canHarvestBlock(Block block) { - if (par1Block == Block.obsidian) + if (block == Block.obsidian) { return toolMaterial.getHarvestLevel() == 3; } - if (par1Block == Block.blockDiamond || par1Block == Block.oreDiamond) + if (block == Block.blockDiamond || block == Block.oreDiamond) { return toolMaterial.getHarvestLevel() >= 2; } - if (par1Block == Block.blockGold || par1Block == Block.oreGold) + if (block == Block.blockGold || block == Block.oreGold) { return toolMaterial.getHarvestLevel() >= 2; } - if (par1Block == Block.blockSteel || par1Block == Block.oreIron) + if (block == Block.blockSteel || block == Block.oreIron) { return toolMaterial.getHarvestLevel() >= 1; } - if (par1Block == Block.blockLapis || par1Block == Block.oreLapis) + if (block == Block.blockLapis || block == Block.oreLapis) { return toolMaterial.getHarvestLevel() >= 1; } - if (par1Block == Block.oreRedstone || par1Block == Block.oreRedstoneGlowing) + if (block == Block.oreRedstone || block == Block.oreRedstoneGlowing) { return toolMaterial.getHarvestLevel() >= 2; } - if (par1Block.blockMaterial == Material.rock) + if (block.blockMaterial == Material.rock) { return true; } - return par1Block.blockMaterial == Material.iron; + return block.blockMaterial == Material.iron; } @Override - public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + public float getStrVsBlock(ItemStack itemstack, Block block) { - if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock)) + if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock)) { return efficiencyOnProperMaterial; } else { - return super.getStrVsBlock(par1ItemStack, par2Block); + return super.getStrVsBlock(itemstack, block); } } diff --git a/src/common/mekanism/tools/common/ItemMekanismSpade.java b/src/common/mekanism/tools/common/ItemMekanismSpade.java index 34e44ce3c..b84fc2273 100644 --- a/src/common/mekanism/tools/common/ItemMekanismSpade.java +++ b/src/common/mekanism/tools/common/ItemMekanismSpade.java @@ -8,20 +8,20 @@ public class ItemMekanismSpade extends ItemMekanismTool { private static Block blocksEffectiveAgainst[]; - public ItemMekanismSpade(int par1, EnumToolMaterial par2EnumToolMaterial) + public ItemMekanismSpade(int id, EnumToolMaterial enumtoolmaterial) { - super(par1, 1, par2EnumToolMaterial, blocksEffectiveAgainst); + super(id, 1, enumtoolmaterial, blocksEffectiveAgainst); } @Override - public boolean canHarvestBlock(Block par1Block) + public boolean canHarvestBlock(Block block) { - if (par1Block == Block.snow) + if (block == Block.snow) { return true; } - return par1Block == Block.blockSnow; + return block == Block.blockSnow; } static diff --git a/src/common/mekanism/tools/common/ItemMekanismSword.java b/src/common/mekanism/tools/common/ItemMekanismSword.java index b3bbf6a80..78ad3fc07 100644 --- a/src/common/mekanism/tools/common/ItemMekanismSword.java +++ b/src/common/mekanism/tools/common/ItemMekanismSword.java @@ -19,19 +19,19 @@ public class ItemMekanismSword extends ItemMekanism private int weaponDamage; private final EnumToolMaterial toolMaterial; - public ItemMekanismSword(int par1, EnumToolMaterial par2EnumToolMaterial) + public ItemMekanismSword(int id, EnumToolMaterial enumtoolmaterial) { - super(par1); - toolMaterial = par2EnumToolMaterial; + super(id); + toolMaterial = enumtoolmaterial; maxStackSize = 1; - setMaxDamage(par2EnumToolMaterial.getMaxUses()); - weaponDamage = 4 + par2EnumToolMaterial.getDamageVsEntity(); + setMaxDamage(enumtoolmaterial.getMaxUses()); + weaponDamage = 4 + enumtoolmaterial.getDamageVsEntity(); } @Override - public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + public float getStrVsBlock(ItemStack itemstack, Block block) { - return par2Block.blockID != Block.web.blockID ? 1.5F : 15F; + return block.blockID != Block.web.blockID ? 1.5F : 15F; } @Override @@ -41,21 +41,21 @@ public class ItemMekanismSword extends ItemMekanism } @Override - public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) + public boolean hitEntity(ItemStack itemstack, EntityLiving entityplayer, EntityLiving entityliving) { - par1ItemStack.damageItem(1, par3EntityLiving); + itemstack.damageItem(1, entityliving); return true; } @Override - public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving) + public boolean onBlockDestroyed(ItemStack itemstack, World world, int x, int y, int z, int facing, EntityLiving entityplayer) { - par1ItemStack.damageItem(2, par7EntityLiving); + itemstack.damageItem(2, entityplayer); return true; } @Override - public int getDamageVsEntity(Entity par1Entity) + public int getDamageVsEntity(Entity entity) { return weaponDamage; } @@ -67,28 +67,28 @@ public class ItemMekanismSword extends ItemMekanism } @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) + public EnumAction getItemUseAction(ItemStack itemstack) { return EnumAction.block; } @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) + public int getMaxItemUseDuration(ItemStack itemstack) { return 0x11940; } @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; + entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack)); + return itemstack; } @Override - public boolean canHarvestBlock(Block par1Block) + public boolean canHarvestBlock(Block block) { - return par1Block.blockID == Block.web.blockID; + return block.blockID == Block.web.blockID; } @Override diff --git a/src/common/mekanism/tools/common/MekanismTools.java b/src/common/mekanism/tools/common/MekanismTools.java index 2504cb39f..d5109529c 100644 --- a/src/common/mekanism/tools/common/MekanismTools.java +++ b/src/common/mekanism/tools/common/MekanismTools.java @@ -31,14 +31,16 @@ public class MekanismTools //Enums: Tools public static EnumToolMaterial toolOBSIDIAN = EnumHelper.addToolMaterial("OBSIDIAN", 3, 2500, 20F, 10, 50); public static EnumToolMaterial toolOBSIDIAN2 = EnumHelper.addToolMaterial("OBSIDIAN2", 3, 3000, 25F, 10, 100); - public static EnumToolMaterial toolLAZULI = EnumHelper.addToolMaterial("LAZULI", 2, 200, 5.0F, 0, 22); - public static EnumToolMaterial toolLAZULI2 = EnumHelper.addToolMaterial("LAZULI2", 2, 250, 6.0F, 4, 50); + public static EnumToolMaterial toolLAZULI = EnumHelper.addToolMaterial("LAZULI", 2, 200, 5F, 2, 22); + public static EnumToolMaterial toolLAZULI2 = EnumHelper.addToolMaterial("LAZULI2", 2, 250, 6F, 4, 50); public static EnumToolMaterial toolPLATINUM = EnumHelper.addToolMaterial("PLATINUM", 2, 500, 10F, 4, 30); public static EnumToolMaterial toolPLATINUM2 = EnumHelper.addToolMaterial("PLATINUM2", 3, 700, 12F, 5, 40); public static EnumToolMaterial toolREDSTONE = EnumHelper.addToolMaterial("REDSTONE", 2, 250, 10F, 6, 50); public static EnumToolMaterial toolREDSTONE2 = EnumHelper.addToolMaterial("REDSTONE2", 2, 400, 12F, 6, 60); - public static EnumToolMaterial toolGLOWSTONE = EnumHelper.addToolMaterial("GLOWSTONE", 2, 300, 14, 5, 80); - public static EnumToolMaterial toolGLOWSTONE2 = EnumHelper.addToolMaterial("GLOWSTONE2", 2, 450, 18, 5, 100); + public static EnumToolMaterial toolGLOWSTONE = EnumHelper.addToolMaterial("GLOWSTONE", 2, 300, 14F, 5, 80); + public static EnumToolMaterial toolGLOWSTONE2 = EnumHelper.addToolMaterial("GLOWSTONE2", 2, 450, 18F, 5, 100); + public static EnumToolMaterial toolSTEEL = EnumHelper.addToolMaterial("STEEL", 3, 850, 14F, 4, 100); + public static EnumToolMaterial toolSTEEL2 = EnumHelper.addToolMaterial("STEEL2", 3, 1250, 18F, 8, 100); //Enums: Armor public static EnumArmorMaterial armorOBSIDIAN = EnumHelper.addArmorMaterial("OBSIDIAN", 50, new int[]{5, 12, 8, 5}, 50); @@ -46,6 +48,7 @@ public class MekanismTools public static EnumArmorMaterial armorPLATINUM = EnumHelper.addArmorMaterial("PLATINUM", 30, new int[]{4, 10, 7, 4}, 50); public static EnumArmorMaterial armorREDSTONE = EnumHelper.addArmorMaterial("REDSTONE", 16, new int[]{2, 7, 5, 3}, 50); public static EnumArmorMaterial armorGLOWSTONE = EnumHelper.addArmorMaterial("GLOWSTONE", 18, new int[]{3, 7, 6, 3}, 50); + public static EnumArmorMaterial armorSTEEL = EnumHelper.addArmorMaterial("STEEL", 40, new int[] {4, 11, 8, 4}, 50); //Base Items public static Item WoodPaxel; @@ -124,6 +127,19 @@ public class MekanismTools public static Item LazuliBoots; public static Item LazuliKnife; + //Steel Items + public static Item SteelPaxel; + public static Item SteelPickaxe; + public static Item SteelAxe; + public static Item SteelSpade; + public static Item SteelHoe; + public static Item SteelSword; + public static Item SteelHelmet; + public static Item SteelBody; + public static Item SteelLegs; + public static Item SteelBoots; + public static Item SteelKnife; + @Init public void init(FMLInitializationEvent event) { @@ -599,8 +615,8 @@ public class MekanismTools public void addEntities() { - EntityRegistry.registerModEntity(EntityKnife.class, "Knife", 52, this, 40, 5, true); EntityRegistry.registerGlobalEntityID(EntityKnife.class, "Knife", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerModEntity(EntityKnife.class, "Knife", 52, this, 40, 5, true); } @ForgeSubscribe diff --git a/src/minecraft/mekanism/client/ClientProxy.java b/src/minecraft/mekanism/client/ClientProxy.java index 50c56dd31..3fbba6dab 100644 --- a/src/minecraft/mekanism/client/ClientProxy.java +++ b/src/minecraft/mekanism/client/ClientProxy.java @@ -91,7 +91,12 @@ public class ClientProxy extends CommonProxy public void loadUtilities() { System.out.println("[Mekanism] Beginning utility initiative..."); - new ThreadSendData(); + + if(FMLClientHandler.instance().getClient().gameSettings.snooperEnabled) + { + new ThreadSendData(); + } + System.out.println("[Mekanism] Utility initiative complete."); } diff --git a/src/minecraft/mekanism/generators/client/BlockRenderingHandler.java b/src/minecraft/mekanism/generators/client/BlockRenderingHandler.java index 11546bf13..a294b05df 100644 --- a/src/minecraft/mekanism/generators/client/BlockRenderingHandler.java +++ b/src/minecraft/mekanism/generators/client/BlockRenderingHandler.java @@ -91,6 +91,16 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler public void renderItem(RenderBlocks renderer, int metadata, Block block) { block.setBlockBoundsForItemRender(); + + if(metadata == GeneratorType.SOLAR_GENERATOR.meta) + { + block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.4F, 1.0F); + } + else { + block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + renderer.func_83018_a(block); if (renderer.useInventoryTint) {