update config settings

This commit is contained in:
Lennart ten Wolde 2016-03-19 14:44:27 +01:00
parent 4f9f2f2d12
commit 7d68789cf2
6 changed files with 66 additions and 8 deletions

View file

@ -153,6 +153,12 @@
<include>com.lenis0012.updater:updater-spigot</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.lenis0012.updater</pattern>
<shadedPattern>com.lenis0012.bukkit.marriage2.libs.updater</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>

View file

@ -1,6 +1,6 @@
package com.lenis0012.bukkit.marriage2;
import com.lenis0012.bukkit.marriage2.internal.MarriagePlugin;
import com.lenis0012.bukkit.marriage2.config.Settings;
public enum Gender {
/**
@ -15,11 +15,20 @@ public enum Gender {
* Not set
*/
UNKNOWN;
/**
* Get chat prefix for gender.
*
* @return Chat prefix
*/
public String getChatPrefix() {
switch(this) {
case MALE:
return Settings.PREFIX_MALE.value();
case FEMALE:
return Settings.PREFIX_FEMALE.value();
default:
return MarriagePlugin.getCore().getBukkitConfig("config.yml").get(toString().toLowerCase(), String.class);
return Settings.PREFIX_GENDERLESS.value();
}
}
}

View file

@ -20,12 +20,17 @@ public class Settings {
*/
@ConfigHeader(path = "chat", value = {
"Chat, set the format of private messages and in-chat status.",
"Supported tags for chat: {heart}, {partner}. for pm: {heart}, {name}, {message}",
"If you use a custom chat plugin, put {marriage_status} in the format and set force-status-format to false"
"Supported tags for chat: {partner}. for pm: {name}, {message}",
"Icons are always available: {icon:heart}, {icon:male}, {icon:female}, {icon:genderless}",
"If you use a custom chat plugin, put {marriage_status} in the format and set force-status-format to false",
"To show genders in chat, put {marriage_gender} in chat plugin format"
})
public static final ConfigOption<String> PM_FORMAT = new ConfigOption<>("chat.pm-format", "&4{heart}&c{name}&4{heart} &7{message}");
public static final ConfigOption<String> PM_FORMAT = new ConfigOption<>("chat.pm-format", "&4{icon:heart}&c{name}&4{icon:heart} &7{message}");
public static final ConfigOption<String> CHAT_FORMAT = new ConfigOption<>("chat.status-format", "&4&l<3 &r");
public static final ConfigOption<Boolean> FORCE_FORMAT = new ConfigOption<>("chat.force-status-format", true);
public static final ConfigOption<String> PREFIX_MALE = new ConfigOption<>("chat.male-prefix", "&b{icon:male} &r");
public static final ConfigOption<String> PREFIX_FEMALE = new ConfigOption<>("chat.female-prefix", "&d{icon:female} &r");
public static final ConfigOption<String> PREFIX_GENDERLESS = new ConfigOption<>("chat.genderless-prefix", "");
/**
* Kissing
@ -49,12 +54,29 @@ public class Settings {
public static final ConfigOption<Double> PRICE_SETHOME = new ConfigOption<>("economy.sethome-price", 0.0);
public static final ConfigOption<Double> PRICE_DIVORCE = new ConfigOption<>("economy.divorce-price", 0.0);
/**
* Sharing
*/
// @ConfigHeader(path = "share", value = {
// "Change these values to configure sharing.",
// "Sharing must be enabled by the partners using /marry share inventory/money",
// "",
// "Economy sharing | Supported plugins: None.",
// "Inventory sharing | Supported versions: 1.9"
// })
// public static final ConfigOption<Boolean> SHARE_INV_ENABLED = new ConfigOption<>("share.inventory.enabled", true);
// public static final ConfigOption<Boolean> SHARE_ECON_ENABLED = new ConfigOption<>("share.economy.enabled", true);
// @ConfigHeader("Supported: TAKE_ALL, SPLIT_EVENLY, SPLIT_FAIRLY, SPLIT_ORIGINALLY")
// public static final ConfigOption<String> SHARE_ECON_SPLIT = new ConfigOption<>("share.economy.split", "SPLIT_EVENLY");
/**
* Updater
*/
@ConfigHeader(path = "updater", value = {
"Updater settings, checks for updates. We recommend to keep this enabled."
"Updater settings, checks for updates. We recommend to keep this enabled.",
"Available channels: RELEASE, BETA, ALPHA"
})
public static final ConfigOption<Boolean> ENABLE_UPDATE_CHACKER = new ConfigOption<>("updater.enabled", true);
public static final ConfigOption<Boolean> ENABLE_CHANGELOG = new ConfigOption<>("updater.changelog", true);
public static final ConfigOption<String> UPDATER_CHANNEL = new ConfigOption<>("updater.channel", "BETA");
}

View file

@ -10,6 +10,7 @@ import com.lenis0012.bukkit.marriage2.config.Permissions;
import com.lenis0012.bukkit.marriage2.internal.Register.Type;
import com.lenis0012.bukkit.marriage2.internal.data.DataConverter;
import com.lenis0012.pluginutils.modules.configuration.ConfigurationModule;
import com.lenis0012.updater.api.ReleaseType;
import com.lenis0012.updater.api.Updater;
import com.lenis0012.updater.api.UpdaterFactory;
import org.bukkit.Bukkit;
@ -84,6 +85,7 @@ public class MarriageCore extends MarriageBase {
public void loadUpdater() {
UpdaterFactory factory = new UpdaterFactory(plugin);
this.updater = factory.newUpdater(plugin.getPluginFile(), Settings.ENABLE_UPDATE_CHACKER.value());
updater.setChannel(ReleaseType.valueOf(Settings.UPDATER_CHANNEL.value().toUpperCase()));
}
@Register(name = "converter", type = Register.Type.ENABLE, priority = 10)

View file

@ -9,7 +9,6 @@ import com.google.common.collect.Lists;
import com.lenis0012.pluginutils.PluginHolder;
import com.lenis0012.pluginutils.modules.configuration.ConfigurationModule;
import com.lenis0012.pluginutils.modules.packets.PacketModule;
import org.bukkit.plugin.java.JavaPlugin;
import com.lenis0012.bukkit.marriage2.Marriage;

View file

@ -0,0 +1,20 @@
package com.lenis0012.bukkit.marriage2.modules.invsharing;
import com.lenis0012.bukkit.marriage2.internal.MarriagePlugin;
import com.lenis0012.pluginutils.Module;
public class InventorySharing extends Module<MarriagePlugin> {
public InventorySharing(MarriagePlugin plugin) {
super(plugin);
}
@Override
public void enable() {
}
@Override
public void disable() {
}
}