From 8c9762fd9af61c4d6bae791ebbaa4380478dde64 Mon Sep 17 00:00:00 2001 From: LexManos Date: Fri, 16 Dec 2011 10:06:57 +0000 Subject: [PATCH] Added missing native library path to forge_client project. Added harvest levels/effectiveness for Axes and Shovels. --- forge/forge_client/.classpath | 19 ++- forge/forge_client/.project | 54 ++++++++ .../net/minecraft/src/forge/ForgeHooks.java | 123 +++++++++++------- 3 files changed, 145 insertions(+), 51 deletions(-) diff --git a/forge/forge_client/.classpath b/forge/forge_client/.classpath index fae6017a3..609bee1de 100755 --- a/forge/forge_client/.classpath +++ b/forge/forge_client/.classpath @@ -1,12 +1,25 @@ + - - - + + + + + + + + + + + + + + + diff --git a/forge/forge_client/.project b/forge/forge_client/.project index 12d4bdba8..217be6f52 100755 --- a/forge/forge_client/.project +++ b/forge/forge_client/.project @@ -20,10 +20,64 @@ 2 PARENT-1-PROJECT_LOC/forge_common + + jars + 2 + MCP_LOC/jars + minecraft 2 PARENT-1-WORKSPACE_LOC/src_work/minecraft + + start + 2 + MCP_LOC/conf/patches + + + + 1324024223159 + jars + 9 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-bin + + + + 1324024223163 + jars + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-* + + + + 1324022795404 + start + 5 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.java + + + + 1324024144075 + jars/bin + 5 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*.jar + + + + + + MCP_LOC + $%7BPARENT-1-WORKSPACE_LOC%7D + + diff --git a/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java b/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java index 4ed71df41..9f2f2b2d7 100644 --- a/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java +++ b/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java @@ -179,72 +179,99 @@ public class ForgeHooks { } public static boolean isToolEffective(ItemStack ist, Block bl, int md) { - List tc=(List)toolClasses.get(ist.itemID); - if(tc==null) return false; - Object[] ta=tc.toArray(); - String cls=(String)ta[0]; - - return toolEffectiveness.contains(Arrays.asList( - bl.blockID,md,cls)); + List tc = (List)toolClasses.get(ist.itemID); + if (tc == null) + { + return false; + } + Object[] ta = tc.toArray(); + String cls = (String)ta[0]; + return toolEffectiveness.contains(Arrays.asList(bl.blockID, md, cls)); } static void initTools() { - if(toolInit) return; - toolInit=true; + if(toolInit) + { + return; + } + toolInit = true; - MinecraftForge.setToolClass(Item.pickaxeWood,"pickaxe",0); - MinecraftForge.setToolClass(Item.pickaxeStone,"pickaxe",1); - MinecraftForge.setToolClass(Item.pickaxeSteel,"pickaxe",2); - MinecraftForge.setToolClass(Item.pickaxeGold,"pickaxe",0); - MinecraftForge.setToolClass(Item.pickaxeDiamond,"pickaxe",3); + MinecraftForge.setToolClass(Item.pickaxeWood, "pickaxe", 0); + MinecraftForge.setToolClass(Item.pickaxeStone, "pickaxe", 1); + MinecraftForge.setToolClass(Item.pickaxeSteel, "pickaxe", 2); + MinecraftForge.setToolClass(Item.pickaxeGold, "pickaxe", 0); + MinecraftForge.setToolClass(Item.pickaxeDiamond, "pickaxe", 3); - MinecraftForge.setToolClass(Item.axeWood,"axe",0); - MinecraftForge.setToolClass(Item.axeStone,"axe",1); - MinecraftForge.setToolClass(Item.axeSteel,"axe",2); - MinecraftForge.setToolClass(Item.axeGold,"axe",0); - MinecraftForge.setToolClass(Item.axeDiamond,"axe",3); + MinecraftForge.setToolClass(Item.axeWood, "axe", 0); + MinecraftForge.setToolClass(Item.axeStone, "axe", 1); + MinecraftForge.setToolClass(Item.axeSteel, "axe", 2); + MinecraftForge.setToolClass(Item.axeGold, "axe", 0); + MinecraftForge.setToolClass(Item.axeDiamond, "axe", 3); - MinecraftForge.setToolClass(Item.shovelWood,"shovel",0); - MinecraftForge.setToolClass(Item.shovelStone,"shovel",1); - MinecraftForge.setToolClass(Item.shovelSteel,"shovel",2); - MinecraftForge.setToolClass(Item.shovelGold,"shovel",0); - MinecraftForge.setToolClass(Item.shovelDiamond,"shovel",3); + MinecraftForge.setToolClass(Item.shovelWood, "shovel", 0); + MinecraftForge.setToolClass(Item.shovelStone, "shovel", 1); + MinecraftForge.setToolClass(Item.shovelSteel, "shovel", 2); + MinecraftForge.setToolClass(Item.shovelGold, "shovel", 0); + MinecraftForge.setToolClass(Item.shovelDiamond, "shovel", 3); - MinecraftForge.setBlockHarvestLevel(Block.obsidian,"pickaxe",3); - MinecraftForge.setBlockHarvestLevel(Block.oreDiamond,"pickaxe",2); - MinecraftForge.setBlockHarvestLevel(Block.blockDiamond,"pickaxe",2); - MinecraftForge.setBlockHarvestLevel(Block.oreGold,"pickaxe",2); - MinecraftForge.setBlockHarvestLevel(Block.blockGold,"pickaxe",2); - MinecraftForge.setBlockHarvestLevel(Block.oreIron,"pickaxe",1); - MinecraftForge.setBlockHarvestLevel(Block.blockSteel,"pickaxe",1); - MinecraftForge.setBlockHarvestLevel(Block.oreLapis,"pickaxe",1); - MinecraftForge.setBlockHarvestLevel(Block.blockLapis,"pickaxe",1); - MinecraftForge.setBlockHarvestLevel(Block.oreRedstone,"pickaxe",2); - MinecraftForge.setBlockHarvestLevel(Block.oreRedstoneGlowing,"pickaxe",2); - MinecraftForge.removeBlockEffectiveness(Block.oreRedstone,"pickaxe"); - MinecraftForge.removeBlockEffectiveness(Block.oreRedstoneGlowing,"pickaxe"); - MinecraftForge.removeBlockEffectiveness(Block.obsidian,"pickaxe"); + MinecraftForge.setBlockHarvestLevel(Block.obsidian, "pickaxe", 3); + MinecraftForge.setBlockHarvestLevel(Block.oreDiamond, "pickaxe", 2); + MinecraftForge.setBlockHarvestLevel(Block.blockDiamond, "pickaxe", 2); + MinecraftForge.setBlockHarvestLevel(Block.oreGold, "pickaxe", 2); + MinecraftForge.setBlockHarvestLevel(Block.blockGold, "pickaxe", 2); + MinecraftForge.setBlockHarvestLevel(Block.oreIron, "pickaxe", 1); + MinecraftForge.setBlockHarvestLevel(Block.blockSteel, "pickaxe", 1); + MinecraftForge.setBlockHarvestLevel(Block.oreLapis, "pickaxe", 1); + MinecraftForge.setBlockHarvestLevel(Block.blockLapis, "pickaxe", 1); + MinecraftForge.setBlockHarvestLevel(Block.oreRedstone, "pickaxe", 2); + MinecraftForge.setBlockHarvestLevel(Block.oreRedstoneGlowing, "pickaxe", 2); + MinecraftForge.removeBlockEffectiveness(Block.oreRedstone, "pickaxe"); + MinecraftForge.removeBlockEffectiveness(Block.obsidian, "pickaxe"); + MinecraftForge.removeBlockEffectiveness(Block.oreRedstoneGlowing, "pickaxe"); - Block[] pickeff ={ + Block[] pickeff = { Block.cobblestone, Block.stairDouble, - Block.stairSingle, Block.stone, Block.sandStone, - Block.cobblestoneMossy, - Block.oreCoal, - Block.ice, Block.netherrack, Block.oreLapis, + Block.stairSingle, Block.stone, + Block.sandStone, Block.cobblestoneMossy, + Block.oreCoal, Block.ice, + Block.netherrack, Block.oreLapis, Block.blockLapis - }; - for(Block bl : pickeff) { - MinecraftForge.setBlockHarvestLevel(bl,"pickaxe",0); + }; + for (Block bl : pickeff) + { + MinecraftForge.setBlockHarvestLevel(bl, "pickaxe", 0); + } + + Block[] spadeEff = { + Block.grass, Block.dirt, + Block.sand, Block.gravel, + Block.snow, Block.blockSnow, + Block.blockClay, Block.tilledField, + Block.slowSand, Block.mycelium + }; + for (Block bl : spadeEff) + { + MinecraftForge.setBlockHarvestLevel(bl, "shovel", 0); + } + + Block[] axeEff = { + Block.planks, Block.bookShelf, + Block.wood, Block.chest, + Block.stairDouble, Block.stairSingle, + Block.pumpkin, Block.pumpkinLantern + }; + for (Block bl : axeEff) + { + MinecraftForge.setBlockHarvestLevel(bl, "axe", 0); } - // TODO: add other tool tables. } public static final int majorVersion=1; public static final int minorVersion=2; public static final int revisionVersion=2; static { - System.out.printf("MinecraftForge V%d.%d.%d Initialized\n",majorVersion,minorVersion,revisionVersion); + System.out.printf("MinecraftForge V%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion); } static boolean toolInit=false;