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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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, '.');
|
||||
|
||||
Reference in New Issue
Block a user