mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-10 09:21:31 +01:00
Put default getHandlers back in for backwards compatibility
Without them, too many older addons break. They need updating to have their own handlers. Once that is done, the default ones can be removed maybe.
This commit is contained in:
parent
d3e7b55be5
commit
536d7ef1c3
@ -10,6 +10,8 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
|
||||
@ -21,6 +23,24 @@ import world.bentobox.bentobox.BentoBox;
|
||||
*/
|
||||
public abstract class BentoBoxEvent extends Event {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
/**
|
||||
* This is here just for backwards compatibility. Users of BentoBoxEvent should implement their own getHandlers
|
||||
*/
|
||||
@Override
|
||||
public @NonNull HandlerList getHandlers() {
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is here just for backwards compatibility. Users of BentoBoxEvent should implement their own getHandlers
|
||||
* @return HandlerList
|
||||
*/
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default constructor is defined for cleaner code.
|
||||
* This constructor assumes the BentoBoxEvent is synchronous.
|
||||
|
Loading…
Reference in New Issue
Block a user