new settings for showing patreon, paypal

This commit is contained in:
nossr50 2019-03-14 20:06:26 -07:00
parent 2001ef30ee
commit e57bf35e5e
11 changed files with 81 additions and 61 deletions

View File

@ -20,11 +20,24 @@ Version 2.2.0
Fixed a bug where players who started at level 1 would not be purged from the DB for being "powerless"
Fixed a potential bug where players could be awarded XP for cancelled tame events
Permission Node Changes
Removed "mcmmo.motd" because it makes no sense to have this as a player permission when its a config option
Removed "mcmmo.showversion" because this one also makes no sense
Config Changes
All author ad-type (donations, urls, etc) message config options will now be found in "author_support_advertisements.conf"
Config option "URL_Links" renamed -> "Show-Website-Links"
Added config option for showing author paypal info in /mcmmo (previously this was tied to the motd setting)
Added config option for showing author patreon links in various commands
MOTD (Message of the day) config options will now be found in "motd.conf"
MOTD's "MOTD_Enabled" renamed -> "Show-MOTD-On-Player-Join"
Anonymous statistic config options will now be found in "analytics_reporting.conf"
Hardcore config options will now be found in "hardcore.conf"
Exploit related config options will now be found in "exploit-prevention"
Exploit Prevention's "EndermanEndermiteFarms" renamed -> "Endermen-Endermite-Fix"
Added toggle for pistons marking natural blocks as unnatural after being moved to prevent afk stone farms

View File

@ -24,14 +24,12 @@ public class McmmoCommand implements CommandExecutor {
String[] mcSplit = description.split(",");
sender.sendMessage(mcSplit);
if (MainConfig.getInstance().getDonateMessageEnabled()) {
if (mcMMO.getConfigManager().getConfigAds().isShowDonationInfo()) {
sender.sendMessage(LocaleLoader.getString("MOTD.Donate"));
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "nossr50@gmail.com" + ChatColor.GOLD + " Paypal");
}
if (Permissions.showversion(sender)) {
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
}
mcMMO.getHolidayManager().anniversaryCheck(sender);
return true;

View File

@ -100,7 +100,7 @@ public abstract class SkillCommand implements TabExecutor {
//Link Header
if(MainConfig.getInstance().getUrlLinksEnabled())
if(mcMMO.getConfigManager().getConfigAds().isShowWebsiteLinks())
{
player.sendMessage(LocaleLoader.getString("Overhaul.mcMMO.Header"));
TextComponentFactory.sendPlayerUrlHeader(player);

View File

@ -6,6 +6,9 @@ import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.config.hocon.SerializedConfigLoader;
import com.gmail.nossr50.config.hocon.antiexploit.ConfigExploitPrevention;
import com.gmail.nossr50.config.hocon.database.ConfigDatabase;
import com.gmail.nossr50.config.hocon.donation.ConfigAuthorAdvertisements;
import com.gmail.nossr50.config.hocon.hardcore.ConfigHardcore;
import com.gmail.nossr50.config.hocon.metrics.ConfigMetrics;
import com.gmail.nossr50.config.hocon.motd.ConfigMOTD;
import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling;
import com.gmail.nossr50.config.hocon.scoreboard.ConfigScoreboard;
@ -70,7 +73,10 @@ public final class ConfigManager {
private SerializedConfigLoader<ConfigLeveling> configLeveling;
private SerializedConfigLoader<ConfigWorldBlacklist> configWorldBlacklist;
private SerializedConfigLoader<ConfigExploitPrevention> configExploitPrevention;
private SerializedConfigLoader<ConfigHardcore> configHardcore;
private SerializedConfigLoader<ConfigMetrics> configMetrics;
private SerializedConfigLoader<ConfigMOTD> configMOTD;
private SerializedConfigLoader<ConfigAuthorAdvertisements> configAuthorAdvertisements;
private MainConfig mainConfig;
private FishingTreasureConfig fishingTreasureConfig;
private ExcavationTreasureConfig excavationTreasureConfig;
@ -108,6 +114,9 @@ public final class ConfigManager {
configWorldBlacklist = new SerializedConfigLoader<>(ConfigWorldBlacklist.class, "world_blacklist.conf", null);
configExploitPrevention = new SerializedConfigLoader<>(ConfigExploitPrevention.class, "exploit_prevention.conf", null);
configMOTD = new SerializedConfigLoader<>(ConfigMOTD.class, "message_of_the_day.conf", null);
configHardcore = new SerializedConfigLoader<>(ConfigHardcore.class, "hardcore_mode.conf", null);
configMetrics = new SerializedConfigLoader<>(ConfigMetrics.class, "analytics_reporting.conf", null);
configAuthorAdvertisements = new SerializedConfigLoader<>(ConfigAuthorAdvertisements.class, "author_support_advertisements.conf", null);
mainConfig = new MainConfig();
@ -134,26 +143,6 @@ public final class ConfigManager {
salvageConfig = new SalvageConfig();
/*if (MainConfig.getInstance().getToolModsEnabled()) {
new ToolConfigManager();
}
if (MainConfig.getInstance().getArmorModsEnabled()) {
new ArmorConfigManager();
}
if (MainConfig.getInstance().getBlockModsEnabled()) {
new BlockConfigManager();
}
if (MainConfig.getInstance().getEntityModsEnabled()) {
new EntityConfigManager();
}*/
// Multi Config Containers
//initMultiConfigContainers();
/*
* Managers
*/
@ -341,4 +330,16 @@ public final class ConfigManager {
public ConfigMOTD getConfigMOTD() {
return configMOTD.getConfig();
}
public ConfigHardcore getConfigHardcore() {
return configHardcore.getConfig();
}
public ConfigMetrics getConfigMetrics() {
return configMetrics.getConfig();
}
public ConfigAuthorAdvertisements getConfigAds() {
return configAuthorAdvertisements.getConfig();
}
}

View File

@ -453,10 +453,6 @@ public class MainConfig extends ConfigValidated {
return "en_US";
}
public boolean getMOTDEnabled() {
return getBooleanValue(GENERAL, MOTD + ENABLED);
}
public boolean getShowProfileLoadedMessage() {
return getBooleanValue(GENERAL, SHOW_PROFILE_LOADED);
}
@ -799,10 +795,6 @@ public class MainConfig extends ConfigValidated {
*/
/* General Settings */
public boolean getUrlLinksEnabled() {
return getBooleanValue(COMMANDS, SKILLS, URL_LINKS);
}
public boolean getAbilityMessagesEnabled() {
return getBooleanValue(ABILITIES, MESSAGES);
}

View File

@ -24,7 +24,8 @@ public class ConfigSectionGeneral {
private boolean pistonsMarkBlocksUnnatural = PISTONS_MARK_BLOCKS_DEFAULT;
@Setting(value = "Spawned-Mobs-Have-Modified-XP-Values",
comment = "Spawned mobs will give different XP values than their naturally spawning counterparts" +
comment =
"Spawned mobs will give different XP values than their naturally spawning counterparts" +
"\nBy default, spawned mob XP is reduced to zero, but you could change it in the experience config to whatever you want." +
"\nSpawned mobs include mobs spawned from a nether portal, mob spawner, or eggs." +
"\nThis will not include mobs spawned from commands, typically." +
@ -32,7 +33,9 @@ public class ConfigSectionGeneral {
private boolean markSpawnedMobs = SPAWNED_MOBS_DEFAULT;
@Setting(value = "Tamed-Entities-Have-Modified-XP-Values",
comment = "Prevents tamed entities from giving combat XP when struck by players" +
comment =
"Prevents tamed entities from giving normal combat XP when struck by players" +
"\nBy default, combat XP from tamed mobs is reduced to zero, but you could change it in the experience config to whatever you want." +
"\nIt's hard to imagine this being abused, but we disable it anyways." +
"\nTamed entities get marked in the same way that spawned mobs do, so they are affected by the same XP modifiers." +
"\nDefault value: "+TAMED_MOB_DEFAULT)

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.config.hocon;
package com.gmail.nossr50.config.hocon.hardcore;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class Metrics {
public class ConfigHardcore {
}

View File

@ -1,7 +1,8 @@
package com.gmail.nossr50.config.hocon;
package com.gmail.nossr50.config.hocon.metrics;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class Hardcore {
public class ConfigMetrics {
}

View File

@ -487,7 +487,7 @@ public class PlayerListener implements Listener {
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
if (MainConfig.getInstance().getMOTDEnabled() && Permissions.motd(player)) {
if (mcMMO.getConfigManager().getConfigMOTD().isEnableMOTD()) {
Motd.displayAll(player);
}

View File

@ -10,6 +10,7 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.listeners.InteractionManager;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.skills.RankUtils;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.ChatMessageType;
@ -57,7 +58,7 @@ public class TextComponentFactory {
public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted)
{
if(!MainConfig.getInstance().getUrlLinksEnabled())
if(!mcMMO.getConfigManager().getConfigAds().isShowWebsiteLinks())
return;
Player.Spigot spigotPlayer = player.spigot();
@ -86,6 +87,8 @@ public class TextComponentFactory {
TextComponent emptySpace = new TextComponent(" ");
if(mcMMO.getConfigManager().getConfigAds().isShowPatreonInfo())
{
BaseComponent[] baseComponents = {new TextComponent(prefix),
getWebLinkTextComponent(McMMOWebLinks.WEBSITE),
emptySpace,
@ -101,6 +104,21 @@ public class TextComponentFactory {
new TextComponent(suffix)};
spigotPlayer.sendMessage(baseComponents);
} else {
BaseComponent[] baseComponents = {new TextComponent(prefix),
getWebLinkTextComponent(McMMOWebLinks.WEBSITE),
emptySpace,
getWebLinkTextComponent(McMMOWebLinks.DISCORD),
emptySpace,
getWebLinkTextComponent(McMMOWebLinks.WIKI),
emptySpace,
getWebLinkTextComponent(McMMOWebLinks.SPIGOT),
emptySpace,
getWebLinkTextComponent(McMMOWebLinks.HELP_TRANSLATE),
new TextComponent(suffix)};
spigotPlayer.sendMessage(baseComponents);
}
}
public static void sendPlayerSubSkillList(Player player, List<TextComponent> textComponents)

View File

@ -728,8 +728,6 @@ permissions:
description: Allows participation in admin chat
mcmmo.chat.partychat:
description: Allows participation in party chat
mcmmo.motd:
description: Allows access to the motd
mcmmo.commands.*:
default: false
description: Implies all mcmmo.commands permissions.
@ -1241,7 +1239,6 @@ permissions:
children:
mcmmo.chat.partychat: true
mcmmo.commands.defaults: true
mcmmo.motd: true
mcmmo.skills.all: true
mcmmo.defaultsop:
default: op
@ -2009,9 +2006,6 @@ permissions:
children:
mcmmo.ability.woodcutting.all: true
mcmmo.commands.woodcutting: true
mcmmo.showversion:
default: true
description: Show mcMMO version number in /mcmmo and motd
mcmmo.tools.*:
default: false
description: Implies all mcmmo.tools permissions.