2019-02-22 10:31:09 +01:00
|
|
|
package world.bentobox.challenges.events;
|
|
|
|
|
|
|
|
|
2020-12-27 20:12:38 +01:00
|
|
|
import org.bukkit.event.HandlerList;
|
2019-02-22 10:31:09 +01:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2019-08-13 21:49:37 +02:00
|
|
|
import world.bentobox.bentobox.api.events.BentoBoxEvent;
|
2019-02-22 10:31:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This event is fired when challenge level is completed.
|
|
|
|
*/
|
2019-08-13 21:49:37 +02:00
|
|
|
public class LevelCompletedEvent extends BentoBoxEvent
|
2019-02-22 10:31:09 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor creates a new LevelCompletedEvent instance.
|
|
|
|
*
|
|
|
|
* @param levelID of type String
|
|
|
|
* @param playerUUID of type UUID
|
|
|
|
* @param admin of type boolean
|
|
|
|
*/
|
|
|
|
public LevelCompletedEvent(
|
|
|
|
String levelID,
|
|
|
|
UUID playerUUID,
|
|
|
|
boolean admin)
|
|
|
|
{
|
|
|
|
this.levelID = levelID;
|
|
|
|
this.playerUUID = playerUUID;
|
|
|
|
this.admin = admin;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Section: Getters and setters
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method returns the levelID value.
|
|
|
|
*
|
|
|
|
* @return the value of levelID.
|
|
|
|
*/
|
|
|
|
public String getLevelID()
|
|
|
|
{
|
|
|
|
return levelID;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method sets the levelID value.
|
|
|
|
*
|
|
|
|
* @param levelID the levelID new value.
|
|
|
|
*/
|
|
|
|
public void setLevelID(String levelID)
|
|
|
|
{
|
|
|
|
this.levelID = levelID;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method returns the playerUUID value.
|
|
|
|
*
|
|
|
|
* @return the value of playerUUID.
|
|
|
|
*/
|
|
|
|
public UUID getPlayerUUID()
|
|
|
|
{
|
|
|
|
return playerUUID;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method sets the playerUUID value.
|
|
|
|
*
|
|
|
|
* @param playerUUID the playerUUID new value.
|
|
|
|
*/
|
|
|
|
public void setPlayerUUID(UUID playerUUID)
|
|
|
|
{
|
|
|
|
this.playerUUID = playerUUID;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method returns the admin value.
|
|
|
|
*
|
|
|
|
* @return the value of admin.
|
|
|
|
*/
|
|
|
|
public boolean isAdmin()
|
|
|
|
{
|
|
|
|
return admin;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method sets the admin value.
|
|
|
|
*
|
|
|
|
* @param admin the admin new value.
|
|
|
|
*/
|
|
|
|
public void setAdmin(boolean admin)
|
|
|
|
{
|
|
|
|
this.admin = admin;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-27 20:12:38 +01:00
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-02-22 10:31:09 +01:00
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Section: Variables
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Completed level ID
|
|
|
|
*/
|
|
|
|
private String levelID;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* User who completes challenge
|
|
|
|
*/
|
|
|
|
private UUID playerUUID;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates if admin completes challenge
|
|
|
|
*/
|
|
|
|
private boolean admin;
|
2020-12-27 20:12:38 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Event listener list for current
|
|
|
|
*/
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
2019-02-22 10:31:09 +01:00
|
|
|
}
|