mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-22 18:46:24 +01:00
Change anvil usage to build permissions and add use-anvil flag (#1644)
This commit is contained in:
parent
60b16fc4c7
commit
5921be432c
@ -268,6 +268,11 @@ public void onUseBlock(final UseBlockEvent event) {
|
||||
canUse = query.testBuild(BukkitAdapter.adapt(target), associable, combine(event, Flags.CHEST_ACCESS));
|
||||
what = "take that";
|
||||
|
||||
/* Anvils */
|
||||
} else if (Materials.isAnvil(type)) {
|
||||
canUse = query.testBuild(BukkitAdapter.adapt(target), associable, combine(event, Flags.USE_ANVIL));
|
||||
what = "use that";
|
||||
|
||||
/* Beds */
|
||||
} else if (Materials.isBed(type)) {
|
||||
canUse = query.testBuild(BukkitAdapter.adapt(target), associable, combine(event, Flags.INTERACT, Flags.SLEEP));
|
||||
|
@ -1263,6 +1263,10 @@ public static boolean isBed(Material material) {
|
||||
return Tag.BEDS.isTagged(material);
|
||||
}
|
||||
|
||||
public static boolean isAnvil(Material material) {
|
||||
return Tag.ANVIL.isTagged(material);
|
||||
}
|
||||
|
||||
public static boolean isCoral(Material material) {
|
||||
return Tag.CORAL_BLOCKS.isTagged(material) ||
|
||||
Tag.CORAL_PLANTS.isTagged(material) ||
|
||||
@ -1319,8 +1323,7 @@ public static boolean isUseFlagApplicable(Material material) {
|
||||
|| Tag.DOORS.isTagged(material)
|
||||
|| Tag.WOODEN_TRAPDOORS.isTagged(material)
|
||||
|| Tag.FENCE_GATES.isTagged(material)
|
||||
|| Tag.PRESSURE_PLATES.isTagged(material)
|
||||
|| Tag.ANVIL.isTagged(material)) {
|
||||
|| Tag.PRESSURE_PLATES.isTagged(material)) {
|
||||
return true;
|
||||
}
|
||||
switch (material) {
|
||||
|
@ -71,6 +71,7 @@ public final class Flags {
|
||||
public static final StateFlag ITEM_FRAME_ROTATE = register(new StateFlag("item-frame-rotation", false));
|
||||
public static final StateFlag TRAMPLE_BLOCKS = register(new StateFlag("block-trampling", false));
|
||||
public static final StateFlag FIREWORK_DAMAGE = register(new StateFlag("firework-damage", false));
|
||||
public static final StateFlag USE_ANVIL = register(new StateFlag("use-anvil", false));
|
||||
|
||||
// These flags are similar to the ones above (used in tandem with BUILD),
|
||||
// but their defaults are set to TRUE because it is more user friendly.
|
||||
|
Loading…
Reference in New Issue
Block a user