mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
IEntityLivingBase:
-Fixed duplicate entity entries when using getLookingAtEntities()
This commit is contained in:
1 parent
83b7e4f73d
commit
4e5ed2d758
1 file changed
+6
-1
@@ -140,7 +140,12 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
|
||||
currentPos = currentPos.addVector(lookVector[0], lookVector[1], lookVector[2]);
|
||||
IPos pos = new ScriptBlockPos(new BlockPos(currentPos.xCoord, currentPos.yCoord, currentPos.zCoord));
|
||||
|
||||
Collections.addAll(entities, getWorld().getEntitiesNear(pos,range));
|
||||
IEntity[] entitiesNear = getWorld().getEntitiesNear(pos,range);
|
||||
for (IEntity entity : entitiesNear) {
|
||||
if (!entities.contains(entity)) {
|
||||
entities.add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
double distance = Math.pow(
|
||||
Math.pow(currentPos.xCoord-startPos[0],2)
|
||||
|
||||
Reference in new issue
Block a user