Added Flags#DRAGON_EGG

#559
This commit is contained in:
Florian CUNY 2019-02-23 11:03:00 +01:00
parent eaaad1458d
commit 7fff4257fa
4 changed files with 19 additions and 2 deletions

View File

@ -250,7 +250,7 @@ public class BlockInteractionListener extends FlagListener {
checkIsland(e, player, loc, Flags.REDSTONE);
break;
case DRAGON_EGG:
checkIsland(e, player, loc, Flags.BREAK_BLOCKS);
checkIsland(e, player, loc, Flags.DRAGON_EGG);
break;
case END_PORTAL_FRAME:
checkIsland(e, player, loc, Flags.PLACE_BLOCKS);

View File

@ -71,10 +71,12 @@ public class BreakBlocksListener extends FlagListener {
switch (e.getClickedBlock().getType()) {
case CAKE:
case DRAGON_EGG:
case SPAWNER:
checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.BREAK_BLOCKS);
break;
case DRAGON_EGG:
checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.DRAGON_EGG);
break;
default:
break;
}

View File

@ -103,6 +103,13 @@ public final class Flags {
public static final Flag REDSTONE = new Flag.Builder("REDSTONE", Material.REDSTONE).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).build();
/**
* Prevents players from interacting with the Dragon Egg.
* @since 1.4.0
* @see BlockInteractionListener
* @see BreakBlocksListener
*/
public static final Flag DRAGON_EGG = new Flag.Builder("DRAGON_EGG", Material.DRAGON_EGG).build();
// Entity interactions
public static final Flag ARMOR_STAND = new Flag.Builder("ARMOR_STAND", Material.ARMOR_STAND).listener(new EntityInteractListener()).build();

View File

@ -560,6 +560,14 @@ protection:
description: "Toggle door usage"
name: "Use doors"
hint: "No door use"
DRAGON_EGG:
name: "Dragon Egg"
description: |-
&aPrevents interaction with Dragon Eggs.
&cThis does not protect it from being
&cplaced or broken.
hint: "No Dragon Egg interaction"
EGGS:
description: "Toggle egg throwing"
name: "Egg throwing"