mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-04 08:59:47 +01:00
Don't set score async
This commit is contained in:
parent
0d198a7086
commit
9a1a6ae08e
@ -28,6 +28,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.plugin.SimplePluginManager;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -1935,6 +1936,16 @@ public class ReflectionManager {
|
||||
}
|
||||
|
||||
public static void setScore(Scoreboard scoreboard, Object criteria, String name, int score) {
|
||||
if (!Bukkit.isPrimaryThread()) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setScore(scoreboard, criteria, name, score);
|
||||
}
|
||||
}.runTask(LibsDisguises.getInstance());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Object board = boardField.get(scoreboard);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user