mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-04 08:59:47 +01:00
Try work around async stuff, paper only issue? Fixes #636
This commit is contained in:
parent
15bc39d49f
commit
e4e3cc3f17
@ -2265,13 +2265,16 @@ public class ReflectionManager {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void setScore(Scoreboard scoreboard, String name, int score) {
|
||||
if (!Bukkit.isPrimaryThread()) {
|
||||
setScore(scoreboard, name, score, true);
|
||||
}
|
||||
|
||||
public static void setScore(Scoreboard scoreboard, String name, int score, boolean canScheduleTask) {
|
||||
if (canScheduleTask && (!Bukkit.isPrimaryThread() || DisguiseUtilities.isRunningPaper())) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setScore(scoreboard, name, score);
|
||||
setScore(scoreboard, name, score, false);
|
||||
}
|
||||
}.runTask(LibsDisguises.getInstance());
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user