Merge pull request #2147 from BentoBoxWorld/suspicious_brushing

Protect against brushing
This commit is contained in:
tastybento 2023-06-24 12:12:00 -07:00 committed by GitHub
commit 4b0c5ec894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Tag; import org.bukkit.Tag;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BrushableBlock;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
import org.bukkit.block.data.Waterlogged; import org.bukkit.block.data.Waterlogged;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -98,6 +99,12 @@ public class BlockInteractionListener extends FlagListener
this.checkIsland(e, player, loc, Flags.FLOWER_POT); this.checkIsland(e, player, loc, Flags.FLOWER_POT);
return; return;
} }
if (block.getState() instanceof BrushableBlock bb && BlockInteractionListener.holds(player, Material.BRUSH)) {
// Protect this using break blocks flag for now. Maybe in the future it can have its own flag.
this.checkIsland(e, player, loc, Flags.BREAK_BLOCKS);
return;
}
if (Tag.ANVIL.isTagged(type)) if (Tag.ANVIL.isTagged(type))
{ {