diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index a43bef911..01dbf229f 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -141,7 +141,22 @@ { ItemStack var8 = this.createStackedBlock(par6); -@@ -1364,4 +1380,840 @@ +@@ -1097,12 +1113,13 @@ + } + } + ++ private int silk_check_meta = -1; //Dirty hack to stop us from needing to special case the silk check hook. + /** + * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. + */ + protected boolean canSilkHarvest() + { +- return this.renderAsNormalBlock() && !this.isBlockContainer; ++ return this.renderAsNormalBlock() && !this.hasTileEntity(silk_check_meta); + } + + /** +@@ -1364,4 +1381,839 @@ canBlockGrass[0] = true; StatList.initBreakableStats(); } @@ -493,11 +508,10 @@ + */ + public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) + { -+ if (this instanceof BlockGlass || this instanceof BlockEnderChest) -+ { -+ return true; -+ } -+ return renderAsNormalBlock() && !hasTileEntity(metadata); ++ silk_check_meta = metadata; ++ boolean ret = this.canSilkHarvest(); ++ silk_check_meta = 0; ++ return ret; + } + + /**