Fixed guild loading

This commit is contained in:
Indyuce 2020-05-09 19:13:37 +02:00
parent ac17103be8
commit b3f1687aa9
2 changed files with 7 additions and 3 deletions

View File

@ -282,6 +282,11 @@ public class MMOCore extends JavaPlugin {
*/
Bukkit.getOnlinePlayers().forEach(player -> dataProvider.getDataManager().setup(player));
/*
* load guild data after loading player data
*/
dataProvider.getGuildManager().load();
// commands
try {
final Field bukkitCommandMap = Bukkit.getServer().getClass().getDeclaredField("commandMap");

View File

@ -55,6 +55,7 @@ public abstract class GuildDataManager {
return guilds.values();
}
@Deprecated
public void reload() {
for (Guild guild : guilds.values())
save(guild);
@ -75,9 +76,7 @@ public abstract class GuildDataManager {
private GuildConfiguration config;
public GuildConfiguration getConfig() {
if (config == null)
config = new GuildConfiguration();
return config;
return config == null ? config = new GuildConfiguration() : config;
}
public class GuildConfiguration {