9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-19 15:09:25 +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, '.');

View File

@@ -1,7 +1,7 @@
# Project settings
# Rule: [major update].[feature update].[bug fix]
project_version=3.6.44.2
config_version=42
project_version=3.6.44.3
config_version=43
project_group=net.momirealms
# Supported languages

View File

@@ -148,6 +148,8 @@ public class BukkitConfigManager extends ConfigManager {
interveneAntiGrief = config.getBoolean("other-settings.intervene-anti-grief", false);
asyncWorldSaving = config.getBoolean("other-settings.async-world-saving", true);
preventDroppingStageItems = config.getBoolean("other-settings.prevent-dropping-stage-items", true);
offsets.clear();
Section section = config.getSection("mechanics.hologram-offset-correction");
if (section != null) {

View File

@@ -142,7 +142,6 @@ other-settings:
# which may conflict with some plugins still using SpigotAPI#ItemMeta
protect-original-lore: false
# Whether to verify if a block/furniture matches the data in CustomCrops
# Enable this if using Oraxen, as its API is more reliable
double-check: false
# Enable WorldEdit support (Experimental)
worldedit-support: false
@@ -152,4 +151,7 @@ other-settings:
# Supported plugins can be found on https://github.com/Xiao-MoMi/AntiGriefLib/blob/main/README.md
intervene-anti-grief: false
# Decides whether the process of saving is async
async-world-saving: true
async-world-saving: true
# Prevents crop stage items from dropping
# As some custom block plugins don't know how to handle loot table correctly
prevent-dropping-stage-items: true