From 020dee2ab0e5966b6ed1cd0bd8d91033f3a1041e Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Sat, 10 Nov 2012 10:55:22 -0500 Subject: [PATCH] Exception messages now formatted better. --- .../java/com/mvplugin/core/MultiverseException.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/base/src/main/java/com/mvplugin/core/MultiverseException.java b/base/src/main/java/com/mvplugin/core/MultiverseException.java index 187477aa..6e8f9b8e 100644 --- a/base/src/main/java/com/mvplugin/core/MultiverseException.java +++ b/base/src/main/java/com/mvplugin/core/MultiverseException.java @@ -1,20 +1,21 @@ package com.mvplugin.core; import com.dumptruckman.minecraft.pluginbase.messaging.BundledMessage; +import com.dumptruckman.minecraft.pluginbase.messaging.ChatColor; public class MultiverseException extends Exception { private final BundledMessage languageMessage; - public MultiverseException(BundledMessage languageMessage) { - super(languageMessage.getMessage().getDefault().get(0)); - this.languageMessage = languageMessage; + public MultiverseException(BundledMessage b) { + super(String.format(ChatColor.translateAlternateColorCodes('&', b.getMessage().getDefault().get(0)), b.getArgs())); + this.languageMessage = b; } - public MultiverseException(BundledMessage languageMessage, Throwable throwable) { - super(languageMessage.getMessage().getDefault().get(0), throwable); - this.languageMessage = languageMessage; + public MultiverseException(BundledMessage b, Throwable throwable) { + super(String.format(ChatColor.translateAlternateColorCodes('&', b.getMessage().getDefault().get(0)), b.getArgs()), throwable); + this.languageMessage = b; } public BundledMessage getBundledMessage() {