-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2432 from BentoBoxWorld/2422_flags_for_1.21
2422 flags for 1.21
- Loading branch information
Showing
13 changed files
with
291 additions
and
29 deletions.
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
src/main/java/world/bentobox/bentobox/listeners/flags/protection/CandleListener.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,33 @@ | ||
package world.bentobox.bentobox.listeners.flags.protection; | ||
|
||
import org.bukkit.Tag; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.player.PlayerInteractEvent; | ||
|
||
import world.bentobox.bentobox.api.flags.FlagListener; | ||
import world.bentobox.bentobox.lists.Flags; | ||
|
||
/** | ||
* Protects candles | ||
* @author tastybento | ||
* @since 2.4.2 | ||
*/ | ||
public class CandleListener extends FlagListener { | ||
|
||
/** | ||
* Prevent dying signs. | ||
* @param e - event | ||
*/ | ||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) | ||
public void onCandleInteract(final PlayerInteractEvent e) { | ||
if (e.getClickedBlock() == null) { | ||
return; | ||
} | ||
|
||
if (Tag.CANDLES.isTagged(e.getClickedBlock().getType()) | ||
|| Tag.CANDLE_CAKES.isTagged(e.getClickedBlock().getType())) { | ||
this.checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.CANDLES); | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.