Skip to content

Commit a4f0a85

Browse files
authored
Merge pull request #368 from BentoBoxWorld/itemsadder_disable_config
Added config option to disable ItemsAdder support
2 parents 9fdb347 + 2f188b1 commit a4f0a85

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

src/main/java/world/bentobox/level/Level.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ public Warp getWarpHook() {
483483
}
484484

485485
public boolean isItemsAdder() {
486-
return getPlugin().getHooks().getHook("ItemsAdder").isPresent();
486+
return !getSettings().isDisableItemsAdder() && getPlugin().getHooks().getHook("ItemsAdder").isPresent();
487487
}
488488

489489
}

src/main/java/world/bentobox/level/config/ConfigSettings.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ public class ConfigSettings implements ConfigObject {
2121
@ConfigEntry(path = "disabled-game-modes")
2222
private List<String> gameModes = Collections.emptyList();
2323

24+
@ConfigComment("")
25+
@ConfigComment("Disable ItemsAdder support")
26+
@ConfigComment("This will ignore ItemsAdder even if it is installed and not use it. Do not set this to true unless you know what you are doing.")
27+
@ConfigEntry(path = "disabled-itemsadder")
28+
private boolean disableItemsAdder = false;
29+
2430
@ConfigComment("")
2531
@ConfigComment("When executing level command from console, should a report be shown?")
2632
@ConfigEntry(path = "log-report-to-console")
@@ -487,4 +493,18 @@ public String getTera() {
487493
public void setTera(String tera) {
488494
this.tera = tera;
489495
}
496+
497+
/**
498+
* @return the disableItemsAdder
499+
*/
500+
public boolean isDisableItemsAdder() {
501+
return disableItemsAdder;
502+
}
503+
504+
/**
505+
* @param disableItemsAdder the disableItemsAdder to set
506+
*/
507+
public void setDisableItemsAdder(boolean disableItemsAdder) {
508+
this.disableItemsAdder = disableItemsAdder;
509+
}
490510
}

src/main/resources/config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# Level will NOT hook into these game mode addons.
66
disabled-game-modes: []
77
#
8+
# Disable ItemsAdder support
9+
# This will ignore ItemsAdder even if it is installed and not use it. Do not set this to true unless you know what you are doing.
10+
disabled-itemsadder: false
11+
#
812
# When executing level command from console, should a report be shown?
913
log-report-to-console: true
1014
#
@@ -86,4 +90,4 @@ include-shulkers-in-chest: false
8690
#
8791
# Disables hooking with other plugins.
8892
# Example: disabled-plugin-hooks: [UltimateStacker, RoseStacker]
89-
disabled-plugin-hooks: []
93+
disabled-plugin-hooks: []

0 commit comments

Comments
 (0)