-
-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- A cancellable event thrown before a player can reclaim a town.
- Loading branch information
Showing
3 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
Towny/src/main/java/com/palmergames/bukkit/towny/event/town/TownPreReclaimEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.palmergames.bukkit.towny.event.town; | ||
|
||
import com.palmergames.bukkit.towny.event.CancellableTownyEvent; | ||
import com.palmergames.bukkit.towny.object.Resident; | ||
import com.palmergames.bukkit.towny.object.Town; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class TownPreReclaimEvent extends CancellableTownyEvent { | ||
private static final HandlerList HANDLER_LIST = new HandlerList(); | ||
|
||
private final Player player; | ||
private final Resident resident; | ||
private final Town town; | ||
|
||
/** | ||
* Event thrown prior to a {@link Town} being reclaimed by a {@link Resident}. | ||
* | ||
* @param town The Town being reclaimed. | ||
* @param resident The resident who would become mayor. | ||
* @param player The Player who would become mayor. | ||
*/ | ||
public TownPreReclaimEvent(Town town, Resident resident, Player player) { | ||
this.town = town; | ||
this.resident = resident; | ||
this.player = player; | ||
} | ||
|
||
/** | ||
* @return the {@link Town} which will be reclaimed. | ||
*/ | ||
@Nullable | ||
public Town getTown() { | ||
return town; | ||
} | ||
|
||
/** | ||
* @return the resident who will become mayor. | ||
*/ | ||
public Resident getResident() { | ||
return resident; | ||
} | ||
|
||
/** | ||
* @return the player who will become mayor. | ||
*/ | ||
public Player getPlayer() { | ||
return player; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return HANDLER_LIST; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public HandlerList getHandlers() { | ||
return HANDLER_LIST; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters