Try work around async stuff, paper only issue? Fixes #636

This commit is contained in:
libraryaddict 2022-01-25 10:51:56 +13:00
parent 15bc39d49f
commit e4e3cc3f17

View File

@ -2265,13 +2265,16 @@ public class ReflectionManager {
ex.printStackTrace(); ex.printStackTrace();
} }
} }
public static void setScore(Scoreboard scoreboard, String name, int score) { 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() { new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
setScore(scoreboard, name, score); setScore(scoreboard, name, score, false);
} }
}.runTask(LibsDisguises.getInstance()); }.runTask(LibsDisguises.getInstance());
return; return;