Eliminate some errors.

This commit is contained in:
Steven Lawson 2011-10-27 20:37:30 -04:00
parent 91eae5163d
commit 342ece9934
3 changed files with 28 additions and 6 deletions

View File

@ -50,7 +50,17 @@ public class Command_expel extends TFM_Command
if (!p.equals(sender_p))
{
Location target_pos = p.getLocation();
if (target_pos.distance(sender_pos) < radius)
boolean in_range = false;
try
{
in_range = target_pos.distance(sender_pos) < radius;
}
catch (IllegalArgumentException ex)
{
}
if (in_range)
{
sender.sendMessage("Pushing " + p.getName());
Vector expel_direction = target_pos.subtract(sender_pos).toVector().normalize();

View File

@ -30,9 +30,15 @@ public class Command_radar extends TFM_Command
for (Player p : sender_pos.getWorld().getPlayers())
{
if (!p.equals(sender_p))
{
try
{
radar_data.add(new TFM_RadarData(p, sender_pos.distance(p.getLocation()), p.getLocation()));
}
catch (IllegalArgumentException ex)
{
}
}
}
if (radar_data.isEmpty())

View File

@ -30,6 +30,8 @@ public class TFM_Heartbeat implements Runnable
}
if (plugin.disableNight)
{
try
{
for (World world : Bukkit.getWorlds())
{
@ -39,6 +41,10 @@ public class TFM_Heartbeat implements Runnable
}
}
}
catch (NullPointerException ex)
{
}
}
if (plugin.disableWeather)
{