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

@ -270,6 +270,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

View file

@ -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"));