mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Convert Party data to HOCON serialization
This commit is contained in:
parent
16d4c160c6
commit
b0b326d080
@ -19,6 +19,7 @@ import com.gmail.nossr50.config.hocon.motd.ConfigMOTD;
|
||||
import com.gmail.nossr50.config.hocon.notifications.ConfigNotifications;
|
||||
import com.gmail.nossr50.config.hocon.particles.ConfigParticles;
|
||||
import com.gmail.nossr50.config.hocon.party.ConfigParty;
|
||||
import com.gmail.nossr50.config.hocon.party.data.ConfigPartyData;
|
||||
import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling;
|
||||
import com.gmail.nossr50.config.hocon.scoreboard.ConfigScoreboard;
|
||||
import com.gmail.nossr50.config.hocon.superabilities.ConfigSuperAbilities;
|
||||
@ -103,6 +104,9 @@ public final class ConfigManager {
|
||||
private SerializedConfigLoader<ConfigSuperAbilities> configSuperAbilities;
|
||||
private SerializedConfigLoader<ConfigAdmin> configAdmin;
|
||||
|
||||
//Data
|
||||
private SerializedConfigLoader<ConfigPartyData> partyData;
|
||||
|
||||
private MainConfig mainConfig;
|
||||
private FishingTreasureConfig fishingTreasureConfig;
|
||||
private ExcavationTreasureConfig excavationTreasureConfig;
|
||||
@ -161,6 +165,9 @@ public final class ConfigManager {
|
||||
configSuperAbilities = new SerializedConfigLoader<>(ConfigSuperAbilities.class, "skill_super_abilities.conf", null);
|
||||
configAdmin = new SerializedConfigLoader<>(ConfigAdmin.class, "admin.conf", null);
|
||||
|
||||
//Serialized Data
|
||||
partyData = new SerializedConfigLoader<>(ConfigPartyData.class, "partydata.conf", null);
|
||||
|
||||
//Assign Maps
|
||||
partyItemWeights = Maps.newHashMap(configParty.getConfig().getPartyItemShare().getItemShareMap()); //Item Share Weights
|
||||
partyFeatureUnlocks = Maps.newHashMap(configParty.getConfig().getPartyXP().getPartyLevel().getPartyFeatureUnlockMap()); //Party Progression
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.gmail.nossr50.config.hocon.party.data;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigPartyData {
|
||||
|
||||
@Setting(value = "Parties")
|
||||
private HashMap<String, ConfigPartyDataStore> partyName = new HashMap<>();
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.gmail.nossr50.config.hocon.party.data;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.ShareMode;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigPartyDataStore {
|
||||
@Setting(value = "Party-Leader")
|
||||
private UUID partyLeader;
|
||||
|
||||
@Setting(value = "Party-Members")
|
||||
private ArrayList<UUID> partyMembers;
|
||||
|
||||
@Setting(value = "Party-Name")
|
||||
private String partyName;
|
||||
|
||||
@Setting(value = "Party-XP-Share-Mode")
|
||||
private ShareMode partyXPShareMode;
|
||||
|
||||
@Setting(value = "Party-Level")
|
||||
private int partyLevel;
|
||||
|
||||
@Setting(value = "Party-XP")
|
||||
private int partyXP;
|
||||
|
||||
@Setting(value = "Party-Locked")
|
||||
private boolean partyLocked;
|
||||
|
||||
@Setting(value = "Party-Password")
|
||||
private String partyPassword;
|
||||
|
||||
@Setting(value = "Party-Item-Share-Mode")
|
||||
private ShareMode partyItemShareMode;
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.gmail.nossr50.config.hocon.party.data;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigPartyMemberData {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user