--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
@@ -60,10 +60,10 @@
         BlockPos blockpos1 = p_176341_2_.func_177972_a(p_176341_3_);
         Block block = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)).func_177230_c();
 
-        if (!func_176343_a(p_176341_1_.func_180495_p(blockpos1), p_176341_3_) && (block.func_149637_q() || !func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177977_b()))))
+        if (!canRestoneConnect(p_176341_1_, blockpos1, p_176341_3_) && (block.func_149637_q() || !canRestoneConnect(p_176341_1_, blockpos1.func_177977_b(), null)))
         {
             Block block1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()).func_177230_c();
-            return !block1.func_149637_q() && block.func_149637_q() && func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177984_a())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
+            return !block1.func_149637_q() && block.func_149637_q() && canRestoneConnect(p_176341_1_, blockpos1.func_177984_a(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
         }
         else
         {
@@ -393,35 +393,25 @@
         Block block = iblockstate.func_177230_c();
         boolean flag = block.func_149721_r();
         boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_177230_c().func_149721_r();
-        return !flag1 && flag && func_176340_e(p_176339_1_, blockpos1.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos1.func_177977_b())));
+        return !flag1 && flag && canRestoneConnect(p_176339_1_, blockpos1.func_177984_a(), null) ? true : (canRestoneConnect(p_176339_1_, blockpos1, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && canRestoneConnect(p_176339_1_, blockpos1.func_177977_b(), null)));
     }
 
-    protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_)
+    protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side)
     {
-        return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
-    }
+        IBlockState state = world.func_180495_p(pos);
 
-    protected static boolean func_176346_d(IBlockState p_176346_0_)
-    {
-        return func_176343_a(p_176346_0_, (EnumFacing)null);
-    }
-
-    protected static boolean func_176343_a(IBlockState p_176343_0_, EnumFacing p_176343_1_)
-    {
-        Block block = p_176343_0_.func_177230_c();
-
-        if (block == Blocks.field_150488_af)
+        if (state.func_177230_c() == Blocks.field_150488_af)
         {
             return true;
         }
-        else if (Blocks.field_150413_aR.func_149907_e(block))
+        else if (Blocks.field_150413_aR.func_149907_e(state.func_177230_c()))
         {
-            EnumFacing enumfacing1 = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_176387_N);
-            return enumfacing1 == p_176343_1_ || enumfacing1.func_176734_d() == p_176343_1_;
+            EnumFacing direction = (EnumFacing)state.func_177229_b(BlockRedstoneRepeater.field_176387_N);
+            return direction == side || direction.func_176734_d() == side;
         }
         else
         {
-            return block.func_149744_f() && p_176343_1_ != null;
+            return state.func_177230_c().canConnectRedstone(world, pos, side);
         }
     }
 
