Rely on the new inventory blocking, so that placing against chests while crouching is possible
This commit is contained in:
parent
2bb077f94f
commit
acbe6838b7
2 changed files with 14 additions and 1 deletions
|
@ -271,6 +271,19 @@ public class LimitConfig extends Configuration implements IConfigurationSubGroup
|
||||||
return breakList;
|
return breakList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LimitChestOpen
|
||||||
|
*
|
||||||
|
* Enable this to prevents the ChestOpening-Animination when blocking interaction with a chest. But therefore
|
||||||
|
* you're no longer able to place blocks on chest and such while crouching.
|
||||||
|
*
|
||||||
|
* default: false
|
||||||
|
*/
|
||||||
|
@IsConfigurationNode(name = "chestOpen", order = 900)
|
||||||
|
public boolean getBlockChestInteraction() {
|
||||||
|
return config.getBoolean("chestOpen", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getValue(final IConfigurationNode node) {
|
public Object getValue(final IConfigurationNode node) {
|
||||||
|
|
|
@ -178,7 +178,7 @@ public class PlayerListener implements Listener {
|
||||||
// when crouching.
|
// when crouching.
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
if (isChest(block)) {
|
if (mod.getConfig().getBlockChestInteraction() && isChest(block)) {
|
||||||
if (!checkPermission(event, NoLimitPermissions.CHEST)) {
|
if (!checkPermission(event, NoLimitPermissions.CHEST)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.getPlayer().sendMessage(mod.getPlugin().getLocale().trans("blocked.chest"));
|
event.getPlayer().sendMessage(mod.getPlugin().getLocale().trans("blocked.chest"));
|
||||||
|
|
Loading…
Reference in a new issue