mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 02:04:57 +00:00
Eliminate some errors.
This commit is contained in:
parent
91eae5163d
commit
342ece9934
3 changed files with 28 additions and 6 deletions
|
@ -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();
|
||||
|
|
|
@ -31,7 +31,13 @@ public class Command_radar extends TFM_Command
|
|||
{
|
||||
if (!p.equals(sender_p))
|
||||
{
|
||||
radar_data.add(new TFM_RadarData(p, sender_pos.distance(p.getLocation()), p.getLocation()));
|
||||
try
|
||||
{
|
||||
radar_data.add(new TFM_RadarData(p, sender_pos.distance(p.getLocation()), p.getLocation()));
|
||||
}
|
||||
catch (IllegalArgumentException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,15 +31,21 @@ public class TFM_Heartbeat implements Runnable
|
|||
|
||||
if (plugin.disableNight)
|
||||
{
|
||||
for (World world : Bukkit.getWorlds())
|
||||
try
|
||||
{
|
||||
if (world.getTime() > 12000L)
|
||||
for (World world : Bukkit.getWorlds())
|
||||
{
|
||||
TFM_Util.setWorldTime(world, 1000L);
|
||||
if (world.getTime() > 12000L)
|
||||
{
|
||||
TFM_Util.setWorldTime(world, 1000L);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (plugin.disableWeather)
|
||||
{
|
||||
for (World world : Bukkit.getWorlds())
|
||||
|
|
Loading…
Reference in a new issue