Adds protection for sign editing for 1.20

Fixes #2135
This commit is contained in:
tastybento 2023-06-10 15:49:10 -07:00
parent 6932ce3759
commit d25d1713f8
3 changed files with 19 additions and 3 deletions

View File

@ -155,6 +155,11 @@ public class BlockInteractionListener extends FlagListener
return;
}
if (Tag.SIGNS.isTagged(type)) {
this.checkIsland(e, player, loc, Flags.SIGN_EDITING);
return;
}
if (Tag.FENCE_GATES.isTagged(type))
{
this.checkIsland(e, player, loc, Flags.GATE);

View File

@ -653,16 +653,21 @@ public final class Flags {
* Controls who gets to harvest any crop related contents. e.g. Wheat, Sugar Cane, melon blocks, not stems, pumpkin blocks, etc.
* @since 1.23.0
*/
public static final Flag HARVEST = new Flag.Builder("HARVEST", Material.PUMPKIN).type(Type.PROTECTION).build();
public static final Flag HARVEST = new Flag.Builder("HARVEST", Material.PUMPKIN).mode(Flag.Mode.BASIC).type(Type.PROTECTION).build();
/**
* Crop Planting
* Controls who gets to plant crops on tilled soil.
* @since 1.23.0
*/
public static final Flag CROP_PLANTING = new Flag.Builder("CROP_PLANTING", Material.PUMPKIN_SEEDS).type(Type.PROTECTION).build();
public static final Flag CROP_PLANTING = new Flag.Builder("CROP_PLANTING", Material.PUMPKIN_SEEDS).mode(Flag.Mode.BASIC).type(Type.PROTECTION).build();
/**
* Sign edit protection
* @since 1.24.0
*/
public static final Flag SIGN_EDITING = new Flag.Builder("SIGN_EDITING", Material.DARK_OAK_SIGN).mode(Flag.Mode.BASIC).type(Type.PROTECTION).build();
/**
* Provides a list of all the Flag instances contained in this class using reflection.
* Deprecated Flags are ignored.

View File

@ -1325,6 +1325,12 @@ protection:
&a activation.
name: "Sculk Shrieker"
hint: "sculk shrieker activation is disabled"
SIGN_EDITING:
description: |-
&a Allows text editing
&a of signs
name: "Sign Editing"
hint: "sign editing is disabled"
TNT_DAMAGE:
description: |-
&a Allow TNT and TNT minecarts