Selaa lähdekoodia

Allow mod name to go in the middle or at the beginning.

GJ 11 vuotta sitten
vanhempi
sitoutus
abfedf381d

+ 1 - 1
Changelog.txt

@@ -20,7 +20,7 @@ Version 1.4.08-dev
  + Added new experience bonus perk 'mcmmo.perks.xp.10percentboost.<skillname>' multiplies incoming XP by 1.1
  + Added new experience bonus perk 'mcmmo.perks.xp.customboost.<skillname>' multiplies incoming XP by the boost amount defined in the experience config
  + Added Ender Dragon, Wither, and Witch to combat experience multipliers - they do not give XP by default
- + Added support for multiple mod config files, naming is done in the same style as repair.*.yml (blocks.*.yml, tools.*.yml, entities.*.yml, armor.*.yml)
+ + Added support for multiple mod config files, naming can be done as either armor.<modname>.yml or <modname>.armor.yml
  = Fixed bug where LeafBlower permissions were ignored
  = Fixed bug with toggle commands not properly displaying the success message.
  = Fixed IllegalArgumentException caused by an empty Fishing treasure category

+ 3 - 2
src/main/java/com/gmail/nossr50/config/mods/ArmorConfigManager.java

@@ -8,7 +8,8 @@ import java.util.regex.Pattern;
 
 public class ArmorConfigManager {
     public ArmorConfigManager(mcMMO plugin) {
-        Pattern pattern = Pattern.compile("armor\\.(?:.+)\\.yml");
+        Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml");
+        Pattern startPattern = Pattern.compile("(?:.+)\\.armor\\.yml");
         File dataFolder = new File(mcMMO.getModDirectory());
         File vanilla = new File(dataFolder, "armor.default.yml");
         ModManager modManager = mcMMO.getModManager();
@@ -18,7 +19,7 @@ public class ArmorConfigManager {
         }
 
         for (String fileName : dataFolder.list()) {
-            if (!pattern.matcher(fileName).matches()) {
+            if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
                 continue;
             }
 

+ 3 - 2
src/main/java/com/gmail/nossr50/config/mods/BlockConfigManager.java

@@ -8,7 +8,8 @@ import java.util.regex.Pattern;
 
 public class BlockConfigManager {
     public BlockConfigManager(mcMMO plugin) {
-        Pattern pattern = Pattern.compile("blocks\\.(?:.+)\\.yml");
+        Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml");
+        Pattern startPattern = Pattern.compile("(?:.+)\\.blocks\\.yml");
         File dataFolder = new File(mcMMO.getModDirectory());
         File vanilla = new File(dataFolder, "blocks.default.yml");
         ModManager modManager = mcMMO.getModManager();
@@ -18,7 +19,7 @@ public class BlockConfigManager {
         }
 
         for (String fileName : dataFolder.list()) {
-            if (!pattern.matcher(fileName).matches()) {
+            if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
                 continue;
             }
 

+ 3 - 2
src/main/java/com/gmail/nossr50/config/mods/EntityConfigManager.java

@@ -8,7 +8,8 @@ import java.util.regex.Pattern;
 
 public class EntityConfigManager {
     public EntityConfigManager(mcMMO plugin) {
-        Pattern pattern = Pattern.compile("entities\\.(?:.+)\\.yml");
+        Pattern middlePattern = Pattern.compile("entities\\.(?:.+)\\.yml");
+        Pattern startPattern = Pattern.compile("(?:.+)\\.entities\\.yml");
         File dataFolder = new File(mcMMO.getModDirectory());
         File vanilla = new File(dataFolder, "entities.default.yml");
         ModManager modManager = mcMMO.getModManager();
@@ -18,7 +19,7 @@ public class EntityConfigManager {
         }
 
         for (String fileName : dataFolder.list()) {
-            if (!pattern.matcher(fileName).matches()) {
+            if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
                 continue;
             }
 

+ 3 - 2
src/main/java/com/gmail/nossr50/config/mods/ToolConfigManager.java

@@ -8,7 +8,8 @@ import java.util.regex.Pattern;
 
 public class ToolConfigManager {
     public ToolConfigManager(mcMMO plugin) {
-        Pattern pattern = Pattern.compile("tools\\.(?:.+)\\.yml");
+        Pattern middlePattern = Pattern.compile("tools\\.(?:.+)\\.yml");
+        Pattern startPattern = Pattern.compile("(?:.+)\\.tools\\.yml");
         File dataFolder = new File(mcMMO.getModDirectory());
         File vanilla = new File(dataFolder, "tools.default.yml");
         ModManager modManager = mcMMO.getModManager();
@@ -18,7 +19,7 @@ public class ToolConfigManager {
         }
 
         for (String fileName : dataFolder.list()) {
-            if (!pattern.matcher(fileName).matches()) {
+            if (!middlePattern.matcher(fileName).matches() && !startPattern.matcher(fileName).matches()) {
                 continue;
             }