mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-21 16:09:21 +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);
|
String itemID = this.itemManager.id(itemStack);
|
||||||
|
|
||||||
if (Registries.STAGE_TO_CROP_UNSAFE.containsKey(itemID)) {
|
if (Registries.STAGE_TO_CROP_UNSAFE.containsKey(itemID)) {
|
||||||
event.setCancelled(true);
|
if (ConfigManager.preventDroppingStageItems()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ public abstract class ConfigManager implements ConfigLoader, Reloadable {
|
|||||||
|
|
||||||
protected boolean asyncWorldSaving = true;
|
protected boolean asyncWorldSaving = true;
|
||||||
|
|
||||||
|
protected boolean preventDroppingStageItems = true;
|
||||||
|
|
||||||
public ConfigManager(BukkitCustomCropsPlugin plugin) {
|
public ConfigManager(BukkitCustomCropsPlugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
instance = this;
|
instance = this;
|
||||||
@@ -204,6 +206,10 @@ public abstract class ConfigManager implements ConfigLoader, Reloadable {
|
|||||||
return instance.worldeditSupport;
|
return instance.worldeditSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean preventDroppingStageItems() {
|
||||||
|
return instance.preventDroppingStageItems;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public YamlDocument loadConfig(String filePath) {
|
public YamlDocument loadConfig(String filePath) {
|
||||||
return loadConfig(filePath, '.');
|
return loadConfig(filePath, '.');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Project settings
|
# Project settings
|
||||||
# Rule: [major update].[feature update].[bug fix]
|
# Rule: [major update].[feature update].[bug fix]
|
||||||
project_version=3.6.44.2
|
project_version=3.6.44.3
|
||||||
config_version=42
|
config_version=43
|
||||||
project_group=net.momirealms
|
project_group=net.momirealms
|
||||||
|
|
||||||
# Supported languages
|
# Supported languages
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ public class BukkitConfigManager extends ConfigManager {
|
|||||||
interveneAntiGrief = config.getBoolean("other-settings.intervene-anti-grief", false);
|
interveneAntiGrief = config.getBoolean("other-settings.intervene-anti-grief", false);
|
||||||
asyncWorldSaving = config.getBoolean("other-settings.async-world-saving", true);
|
asyncWorldSaving = config.getBoolean("other-settings.async-world-saving", true);
|
||||||
|
|
||||||
|
preventDroppingStageItems = config.getBoolean("other-settings.prevent-dropping-stage-items", true);
|
||||||
|
|
||||||
offsets.clear();
|
offsets.clear();
|
||||||
Section section = config.getSection("mechanics.hologram-offset-correction");
|
Section section = config.getSection("mechanics.hologram-offset-correction");
|
||||||
if (section != null) {
|
if (section != null) {
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ other-settings:
|
|||||||
# which may conflict with some plugins still using SpigotAPI#ItemMeta
|
# which may conflict with some plugins still using SpigotAPI#ItemMeta
|
||||||
protect-original-lore: false
|
protect-original-lore: false
|
||||||
# Whether to verify if a block/furniture matches the data in CustomCrops
|
# 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
|
double-check: false
|
||||||
# Enable WorldEdit support (Experimental)
|
# Enable WorldEdit support (Experimental)
|
||||||
worldedit-support: false
|
worldedit-support: false
|
||||||
@@ -153,3 +152,6 @@ other-settings:
|
|||||||
intervene-anti-grief: false
|
intervene-anti-grief: false
|
||||||
# Decides whether the process of saving is async
|
# 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
|
||||||
Reference in New Issue
Block a user