mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-23 02:55:23 +01:00
Add item-frame-rotation flag.
When set to allow, allows players to rotate item in item frames even if they wouldn't normally have permissions to modify the item frame. Fixes WORLDGUARD-3588.
This commit is contained in:
parent
b6e2bca5bc
commit
ff37cc7935
@ -59,6 +59,7 @@ public final class Flags {
|
||||
public static final StateFlag LIGHTER = register(new StateFlag("lighter", false));
|
||||
public static final StateFlag RIDE = register(new StateFlag("ride", false));
|
||||
public static final StateFlag POTION_SPLASH = register(new StateFlag("potion-splash", false));
|
||||
public static final StateFlag ITEM_FRAME_ROTATE = register(new StateFlag("item-frame-rotation", 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.
|
||||
|
@ -424,7 +424,12 @@ public void onUseEntity(UseEntityEvent event) {
|
||||
|
||||
/* Paintings, item frames, etc. */
|
||||
} else if (Entities.isConsideredBuildingIfUsed(event.getEntity())) {
|
||||
if (event.getEntity().getType() == EntityType.ITEM_FRAME && event.getCause().getFirstPlayer() != null
|
||||
&& ((org.bukkit.entity.ItemFrame) event.getEntity()).getItem() != null) {
|
||||
canUse = query.testBuild(BukkitAdapter.adapt(target), associable, combine(event, Flags.ITEM_FRAME_ROTATE));
|
||||
} else {
|
||||
canUse = query.testBuild(BukkitAdapter.adapt(target), associable, combine(event));
|
||||
}
|
||||
what = "change that";
|
||||
|
||||
/* Ridden on use */
|
||||
|
Loading…
Reference in New Issue
Block a user