|
event.setCancelled(this._openShulker.GetShulkerActions().AttemptToOpenShulkerBox(event.getPlayer())); |
If a player that has no itemstack in hand right-click a container(e.g. shulkerbox, barrel, chest and more) while sneaking, the container will could be opened although the block of this container was protected by some plugins like Residence, WorldGuard. It was caused by event.setCancelled(false) because thatthis._openShulker.GetShulkerActions().AttemptToOpenShulkerBox(event.getPlayer())return false.
Should be replaced by
if (this._openShulker.GetShulkerActions().AttemptToOpenShulkerBox(event.getPlayer())) event.setCancelled(true);
OpenShulker/src/main/java/me/entity303/openshulker/listener/ShulkerOpenCloseListener.java
Line 50 in 2c9fc8a
If a player that has no itemstack in hand right-click a container(e.g. shulkerbox, barrel, chest and more) while sneaking, the container will could be opened although the block of this container was protected by some plugins like Residence, WorldGuard. It was caused by
event.setCancelled(false)because thatthis._openShulker.GetShulkerActions().AttemptToOpenShulkerBox(event.getPlayer())return false.Should be replaced by
if (this._openShulker.GetShulkerActions().AttemptToOpenShulkerBox(event.getPlayer())) event.setCancelled(true);