Exception messages now formatted better.

This commit is contained in:
Jeremy Wood 2012-11-10 10:55:22 -05:00
parent 40fff5c241
commit 020dee2ab0

View File

@ -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() {