Add proper Bukkit API event usage.

This commit is contained in:
BONNe 2020-12-27 21:12:38 +02:00
parent e1f27c88bd
commit 2a31fc9f67
4 changed files with 136 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package world.bentobox.challenges.events;
import org.bukkit.event.HandlerList;
import java.util.UUID; import java.util.UUID;
import world.bentobox.bentobox.api.events.BentoBoxEvent; import world.bentobox.bentobox.api.events.BentoBoxEvent;
@ -127,6 +128,34 @@ public class ChallengeCompletedEvent extends BentoBoxEvent
} }
// ---------------------------------------------------------------------
// Section: Handler methods
// ---------------------------------------------------------------------
/**
* Gets handlers.
*
* @return the handlers
*/
@Override
public HandlerList getHandlers()
{
return ChallengeCompletedEvent.handlers;
}
/**
* Gets handlers.
*
* @return the handlers
*/
public static HandlerList getHandlerList()
{
return ChallengeCompletedEvent.handlers;
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Section: Variables // Section: Variables
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@ -151,4 +180,9 @@ public class ChallengeCompletedEvent extends BentoBoxEvent
* Count of completions * Count of completions
*/ */
private int completionCount; private int completionCount;
/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
} }

View File

@ -1,6 +1,7 @@
package world.bentobox.challenges.events; package world.bentobox.challenges.events;
import org.bukkit.event.HandlerList;
import java.util.UUID; import java.util.UUID;
import world.bentobox.bentobox.api.events.BentoBoxEvent; import world.bentobox.bentobox.api.events.BentoBoxEvent;
@ -125,6 +126,34 @@ public class ChallengeResetAllEvent extends BentoBoxEvent
} }
// ---------------------------------------------------------------------
// Section: Handler methods
// ---------------------------------------------------------------------
/**
* Gets handlers.
*
* @return the handlers
*/
@Override
public HandlerList getHandlers()
{
return ChallengeResetAllEvent.handlers;
}
/**
* Gets handlers.
*
* @return the handlers
*/
public static HandlerList getHandlerList()
{
return ChallengeResetAllEvent.handlers;
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Section: Variables // Section: Variables
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@ -149,4 +178,9 @@ public class ChallengeResetAllEvent extends BentoBoxEvent
* Reset Reason * Reset Reason
*/ */
private String reason; private String reason;
/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
} }

View File

@ -1,6 +1,7 @@
package world.bentobox.challenges.events; package world.bentobox.challenges.events;
import org.bukkit.event.HandlerList;
import java.util.UUID; import java.util.UUID;
import world.bentobox.bentobox.api.events.BentoBoxEvent; import world.bentobox.bentobox.api.events.BentoBoxEvent;
@ -122,6 +123,34 @@ public class ChallengeResetEvent extends BentoBoxEvent
} }
// ---------------------------------------------------------------------
// Section: Handler methods
// ---------------------------------------------------------------------
/**
* Gets handlers.
*
* @return the handlers
*/
@Override
public HandlerList getHandlers()
{
return ChallengeResetEvent.handlers;
}
/**
* Gets handlers.
*
* @return the handlers
*/
public static HandlerList getHandlerList()
{
return ChallengeResetEvent.handlers;
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Section: Variables // Section: Variables
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@ -146,4 +175,9 @@ public class ChallengeResetEvent extends BentoBoxEvent
* Reset Reason * Reset Reason
*/ */
private String reason; private String reason;
/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
} }

View File

@ -1,6 +1,7 @@
package world.bentobox.challenges.events; package world.bentobox.challenges.events;
import org.bukkit.event.HandlerList;
import java.util.UUID; import java.util.UUID;
import world.bentobox.bentobox.api.events.BentoBoxEvent; import world.bentobox.bentobox.api.events.BentoBoxEvent;
@ -101,6 +102,34 @@ public class LevelCompletedEvent extends BentoBoxEvent
} }
// ---------------------------------------------------------------------
// Section: Handler methods
// ---------------------------------------------------------------------
/**
* Gets handlers.
*
* @return the handlers
*/
@Override
public HandlerList getHandlers()
{
return LevelCompletedEvent.handlers;
}
/**
* Gets handlers.
*
* @return the handlers
*/
public static HandlerList getHandlerList()
{
return LevelCompletedEvent.handlers;
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Section: Variables // Section: Variables
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@ -120,4 +149,9 @@ public class LevelCompletedEvent extends BentoBoxEvent
* Indicates if admin completes challenge * Indicates if admin completes challenge
*/ */
private boolean admin; private boolean admin;
/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
} }