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 7c6652c commit b9af186
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


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

import world.bentobox.bentobox.api.events.BentoBoxEvent;
Expand Down Expand Up @@ -177,6 +178,34 @@ public void setCancelled(boolean cancel)
}


// ---------------------------------------------------------------------
// Section: Handler methods
// ---------------------------------------------------------------------


/**
* Gets handlers.
*
* @return the handlers
*/
@Override
public HandlerList getHandlers()
{
return GeneratorActivationEvent.handlers;
}


/**
* Gets handlers.
*
* @return the handlers
*/
public static HandlerList getHandlerList()
{
return GeneratorActivationEvent.handlers;
}


// ---------------------------------------------------------------------
// Section: Variables
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -211,4 +240,9 @@ public void setCancelled(boolean cancel)
* Boolean that indicates if event is cancelled.
*/
private boolean cancelled;

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


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

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


// ---------------------------------------------------------------------
// Section: Handler methods
// ---------------------------------------------------------------------


/**
* Gets handlers.
*
* @return the handlers
*/
@Override
public HandlerList getHandlers()
{
return GeneratorBuyEvent.handlers;
}


/**
* Gets handlers.
*
* @return the handlers
*/
public static HandlerList getHandlerList()
{
return GeneratorBuyEvent.handlers;
}


// ---------------------------------------------------------------------
// Section: Variables
// ---------------------------------------------------------------------
Expand All @@ -148,4 +177,9 @@ public void setGeneratorID(String generatorID)
* Generator ID.
*/
private String generatorID;

/**
* Event listener list for current
*/
private static final HandlerList handlers = new HandlerList();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.Nullable;
import java.util.UUID;

Expand Down Expand Up @@ -154,6 +155,34 @@ public void setCancelled(boolean cancel)
}


// ---------------------------------------------------------------------
// Section: Handler methods
// ---------------------------------------------------------------------


/**
* Gets handlers.
*
* @return the handlers
*/
@Override
public HandlerList getHandlers()
{
return GeneratorUnlockEvent.handlers;
}


/**
* Gets handlers.
*
* @return the handlers
*/
public static HandlerList getHandlerList()
{
return GeneratorUnlockEvent.handlers;
}


// ---------------------------------------------------------------------
// Section: Variables
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -183,4 +212,9 @@ public void setCancelled(boolean cancel)
* Boolean that indicates if event is cancelled.
*/
private boolean cancelled;

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

0 comments on commit b9af186

Please sign in to comment.