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:
@@ -206,7 +206,9 @@ public abstract class AbstractCustomEventListener implements Listener {
|
||||
String itemID = this.itemManager.id(itemStack);
|
||||
|
||||
if (Registries.STAGE_TO_CROP_UNSAFE.containsKey(itemID)) {
|
||||
if (ConfigManager.preventDroppingStageItems()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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, '.');
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
@@ -153,3 +152,6 @@ other-settings:
|
||||
intervene-anti-grief: false
|
||||
# Decides whether the process of saving is async
|
||||
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
|
||||
Reference in New Issue
Block a user