mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Eliminate some errors.
This commit is contained in:
parent
91eae5163d
commit
342ece9934
@ -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();
|
||||
|
@ -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())
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user