Added BREAK_HOPPERS protection flag

Implements https://github.com/BentoBoxWorld/BentoBox/issues/1331
This commit is contained in:
Florian CUNY 2020-06-29 17:44:13 +02:00
parent 89849442a9
commit 2773c4a104
3 changed files with 16 additions and 1 deletions

View File

@ -92,6 +92,9 @@ public class BreakBlocksListener extends FlagListener {
case DRAGON_EGG:
checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.DRAGON_EGG);
break;
case HOPPER:
checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.BREAK_HOPPERS);
break;
default:
break;
}

View File

@ -86,6 +86,12 @@ public final class Flags {
* @since 1.13.0
*/
public static final Flag BREAK_SPAWNERS = new Flag.Builder("BREAK_SPAWNERS", Material.SPAWNER).mode(Flag.Mode.EXPERT).build();
/**
* Prevents players from breaking hoppers on one's island.
* @see BreakBlocksListener
* @since 1.14.0
*/
public static final Flag BREAK_HOPPERS = new Flag.Builder("BREAK_HOPPERS", Material.HOPPER).mode(Flag.Mode.EXPERT).build();
/**
* Prevents players from placing blocks on one's island.
* @see PlaceBlocksListener

View File

@ -717,9 +717,15 @@ protection:
BREAK_SPAWNERS:
description: |-
Toggle spawners breaking.
Override the Break Blocks flag.
Overrides the Break Blocks flag.
name: "Break spawners"
hint: "Spawner breaking disabled"
BREAK_HOPPERS:
description: |-
Toggle hoppers breaking.
Overrides the Break Blocks flag.
name: "Break hoppers"
hint: "Hoppers breaking disabled"
BREEDING:
description: "Toggle breeding"
name: "Breed animals"