Rely on the new inventory blocking, so that placing against chests while crouching is possible

This commit is contained in:
Jascha Starke 2013-09-19 19:41:10 +02:00
parent 2bb077f94f
commit acbe6838b7
2 changed files with 14 additions and 1 deletions

View file

@ -271,6 +271,19 @@ public class LimitConfig extends Configuration implements IConfigurationSubGroup
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
public Object getValue(final IConfigurationNode node) {

View file

@ -178,7 +178,7 @@ public class PlayerListener implements Listener {
// when crouching.
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Block block = event.getClickedBlock();
if (isChest(block)) {
if (mod.getConfig().getBlockChestInteraction() && isChest(block)) {
if (!checkPermission(event, NoLimitPermissions.CHEST)) {
event.setCancelled(true);
event.getPlayer().sendMessage(mod.getPlugin().getLocale().trans("blocked.chest"));