mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-06 06:37:28 +02:00
Powertools dispatch commands as delayed tasks (should reduce any conflict issues).
This commit is contained in:
@@ -370,7 +370,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
}
|
}
|
||||||
boolean used = false;
|
boolean used = false;
|
||||||
// We need to loop through each command and execute
|
// We need to loop through each command and execute
|
||||||
for (String command : commandList)
|
for (final String command : commandList)
|
||||||
{
|
{
|
||||||
if (command.matches(".*\\{player\\}.*"))
|
if (command.matches(".*\\{player\\}.*"))
|
||||||
{
|
{
|
||||||
@@ -385,8 +385,16 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
used = true;
|
used = true;
|
||||||
|
ess.scheduleSyncDelayedTask(
|
||||||
|
new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
user.getServer().dispatchCommand(user.getBase(), command);
|
user.getServer().dispatchCommand(user.getBase(), command);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return used;
|
return used;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user