Bläddra i källkod

Added some missing config items

nossr50 6 år sedan
förälder
incheckning
1d62f8b177

+ 1 - 25
src/main/java/com/gmail/nossr50/config/AdvancedConfig.java

@@ -695,31 +695,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
     /* Interaction Settings */
     public boolean doesNotificationUseActionBar(NotificationType notificationType)
     {
-        String key = "";
-
-        switch(notificationType)
-        {
-            case XP_GAIN:
-                key = "ExperienceGain";
-                break;
-            case LEVEL_UP_MESSAGE:
-                key = "LevelUp";
-                break;
-            case SUBSKILL_MESSAGE:
-                key = "SubSkillInteraction";
-                break;
-            case SUBSKILL_UNLOCKED:
-                key = "SubSkillUnlocked";
-                break;
-            case TOOL:
-                key = "ToolReady";
-                break;
-            case SUPER_ABILITY:
-                key = "SuperAbilityInteraction";
-                break;
-        }
-
-        return config.getBoolean("Skills.FeedBack.ActionBarNotifications."+key, true);
+        return config.getBoolean("Skills.FeedBack.ActionBarNotifications."+notificationType.toString(), true);
     }
 
     /*

+ 11 - 0
src/main/java/com/gmail/nossr50/listeners/InteractionManager.java

@@ -4,6 +4,7 @@ import com.gmail.nossr50.config.AdvancedConfig;
 import com.gmail.nossr50.datatypes.interactions.NotificationType;
 import com.gmail.nossr50.datatypes.player.McMMOPlayer;
 import com.gmail.nossr50.datatypes.skills.PrimarySkill;
+import com.gmail.nossr50.datatypes.skills.SubSkillType;
 import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
 import com.gmail.nossr50.datatypes.skills.subskills.interfaces.InteractType;
 import com.gmail.nossr50.datatypes.skills.subskills.interfaces.Interaction;
@@ -172,6 +173,16 @@ public class InteractionManager {
         return subSkillList;
     }
 
+    public static boolean hasSubSkill(String name)
+    {
+        return getAbstractByName(name) != null;
+    }
+
+    public static boolean hasSubSkill(SubSkillType subSkillType)
+    {
+        return hasSubSkill(subSkillType.getNiceNameNoSpaces(subSkillType));
+    }
+
     /**
      * Returns the associative map which contains all registered interactions
      * @return the interact register

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

@@ -580,8 +580,8 @@ public class TextComponentFactory {
             {
                 if(Permissions.isSubSkillEnabled(player, subSkillType))
                 {
-                    if(InteractionManager.getInteractRegister().get(subSkillType.getNiceNameNoSpaces(subSkillType)) == null)
-                    textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, subSkillType));
+                    if(!InteractionManager.hasSubSkill(subSkillType))
+                        textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, subSkillType));
                 }
             }
         }

+ 4 - 0
src/main/resources/advanced.yml

@@ -17,11 +17,15 @@ Skills:
     Feedback:
         # Turning these to false will have them printed in chat instead
         ActionBarNotifications:
+            AbilityOff: true
+            LevelRequirementNotMet: true
+            AbilityCoolDown: true
             LevelUps: true
             ToolReady: true
             SubSkillInteraction: true
             SubSkillUnlocked: true
             SuperAbilityInteraction: true
+            SuperAbilityAlertOthers: true
             ExperienceGain: true
     General:
         Ability: