mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
new settings for showing patreon, paypal
This commit is contained in:
@ -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()));
|
||||
}
|
||||
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
|
||||
|
||||
mcMMO.getHolidayManager().anniversaryCheck(sender);
|
||||
return true;
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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 {
|
||||
}
|
@ -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 {
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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,21 +87,38 @@ public class TextComponentFactory {
|
||||
|
||||
TextComponent emptySpace = new TextComponent(" ");
|
||||
|
||||
BaseComponent[] baseComponents = {new TextComponent(prefix),
|
||||
getWebLinkTextComponent(McMMOWebLinks.WEBSITE),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.DISCORD),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.PATREON),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.WIKI),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.SPIGOT),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.HELP_TRANSLATE),
|
||||
new TextComponent(suffix)};
|
||||
if(mcMMO.getConfigManager().getConfigAds().isShowPatreonInfo())
|
||||
{
|
||||
BaseComponent[] baseComponents = {new TextComponent(prefix),
|
||||
getWebLinkTextComponent(McMMOWebLinks.WEBSITE),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.DISCORD),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.PATREON),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.WIKI),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.SPIGOT),
|
||||
emptySpace,
|
||||
getWebLinkTextComponent(McMMOWebLinks.HELP_TRANSLATE),
|
||||
new TextComponent(suffix)};
|
||||
|
||||
spigotPlayer.sendMessage(baseComponents);
|
||||
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)
|
||||
|
Reference in New Issue
Block a user