9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-29 11:59:15 +00:00

added prevent-dropping-stage-items

This commit is contained in:
Xiao-MoMi
2025-09-20 02:17:41 +08:00
parent 38e3271f57
commit 66d4097193
5 changed files with 17 additions and 5 deletions

View File

@@ -206,7 +206,9 @@ public abstract class AbstractCustomEventListener implements Listener {
String itemID = this.itemManager.id(itemStack);
if (Registries.STAGE_TO_CROP_UNSAFE.containsKey(itemID)) {
event.setCancelled(true);
if (ConfigManager.preventDroppingStageItems()) {
event.setCancelled(true);
}
return;
}

View File

@@ -95,6 +95,8 @@ public abstract class ConfigManager implements ConfigLoader, Reloadable {
protected boolean asyncWorldSaving = true;
protected boolean preventDroppingStageItems = true;
public ConfigManager(BukkitCustomCropsPlugin plugin) {
this.plugin = plugin;
instance = this;
@@ -204,6 +206,10 @@ public abstract class ConfigManager implements ConfigLoader, Reloadable {
return instance.worldeditSupport;
}
public static boolean preventDroppingStageItems() {
return instance.preventDroppingStageItems;
}
@Override
public YamlDocument loadConfig(String filePath) {
return loadConfig(filePath, '.');