Update Methods.java

FIx RapidPunch/Paralyze from working through walls.
Updated GetTargetedEntity() to make sure no solid blocks are between player and target..
This commit is contained in:
dniym 2014-11-04 22:40:41 -05:00
parent 8aca48fb6a
commit 1398afd7d3

View file

@ -870,6 +870,17 @@ public class Methods {
longestr = entity.getLocation().distance(origin);
}
}
if(target != null) {
List <Block> blklist = new ArrayList();
blklist = Methods.getBlocksAlongLine(player.getLocation(), target.getLocation(), player.getWorld());
for(Block isair:blklist)
{
if(Methods.isObstructed(origin, target.getLocation())) {
target = null;
break;
}
}
}
return target;
}