mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Add new config for events
This commit is contained in:
parent
9c5ec234d9
commit
ca8293bc35
@ -7,6 +7,7 @@ import com.gmail.nossr50.config.hocon.backup.ConfigAutomatedBackups;
|
|||||||
import com.gmail.nossr50.config.hocon.commands.ConfigCommands;
|
import com.gmail.nossr50.config.hocon.commands.ConfigCommands;
|
||||||
import com.gmail.nossr50.config.hocon.database.ConfigDatabase;
|
import com.gmail.nossr50.config.hocon.database.ConfigDatabase;
|
||||||
import com.gmail.nossr50.config.hocon.donation.ConfigAuthorAdvertisements;
|
import com.gmail.nossr50.config.hocon.donation.ConfigAuthorAdvertisements;
|
||||||
|
import com.gmail.nossr50.config.hocon.event.ConfigEvent;
|
||||||
import com.gmail.nossr50.config.hocon.experience.ConfigExperience;
|
import com.gmail.nossr50.config.hocon.experience.ConfigExperience;
|
||||||
import com.gmail.nossr50.config.hocon.hardcore.ConfigHardcore;
|
import com.gmail.nossr50.config.hocon.hardcore.ConfigHardcore;
|
||||||
import com.gmail.nossr50.config.hocon.items.ConfigItems;
|
import com.gmail.nossr50.config.hocon.items.ConfigItems;
|
||||||
@ -95,6 +96,7 @@ public final class ConfigManager {
|
|||||||
private SerializedConfigLoader<ConfigMobs> configMobs;
|
private SerializedConfigLoader<ConfigMobs> configMobs;
|
||||||
private SerializedConfigLoader<ConfigExperience> configExperience;
|
private SerializedConfigLoader<ConfigExperience> configExperience;
|
||||||
private SerializedConfigLoader<ConfigCoreSkills> configCoreSkills;
|
private SerializedConfigLoader<ConfigCoreSkills> configCoreSkills;
|
||||||
|
private SerializedConfigLoader<ConfigEvent> configEvent;
|
||||||
private SerializedConfigLoader<ConfigNameRegisterDefaults> configDefaultExamples;
|
private SerializedConfigLoader<ConfigNameRegisterDefaults> configDefaultExamples;
|
||||||
|
|
||||||
private ConfigAcrobatics configAcrobatics;
|
private ConfigAcrobatics configAcrobatics;
|
||||||
@ -179,6 +181,7 @@ public final class ConfigManager {
|
|||||||
configMobs = new SerializedConfigLoader<>(ConfigMobs.class, "creatures.conf", "Creatures", null);
|
configMobs = new SerializedConfigLoader<>(ConfigMobs.class, "creatures.conf", "Creatures", null);
|
||||||
configExperience = new SerializedConfigLoader<>(ConfigExperience.class, "experience.conf", "Experience", null);
|
configExperience = new SerializedConfigLoader<>(ConfigExperience.class, "experience.conf", "Experience", null);
|
||||||
configCoreSkills = new SerializedConfigLoader<>(ConfigCoreSkills.class, "core_skills.conf", "Core-Skills", null);
|
configCoreSkills = new SerializedConfigLoader<>(ConfigCoreSkills.class, "core_skills.conf", "Core-Skills", null);
|
||||||
|
configEvent = new SerializedConfigLoader<>(ConfigEvent.class, "events.conf", "Events", null);
|
||||||
|
|
||||||
configDefaultExamples = new SerializedConfigLoader<>(ConfigNameRegisterDefaults.class, "minecraft_item_block_name_examples.conf", "Minecraft", null);
|
configDefaultExamples = new SerializedConfigLoader<>(ConfigNameRegisterDefaults.class, "minecraft_item_block_name_examples.conf", "Minecraft", null);
|
||||||
initSerializedSkillConfigs();
|
initSerializedSkillConfigs();
|
||||||
@ -476,6 +479,10 @@ public final class ConfigManager {
|
|||||||
return configSalvage;
|
return configSalvage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConfigEvent getConfigEvent() {
|
||||||
|
return configEvent.getConfig();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this plugin is using retro mode
|
* Checks if this plugin is using retro mode
|
||||||
* Retro mode is a 0-1000 skill system
|
* Retro mode is a 0-1000 skill system
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.gmail.nossr50.config.hocon.event;
|
||||||
|
|
||||||
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
|
|
||||||
|
@ConfigSerializable
|
||||||
|
public class ConfigEvent {
|
||||||
|
|
||||||
|
@Setting(value = "XP-Rate-Event", comment = "Settings relating to XP rate events")
|
||||||
|
public ConfigEventExperienceRate xpRate = new ConfigEventExperienceRate();
|
||||||
|
|
||||||
|
public ConfigEventExperienceRate getXpRate() {
|
||||||
|
return xpRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowXPRateInfoOnPlayerJoin() {
|
||||||
|
return xpRate.isShowXPRateInfoOnPlayerJoin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBroadcastXPRateEventMessages() {
|
||||||
|
return xpRate.isBroadcastXPRateEventMessages();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.gmail.nossr50.config.hocon.event;
|
||||||
|
|
||||||
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
|
|
||||||
|
@ConfigSerializable
|
||||||
|
public class ConfigEventExperienceRate {
|
||||||
|
|
||||||
|
public static final boolean SHOW_XP_RATE_ON_JOIN_DEFAULT = true;
|
||||||
|
public static final boolean BROADCAST_EVENT_MESSAGES_DEFAULT = true;
|
||||||
|
|
||||||
|
@Setting(value = "Show-Details-On-Player-Join", comment = "Show players info about ongoing XP rate events when they join the server." +
|
||||||
|
"\nDefault value: "+SHOW_XP_RATE_ON_JOIN_DEFAULT)
|
||||||
|
private boolean showXPRateInfoOnPlayerJoin = SHOW_XP_RATE_ON_JOIN_DEFAULT;
|
||||||
|
|
||||||
|
@Setting(value = "Broadcast-Event-Messages", comment = "Whether or not to broadcast info about the event to players on the server" +
|
||||||
|
"\nA broadcast is a message sent to all players connected to the server" +
|
||||||
|
"\nDefault value: "+BROADCAST_EVENT_MESSAGES_DEFAULT)
|
||||||
|
private boolean broadcastXPRateEventMessages = BROADCAST_EVENT_MESSAGES_DEFAULT;
|
||||||
|
|
||||||
|
public boolean isShowXPRateInfoOnPlayerJoin() {
|
||||||
|
return showXPRateInfoOnPlayerJoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBroadcastXPRateEventMessages() {
|
||||||
|
return broadcastXPRateEventMessages;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user