Add cake protection flag (#986)

Implements #987.

* Add cake protection flag

* Improved CONTAINER flag description
This commit is contained in:
NotMyFault 2019-10-17 07:41:34 +02:00 committed by Florian CUNY
parent 595de7a602
commit 0d5ff1eaf4
3 changed files with 10 additions and 1 deletions

View File

@ -290,6 +290,9 @@ public class BlockInteractionListener extends FlagListener {
case SWEET_BERRY_BUSH:
checkIsland(e, player, loc, Flags.BREAK_BLOCKS);
break;
case CAKE:
checkIsland(e, player, loc, Flags.CAKE);
break;
default:
if (stringFlags.containsKey(type.name())) {
Optional<Flag> f = BentoBox.getInstance().getFlagsManager().getFlag(stringFlags.get(type.name()));

View File

@ -109,6 +109,7 @@ public final class Flags {
public static final Flag REDSTONE = new Flag.Builder("REDSTONE", Material.REDSTONE).mode(Flag.Mode.ADVANCED).build();
public static final Flag SPAWN_EGGS = new Flag.Builder("SPAWN_EGGS", Material.COW_SPAWN_EGG).build();
public static final Flag ITEM_FRAME = new Flag.Builder("ITEM_FRAME", Material.ITEM_FRAME).mode(Flag.Mode.ADVANCED).build();
public static final Flag CAKE = new Flag.Builder("CAKE", Material.CAKE).build();
/**
* Prevents players from interacting with the Dragon Egg.
* @since 1.3.1

View File

@ -663,11 +663,16 @@ protection:
description: "Toggle button use"
name: "Buttons"
hint: "No button use allowed"
CAKE:
description: "Cake eating disabled"
name: "Cakes"
hint: "Toggle cake interaction"
CONTAINER:
name: "Containers"
description: |-
&aToggle interaction with chests,
&ashulker boxes and flower pots.
&ashulker boxes and flower pots,
&acomposters and barrels.
&7Other containers are handled
&7by dedicated flags.