mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Reduce a few nickname refresh calls.
This commit is contained in:
parent
a800359e0b
commit
1f8b60081e
@ -19,6 +19,11 @@ public class Commandcustomtext extends EssentialsCommand
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
ess.getUser(sender.getPlayer()).setDisplayNick();
|
||||
}
|
||||
|
||||
final IText input = new TextInput(sender, "custom", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
final TextPager pager = new TextPager(output);
|
||||
|
@ -45,6 +45,7 @@ public class Commandhelp extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
user.setDisplayNick();
|
||||
output = new KeywordReplacer(input, user.getSource(), ess);
|
||||
}
|
||||
final TextPager pager = new TextPager(output);
|
||||
|
@ -18,6 +18,11 @@ public class Commandinfo extends EssentialsCommand
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
ess.getUser(sender.getPlayer()).setDisplayNick();
|
||||
}
|
||||
|
||||
final IText input = new TextInput(sender, "info", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
final TextPager pager = new TextPager(output);
|
||||
|
@ -18,6 +18,11 @@ public class Commandmotd extends EssentialsCommand
|
||||
@Override
|
||||
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
ess.getUser(sender.getPlayer()).setDisplayNick();
|
||||
}
|
||||
|
||||
final IText input = new TextInput(sender, "motd", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
final TextPager pager = new TextPager(output);
|
||||
|
@ -18,6 +18,11 @@ public class Commandrules extends EssentialsCommand
|
||||
@Override
|
||||
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
ess.getUser(sender.getPlayer()).setDisplayNick();
|
||||
}
|
||||
|
||||
final IText input = new TextInput(sender, "rules", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
final TextPager pager = new TextPager(output);
|
||||
|
@ -37,6 +37,7 @@ public class SignInfo extends EssentialsSign
|
||||
final IText input;
|
||||
try
|
||||
{
|
||||
player.setDisplayNick();
|
||||
input = new TextInput(player.getSource(), "info", true, ess);
|
||||
final IText output = new KeywordReplacer(input, player.getSource(), ess);
|
||||
final TextPager pager = new TextPager(output);
|
||||
|
@ -66,8 +66,6 @@ public class KeywordReplacer implements IText
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
user = ess.getUser(sender.getPlayer());
|
||||
//This is just so any displayname lookups below show the correct nickname
|
||||
user.setDisplayNick();
|
||||
}
|
||||
execTimer.mark("User Grab");
|
||||
|
||||
|
@ -134,7 +134,7 @@ public class EssentialsSpawnPlayerListener implements Listener
|
||||
|
||||
LOGGER.log(Level.FINE, "New player join");
|
||||
}
|
||||
});
|
||||
}, 2L);
|
||||
}
|
||||
|
||||
|
||||
@ -150,7 +150,7 @@ public class EssentialsSpawnPlayerListener implements Listener
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (user.getBase() instanceof OfflinePlayer)
|
||||
if (user.getBase() instanceof OfflinePlayer || !user.getBase().isOnline())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user