mirror of
https://github.com/CarmJos/MineSQL.git
synced 2026-06-05 00:48:16 +08:00
当命名空间下无注册实例时,删除命名空间
This commit is contained in:
@@ -112,12 +112,10 @@ public class EasySQLManager implements EasySQLAPI {
|
|||||||
@Override
|
@Override
|
||||||
public void unregisterSQLManager(@NotNull String name) {
|
public void unregisterSQLManager(@NotNull String name) {
|
||||||
LOCK.lock();
|
LOCK.lock();
|
||||||
// 先清除命名空间
|
|
||||||
this.sqlManagerRegistry.remove(name);
|
|
||||||
// 再清除名称
|
|
||||||
for (Map.Entry<String, Set<String>> stringSetEntry : this.nameSpaceRegistry.entrySet()) {
|
for (Map.Entry<String, Set<String>> stringSetEntry : this.nameSpaceRegistry.entrySet()) {
|
||||||
stringSetEntry.getValue().remove(name);
|
stringSetEntry.getValue().remove(name);
|
||||||
}
|
}
|
||||||
|
this.nameSpaceRegistry.entrySet().removeIf(stringSetEntry -> stringSetEntry.getValue().isEmpty());
|
||||||
LOCK.unlock();
|
LOCK.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -38,6 +38,7 @@ public class EasySQLBukkit extends JavaPlugin implements EasySQLPluginPlatform,
|
|||||||
this.register(this, instanceName, sqlManager);
|
this.register(this, instanceName, sqlManager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 获取指定UUID的玩家的盔甲
|
||||||
setup = true;
|
setup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user