Skip to content

Commit

Permalink
Add proper Bukkit API event usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Dec 27, 2020
1 parent e1f27c8 commit 2a31fc9
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@



import org.bukkit.event.HandlerList;
import java.util.UUID;

import world.bentobox.bentobox.api.events.BentoBoxEvent;
Expand Down Expand Up @@ -127,6 +128,34 @@ public void setCompletionCount(int completionCount)
}


// ---------------------------------------------------------------------
// 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
// ---------------------------------------------------------------------
Expand All @@ -151,4 +180,9 @@ public void setCompletionCount(int completionCount)
* Count of completions
*/
private int completionCount;

/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package world.bentobox.challenges.events;


import org.bukkit.event.HandlerList;
import java.util.UUID;

import world.bentobox.bentobox.api.events.BentoBoxEvent;
Expand Down Expand Up @@ -125,6 +126,34 @@ public void setReason(String reason)
}


// ---------------------------------------------------------------------
// 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
// ---------------------------------------------------------------------
Expand All @@ -149,4 +178,9 @@ public void setReason(String reason)
* Reset Reason
*/
private String reason;

/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package world.bentobox.challenges.events;


import org.bukkit.event.HandlerList;
import java.util.UUID;

import world.bentobox.bentobox.api.events.BentoBoxEvent;
Expand Down Expand Up @@ -122,6 +123,34 @@ public void setReason(String reason)
}


// ---------------------------------------------------------------------
// 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
// ---------------------------------------------------------------------
Expand All @@ -146,4 +175,9 @@ public void setReason(String reason)
* Reset Reason
*/
private String reason;

/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package world.bentobox.challenges.events;


import org.bukkit.event.HandlerList;
import java.util.UUID;

import world.bentobox.bentobox.api.events.BentoBoxEvent;
Expand Down Expand Up @@ -101,6 +102,34 @@ public void setAdmin(boolean admin)
}


// ---------------------------------------------------------------------
// 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
// ---------------------------------------------------------------------
Expand All @@ -120,4 +149,9 @@ public void setAdmin(boolean admin)
* Indicates if admin completes challenge
*/
private boolean admin;

/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
}

0 comments on commit 2a31fc9

Please sign in to comment.