mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 13:07:29 +01:00
Fix sapling + bonemeal considered as usage rather than building.
Fixes WORLDGUARD-3169.
This commit is contained in:
parent
c4b3c1d033
commit
bd2a8daad3
@ -246,8 +246,13 @@ public boolean apply(Location target) {
|
||||
boolean canUse;
|
||||
String what;
|
||||
|
||||
/* Saplings, etc. */
|
||||
if (Materials.isConsideredBuildingIfUsed(type)) {
|
||||
canUse = query.testBuild(target, associable);
|
||||
what = "use that";
|
||||
|
||||
/* Inventory */
|
||||
if (Materials.isInventoryBlock(type)) {
|
||||
} else if (Materials.isInventoryBlock(type)) {
|
||||
canUse = query.testBuild(target, associable, DefaultFlag.USE, DefaultFlag.CHEST_ACCESS);
|
||||
what = "open that";
|
||||
|
||||
|
@ -616,4 +616,15 @@ public static boolean isItemAppliedToBlock(Material item, Material block) {
|
||||
return flags == null || (flags & MODIFIES_BLOCKS) == MODIFIES_BLOCKS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether the given material should be tested as "building" when
|
||||
* it is used.
|
||||
*
|
||||
* @param type the type
|
||||
* @return true to be considered as used
|
||||
*/
|
||||
public static boolean isConsideredBuildingIfUsed(Material type) {
|
||||
return type == Material.SAPLING;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user