From acbe6838b7d8245931e97944bfa07a4c492e780a Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Thu, 19 Sep 2013 19:41:10 +0200 Subject: [PATCH] Rely on the new inventory blocking, so that placing against chests while crouching is possible --- .../limitedcreative/limits/LimitConfig.java | 13 +++++++++++++ .../limitedcreative/limits/PlayerListener.java | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/LimitConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/LimitConfig.java index 197694d..961271e 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/LimitConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/LimitConfig.java @@ -270,6 +270,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 diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java index 13efa1c..03e8559 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java @@ -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"));