Bladeren bron

The new URL links can now be disabled in config.yml

nossr50 6 jaren geleden
bovenliggende
commit
adc83d29a7

+ 1 - 0
Changelog.txt

@@ -15,6 +15,7 @@ Version 2.1.0
  + Added links to mcMMO related websites to various commands
  + Certain elements of mcMMO's UI have been restyled
  + Added the tagline "Overhaul Era" to various locations until 3.0.0 comes out
+ + (Config) Added option to disable the new URL links to config.yml
  + (Config) New config file added coreskills.yml
  + (Config) Added rank settings for the new Woodcutting skill
  + (Config) Added configurable parameters for the new Tree Feller

+ 1 - 0
src/main/java/com/gmail/nossr50/config/Config.java

@@ -446,6 +446,7 @@ public class Config extends AutoUpdateConfigLoader {
      */
 
     /* General Settings */
+    public boolean getUrlLinksEnabled() { return config.getBoolean("Commands.Skills.URL_Links"); }
     public boolean getAbilityMessagesEnabled() { return config.getBoolean("Abilities.Messages", true); }
     public boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); }
     public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); }

+ 4 - 0
src/main/java/com/gmail/nossr50/util/TextComponentFactory.java

@@ -2,6 +2,7 @@ package com.gmail.nossr50.util;
 
 import com.gmail.nossr50.commands.skills.McMMOWebLinks;
 import com.gmail.nossr50.config.AdvancedConfig;
+import com.gmail.nossr50.config.Config;
 import com.gmail.nossr50.datatypes.interactions.NotificationType;
 import com.gmail.nossr50.datatypes.json.McMMOUrl;
 import com.gmail.nossr50.datatypes.skills.PrimarySkill;
@@ -32,6 +33,9 @@ public class TextComponentFactory {
     }
 
     public static void sendPlayerUrlHeader(Player player) {
+        if(!Config.getInstance().getUrlLinksEnabled())
+            return;
+
         Player.Spigot spigotPlayer = player.spigot();
 
         if(webComponents != null)

+ 3 - 0
src/main/resources/config.yml

@@ -476,6 +476,9 @@ Double_Drops:
 #  Settings for commands
 ###
 Commands:
+    Skills:
+        # Turn this off to prevent mcMMO URL links from being sent
+        URL_Links: true
     Generic:
         # If true, when using partial names in commands mcMMO will try to look for a match from
         # the offline players. Enabling this might slow the server down if there are a lot of offline players.