mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 05:03:55 -07:00
[Bleeding] Specify event name in exception. Addresses BUKKIT-778
By: Feildmaster <admin@feildmaster.com>
This commit is contained in:
@@ -7,24 +7,15 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public abstract class Event implements Serializable {
|
public abstract class Event implements Serializable {
|
||||||
private final String name;
|
private String name;
|
||||||
|
|
||||||
protected Event() {
|
|
||||||
this(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Event(final String name) {
|
|
||||||
if (name == null) {
|
|
||||||
this.name = getClass().getName();
|
|
||||||
} else {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Name of this event
|
* @return Name of this event
|
||||||
*/
|
*/
|
||||||
public final String getEventName() {
|
public String getEventName() {
|
||||||
|
if (name == null) {
|
||||||
|
name = getClass().getSimpleName();
|
||||||
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user