From c85e5c23f70f1a4cf12688dd1ce16ce82d167e89 Mon Sep 17 00:00:00 2001 From: Wyzebb Date: Thu, 3 Jul 2025 17:01:27 +0100 Subject: [PATCH 1/3] Add config option for dropping all blacklisted items --- src/main/kotlin/net/pdevita/creeperheal2/config/ConfigManager.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/net/pdevita/creeperheal2/config/ConfigManager.kt b/src/main/kotlin/net/pdevita/creeperheal2/config/ConfigManager.kt index a5d3ca0..0623045 100644 --- a/src/main/kotlin/net/pdevita/creeperheal2/config/ConfigManager.kt +++ b/src/main/kotlin/net/pdevita/creeperheal2/config/ConfigManager.kt @@ -40,6 +40,7 @@ class General(config: FileConfiguration) { val turboCap = config.getInt("turbo-cap", 10).coerceAtMost(1000) val entityType = config.getBoolean("entity-type", true) val disableContainers = config.getBoolean("disable-containers", false) + val dropBlacklisted = config.getBoolean("always-drop-blacklisted-items", false) } class ExplosionTypes(config: FileConfiguration) { From 3488fa29fa36bed8aef8ae85bddb1c664d1565d6 Mon Sep 17 00:00:00 2001 From: Wyzebb Date: Thu, 3 Jul 2025 17:02:36 +0100 Subject: [PATCH 2/3] Add logic for dropping all blacklisted items and fix water and air block explosions causing duplicate regens or regen issues later --- .../net/pdevita/creeperheal2/CreeperHeal2.kt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/pdevita/creeperheal2/CreeperHeal2.kt b/src/main/kotlin/net/pdevita/creeperheal2/CreeperHeal2.kt index f280992..30a625e 100644 --- a/src/main/kotlin/net/pdevita/creeperheal2/CreeperHeal2.kt +++ b/src/main/kotlin/net/pdevita/creeperheal2/CreeperHeal2.kt @@ -9,8 +9,10 @@ import net.pdevita.creeperheal2.core.ExplosionManager import net.pdevita.creeperheal2.core.Gravity import net.pdevita.creeperheal2.listeners.Explode import net.pdevita.creeperheal2.utils.Stats +import org.bukkit.Material import org.bukkit.block.Block import org.bukkit.entity.Entity +import org.bukkit.inventory.ItemStack import org.bukkit.plugin.java.JavaPlugin import java.io.File import java.util.* @@ -68,7 +70,19 @@ class CreeperHeal2 : JavaPlugin() { return null } - val newBlockList = LinkedList(blockList.filter { settings.blockList.allowMaterial(it.type) }) + val newBlockList = LinkedList() + for (block in blockList) { + if (settings.blockList.allowMaterial(block.type)) { + if (block.type != Material.BEDROCK && block.type != Material.AIR && block.type != Material.WATER) { + newBlockList.add(block) + } + } else { + if (settings.general.dropBlacklisted) { + block.breakNaturally() + block.world.dropItemNaturally(block.location, ItemStack(block.type)) + } + } + } if (newBlockList.isEmpty()) { return null From 0c6bc2bc61fd81fbb92d8eb1f1170a6953e8b8f4 Mon Sep 17 00:00:00 2001 From: Wyzebb Date: Thu, 3 Jul 2025 17:26:06 +0100 Subject: [PATCH 3/3] Add new option in config.yml --- src/main/resources/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 423d2fd..0334078 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -24,6 +24,8 @@ disable-containers: false # Support entity-type blocks (Paintings, Item Frames, Armor Stands) entity-type: true +always-drop-blacklisted-items: false + # Turbo Mode # Turbo Mode can help repair larger explosions faster. # The minimum number of blocks an explosion should involve before turbo mode is activated @@ -64,4 +66,4 @@ factions: bstats: true # Enable debug mode -debug: false \ No newline at end of file +debug: false