Fix return value of EnchantPower hook, closes #518

This commit is contained in:
LexManos 2013-04-17 19:08:50 -07:00
parent d3a2243799
commit a0891d74a0
2 changed files with 8 additions and 2 deletions

View file

@ -379,6 +379,6 @@ public class ForgeHooks
} }
Block block = Block.blocksList[world.getBlockId(x, y, z)]; Block block = Block.blocksList[world.getBlockId(x, y, z)];
return (block == null ? 0 : block.getEnchantPower(world, x, y, z)); return (block == null ? 0 : block.getEnchantPowerBonus(world, x, y, z));
} }
} }

View file

@ -155,7 +155,7 @@
} }
/** /**
@@ -1439,4 +1459,911 @@ @@ -1439,4 +1459,917 @@
canBlockGrass[0] = true; canBlockGrass[0] = true;
StatList.initBreakableStats(); StatList.initBreakableStats();
} }
@ -1062,6 +1062,12 @@
+ * @param z Z position + * @param z Z position
+ * @return The amount of enchanting power this block produces. + * @return The amount of enchanting power this block produces.
+ */ + */
+ public float getEnchantPowerBonus(World world, int x, int y, int z)
+ {
+ return getEnchantPower(world, x, y, z);
+ }
+
+ @Deprecated //Changed return to float, see above.
+ public int getEnchantPower(World world, int x, int y, int z) + public int getEnchantPower(World world, int x, int y, int z)
+ { + {
+ return blockID == bookShelf.blockID ? 1 : 0; + return blockID == bookShelf.blockID ? 1 : 0;