Skip to content

Commit 91f4484

Browse files
committed
1.4.1 add chest protect config
1 parent 7c4405a commit 91f4484

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>tw.mics.spigot.plugin.cupboard</groupId>
77
<artifactId>Cupboard</artifactId>
88
<packaging>jar</packaging>
9-
<version>1.4.0</version>
9+
<version>1.4.1</version>
1010
<name>Cupboard</name>
1111
<url>http://mics.tw</url>
1212
<description>Let a PvP server as like as Rust fun, but still keep Minecraft original play style.</description>

src/main/java/tw/mics/spigot/plugin/cupboard/config/Config.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ public enum Config {
1313

1414
DEBUG("debug", false, "is plugin show debug message?"),
1515
CUPBOARD_PROTECT_DIST("cupboard.protect_dist", 9, "this is cupboard protect area size (ex 9 is 9+9+1 -> 19*19*19)"),
16-
CUPBOARD_BETWEEN_DIST("cupboard.between_dist", 18, "this is how many block between cupboard can put another cupboard"),
16+
CUPBOARD_BETWEEN_DIST("cupboard.between_dist", 18, "this is how many block between cupboard can put another cupboard"),
1717
ANTI_TNT_EXPLOSION("cupboard.anti-tnt-explosion", false, "is cupboard protect explosion from TNT?"),
1818
ANTI_OTHERS_EXPLOSION("cupboard.anti-creeper-explosion", true, "is cupboard protect explosion from CREEPER?"),
1919
OP_BYPASS("cupboard.is-op-creative-bypass", true, "is OP user can bypass block protect when in creative mode?"),
20+
CUPBOARD_PROTECT_CHEST("cupboard.protect_chest", false, ""),
2021

2122
WP_NETHER_DOOR_PROTECT_ENABLE("world-protect.nether-portal-protect.enable", true, "enable nether door protect (if this is false, below is non-use)"),
2223
WP_NETHER_SREACH_RADIUS("world-protect.nether-portal-protect.sreach-redius", 16, "change nether portal sreach radius"),

src/main/java/tw/mics/spigot/plugin/cupboard/listener/CupboardUseProtectListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.bukkit.event.player.PlayerInteractEvent;
1111

1212
import tw.mics.spigot.plugin.cupboard.Cupboard;
13+
import tw.mics.spigot.plugin.cupboard.config.Config;
1314
import tw.mics.spigot.plugin.cupboard.config.Locales;
1415
import tw.mics.spigot.plugin.cupboard.data.CupboardsData;
1516
import tw.mics.spigot.plugin.cupboard.utils.SpawnLocationManager;
@@ -60,6 +61,7 @@ public void onUseStonePlate(PlayerInteractEvent event){
6061
//禁止未授權玩家使用箱子
6162
@EventHandler
6263
public void onUseChest(PlayerInteractEvent event){
64+
if(!Config.CUPBOARD_PROTECT_CHEST.getBoolean())return;
6365
Block b = event.getClickedBlock();
6466
Player p = event.getPlayer();
6567
if (

0 commit comments

Comments
 (0)