9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-25 18:09:20 +00:00
This commit is contained in:
Xiao-MoMi
2022-10-22 10:08:29 +08:00
parent da383e1cbc
commit 5773ea83e5
3 changed files with 8 additions and 16 deletions

View File

@@ -110,7 +110,6 @@ public final class CustomNameplates extends JavaPlugin {
@Override
public void onDisable() {
if (ConfigManager.Module.nameplate){
SqlHandler.saveAll();
SqlHandler.close();
if (!ConfigManager.Nameplate.fakeTeam && !ConfigManager.Main.tab && !ConfigManager.Main.tab_bc) {
for (Team team : Bukkit.getScoreboardManager().getMainScoreboard().getTeams()) {

View File

@@ -30,11 +30,16 @@ public class BubblesEvent extends PlayerEvent implements Cancellable {
cancelled = cancel;
}
@Override
public @NotNull HandlerList getHandlers() {
public static HandlerList getHandlerList() {
return handlerList;
}
@NotNull
@Override
public HandlerList getHandlers() {
return getHandlerList();
}
public String getBubble() {
return bubble;
}

View File

@@ -70,19 +70,7 @@ public class DataManager {
}
public void unloadPlayer(UUID uuid) {
if (!cache.containsKey(uuid)) {
return;
}
if (ConfigManager.Database.async){
Bukkit.getScheduler().runTaskAsynchronously(CustomNameplates.instance, ()-> {
SqlHandler.save(cache.get(uuid), uuid);
cache.remove(uuid);
});
}
else {
SqlHandler.save(cache.get(uuid), uuid);
cache.remove(uuid);
}
cache.remove(uuid);
}
public void savePlayer(UUID uuid) {