Revert radius to distanceSquared

This commit is contained in:
Focusvity 2023-11-27 20:38:39 +11:00
parent 7254097ae4
commit bee4268d51
No known key found for this signature in database
GPG Key ID: FC3BE6D52CCDB38F
1 changed files with 2 additions and 1 deletions

View File

@ -39,6 +39,7 @@ public class EntityWipeCMD extends PlexCommand
if (radiusSpecified)
{
radius = parseInt(sender, args[entityWhitelist.size() - 1]); // get the args length as the size of the list
radius *= radius;
entityWhitelist.remove(entityWhitelist.size() - 1); // remove the radius from the list
}
@ -70,7 +71,7 @@ public class EntityWipeCMD extends PlexCommand
if (radius > 0)
{
PlexLog.debug("we got here, radius is > 0");
if (playerSender != null && entity.getWorld() == playerSender.getWorld() && playerSender.getLocation().distance(entity.getLocation()) > radius)
if (playerSender != null && entity.getWorld() == playerSender.getWorld() && playerSender.getLocation().distanceSquared(entity.getLocation()) > radius)
{
PlexLog.debug("continuing");
continue;