mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Fixed issue with Efficancy enchatment when connected to vanilla servers.
This commit is contained in:
1 parent
da1679a061
commit
263e919384
2 files changed
+15
-1
No files matched your search
@@ -116,6 +116,20 @@ public class ForgeHooks
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean canToolHarvestBlock(Block block, int metadata, ItemStack stack)
|
||||
{
|
||||
if (stack == null) return false;
|
||||
List info = (List)toolClasses.get(stack.getItem());
|
||||
if (info == null) return false;
|
||||
|
||||
Object[] tmp = info.toArray();
|
||||
String toolClass = (String)tmp[0];
|
||||
int harvestLevel = (Integer)tmp[1];
|
||||
|
||||
Integer blockHarvestLevel = (Integer)toolHarvestLevels.get(Arrays.asList(block, metadata, toolClass));
|
||||
return !(blockHarvestLevel == null || blockHarvestLevel > harvestLevel);
|
||||
}
|
||||
|
||||
public static float blockStrength(Block block, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
float var5 = (float)(var3 * var3 + 1);
|
||||
-
|
||||
- if (!var4.canHarvestBlock(par1Block) && var2 <= 1.0F)
|
||||
+ boolean canHarvest = ForgeHooks.canHarvestBlock(par1Block, this, meta);
|
||||
+ boolean canHarvest = ForgeHooks.canToolHarvestBlock(par1Block, meta, var4);
|
||||
+
|
||||
+ if (!canHarvest && var2 <= 1.0F)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user