The methods only make sense for players. Modify them to be for players only.
This commit is contained in:
parent
c1db14eebe
commit
42914f48a0
@ -190,30 +190,22 @@ public class MassiveCoreEngineMain extends EngineAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This method sets the sender reference based on it's online state.
|
// This method sets the sender reference based on it's online state.
|
||||||
public static void setSenderReferences(CommandSender sender)
|
public static void setSenderReferences(Player player)
|
||||||
{
|
{
|
||||||
CommandSender reference = sender;
|
Player reference = player;
|
||||||
if (sender instanceof Player)
|
if ( ! player.isOnline()) reference = null;
|
||||||
{
|
setSenderReferences(player, reference);
|
||||||
Player player = (Player)sender;
|
|
||||||
if ( ! player.isOnline())
|
|
||||||
{
|
|
||||||
reference = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setSenderReferences(sender, reference);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Same as above but next tick.
|
// Same as above but next tick.
|
||||||
public static void setSenderReferencesSoon(final CommandSender sender)
|
public static void setSenderReferencesSoon(final Player player)
|
||||||
{
|
{
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(MassiveCore.get(), new Runnable()
|
Bukkit.getScheduler().scheduleSyncDelayedTask(MassiveCore.get(), new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setSenderReferences(sender);
|
setSenderReferences(player);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -223,7 +215,7 @@ public class MassiveCoreEngineMain extends EngineAbstract
|
|||||||
{
|
{
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
// We set the reference at LOWEST so that it's present during this event.
|
// We set the reference at LOWEST so that it's present during this PlayerLoginEvent event.
|
||||||
setSenderReferences(player, player);
|
setSenderReferences(player, player);
|
||||||
|
|
||||||
// And the next tick we update the reference based on it's online state.
|
// And the next tick we update the reference based on it's online state.
|
||||||
|
Loading…
Reference in New Issue
Block a user