Eventing redone, revision 1

By: durron597 <martin.jared@gmail.com>
This commit is contained in:
Bukkit/Spigot
2010-12-28 10:48:03 +08:00
parent e364e973c7
commit ed3dcbdd2b
8 changed files with 214 additions and 44 deletions

View File

@@ -0,0 +1,47 @@
package org.bukkit.event;
public class EventException extends Exception {
private final Throwable cause;
/**
* Constructs a new EventException based on the given Exception
*
* @param throwable Exception that triggered this Exception
*/
public EventException(Throwable throwable) {
cause = throwable;
}
/**
* Constructs a new EventException
*/
public EventException() {
cause = null;
}
/**
* Constructs a new EventException with the given message
*/
public EventException(Throwable cause, String message) {
super(message);
this.cause = cause;
}
/**
* Constructs a new EventException with the given message
*/
public EventException(String message) {
super(message);
cause = null;
}
/**
* If applicable, returns the Exception that triggered this Exception
*
* @return Inner exception, or null if one does not exist
*/
@Override
public Throwable getCause() {
return cause;
}
}