File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
bukkit/src/main/java/org/popcraft/bolt/listeners Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -203,10 +203,19 @@ public void onBlockPlace(final BlockPlaceEvent e) {
203203 }
204204 final Block block = replaced .getBlock ();
205205 final Protection protection = plugin .findProtection (block );
206- if (protection != null ) {
206+ if (protection == null ) {
207+ return ;
208+ }
209+ if (Tag .REPLACEABLE .isTagged (e .getBlockReplacedState ().getType ())) {
207210 // Prevent accidental deletion of protected blocks by them getting replaced.
208211 // Purposefully not checking for destroy permissions, that logic is for BlockBreakEvent.
209212 e .setCancelled (true );
213+ } else {
214+ // This is, bafflingly, fired in cases like stripping a log (which *also* called EntityChangeBlockEvent)
215+ // but also fired in other cases, like placing a slab on top of another.
216+ if (!plugin .canAccess (block , e .getPlayer (), Permission .INTERACT )) {
217+ e .setCancelled (true );
218+ }
210219 }
211220 }
212221
You can’t perform that action at this time.
0 commit comments