(EntityPlayer player, World worldIn, BlockPos fence)
| 47 | } |
| 48 | |
| 49 | public static boolean attachToFence(EntityPlayer player, World worldIn, BlockPos fence) |
| 50 | { |
| 51 | EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForPosition(worldIn, fence); |
| 52 | boolean flag = false; |
| 53 | double d0 = 7.0D; |
| 54 | int i = fence.getX(); |
| 55 | int j = fence.getY(); |
| 56 | int k = fence.getZ(); |
| 57 | |
| 58 | for (EntityLiving entityliving : worldIn.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB((double)i - d0, (double)j - d0, (double)k - d0, (double)i + d0, (double)j + d0, (double)k + d0))) |
| 59 | { |
| 60 | if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == player) |
| 61 | { |
| 62 | if (entityleashknot == null) |
| 63 | { |
| 64 | entityleashknot = EntityLeashKnot.createKnot(worldIn, fence); |
| 65 | } |
| 66 | |
| 67 | entityliving.setLeashedToEntity(entityleashknot, true); |
| 68 | flag = true; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | return flag; |
| 73 | } |
| 74 | } |
no test coverage detected