diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/plugin/PluginDescriptionFile.java | 12 | ||||
-rw-r--r-- | src/main/java/org/bukkit/plugin/PluginLogger.java | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java index 34095d52..d00897a6 100644 --- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java @@ -30,6 +30,7 @@ public final class PluginDescriptionFile { private String description = null; private List<String> authors = null; private String website = null; + private String prefix = null; private boolean database = false; private PluginLoadOrder order = PluginLoadOrder.POSTWORLD; private List<Permission> permissions = null; @@ -159,6 +160,10 @@ public final class PluginDescriptionFile { public String getClassLoaderOf() { return classLoaderOf; } + + public String getPrefix() { + return prefix; + } private void loadMap(Map<?, ?> map) throws InvalidDescriptionException { try { @@ -311,6 +316,9 @@ public final class PluginDescriptionFile { } else { permissions = ImmutableList.<Permission>of(); } + if (map.containsKey("prefix")) { + prefix = map.get("prefix").toString(); + } } private Map<String, Object> saveMap() { @@ -348,6 +356,10 @@ public final class PluginDescriptionFile { if (classLoaderOf != null) { map.put("class-loader-of", classLoaderOf); } + + if (prefix != null) { + map.put("prefix", prefix); + } return map; } diff --git a/src/main/java/org/bukkit/plugin/PluginLogger.java b/src/main/java/org/bukkit/plugin/PluginLogger.java index f7324211..21bbfa07 100644 --- a/src/main/java/org/bukkit/plugin/PluginLogger.java +++ b/src/main/java/org/bukkit/plugin/PluginLogger.java @@ -11,7 +11,6 @@ import java.util.logging.Logger; * The API for PluginLogger is exactly the same as {@link java.util.logging.Logger}. */ public class PluginLogger extends Logger { - private String pluginName; /** @@ -20,7 +19,8 @@ public class PluginLogger extends Logger { */ public PluginLogger(Plugin context) { super(context.getClass().getCanonicalName(), null); - pluginName = "[" + context.getDescription().getName() + "] "; + String prefix = context.getDescription().getPrefix(); + pluginName = prefix != null ? new StringBuilder().append("[").append(prefix).append("] ").toString() : "[" + context.getDescription().getName() + "] "; setParent(context.getServer().getLogger()); setLevel(Level.ALL); } |