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

View File

@ -39,6 +39,7 @@ public class EntityWipeCMD extends PlexCommand
if (radiusSpecified) if (radiusSpecified)
{ {
radius = parseInt(sender, args[entityWhitelist.size() - 1]); // get the args length as the size of the list 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 entityWhitelist.remove(entityWhitelist.size() - 1); // remove the radius from the list
} }
@ -70,7 +71,7 @@ public class EntityWipeCMD extends PlexCommand
if (radius > 0) if (radius > 0)
{ {
PlexLog.debug("we got here, radius is > 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"); PlexLog.debug("continuing");
continue; continue;