-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds InvincibleVisitorFlagDamageRemovalEvent and tests.
Resolves #2196
- Loading branch information
1 parent
7fbd041
commit 2b65543
Showing
3 changed files
with
78 additions
and
8 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...java/world/bentobox/bentobox/api/events/flags/InvincibleVistorFlagDamageRemovalEvent.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,50 @@ | ||
package world.bentobox.bentobox.api.events.flags; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; | ||
|
||
import world.bentobox.bentobox.api.events.BentoBoxEvent; | ||
|
||
/** | ||
* This event is fired just before damage is prevented to visitors on an island, if that protection is provided. | ||
* @author tastybento | ||
* | ||
*/ | ||
public class InvincibleVistorFlagDamageRemovalEvent extends BentoBoxEvent implements Cancellable { | ||
private final Player player; | ||
private final DamageCause cause; | ||
private boolean cancel; | ||
|
||
/** | ||
* This event is fired just before damage is prevented to visitors on an island, if that protection is provided. | ||
* @param player player being protected | ||
* @param cause damage cause | ||
*/ | ||
public InvincibleVistorFlagDamageRemovalEvent(Player player, DamageCause cause) { | ||
this.player = player; | ||
this.cause = cause; | ||
} | ||
@Override | ||
public boolean isCancelled() { | ||
return cancel; | ||
} | ||
@Override | ||
public void setCancelled(boolean cancel) { | ||
this.cancel = cancel; | ||
} | ||
|
||
/** | ||
* @return the player | ||
*/ | ||
public Player getPlayer() { | ||
return player; | ||
} | ||
/** | ||
* @return the cause | ||
*/ | ||
public DamageCause getCause() { | ||
return cause; | ||
} | ||
} | ||
|
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