mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 19:50:37 +00:00
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:
parent
8aca48fb6a
commit
1398afd7d3
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue