From 0d5ff1eaf49e0eb11b83cd69a13bdcfc34ecd23b Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Thu, 17 Oct 2019 07:41:34 +0200 Subject: [PATCH] Add cake protection flag (#986) Implements #987. * Add cake protection flag * Improved CONTAINER flag description --- .../flags/protection/BlockInteractionListener.java | 3 +++ src/main/java/world/bentobox/bentobox/lists/Flags.java | 1 + src/main/resources/locales/en-US.yml | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/listeners/flags/protection/BlockInteractionListener.java b/src/main/java/world/bentobox/bentobox/listeners/flags/protection/BlockInteractionListener.java index 9f36bd54f..81c1968c7 100644 --- a/src/main/java/world/bentobox/bentobox/listeners/flags/protection/BlockInteractionListener.java +++ b/src/main/java/world/bentobox/bentobox/listeners/flags/protection/BlockInteractionListener.java @@ -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 f = BentoBox.getInstance().getFlagsManager().getFlag(stringFlags.get(type.name())); diff --git a/src/main/java/world/bentobox/bentobox/lists/Flags.java b/src/main/java/world/bentobox/bentobox/lists/Flags.java index 22c2b4c4b..aa09da841 100644 --- a/src/main/java/world/bentobox/bentobox/lists/Flags.java +++ b/src/main/java/world/bentobox/bentobox/lists/Flags.java @@ -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 diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 6e9d48fc7..6860d58a6 100644 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -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.