diff --git a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectTelekinesis.kt b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectTelekinesis.kt index 81542a9bc..e0c615d79 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectTelekinesis.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/effects/impl/EffectTelekinesis.kt @@ -107,7 +107,7 @@ object EffectTelekinesis : Effect("telekinesis") { fun handle(event: EntityDeathByEntityEvent) { val victim = event.victim - if (victim is Player && plugin.configYml.getBool("telekinesis.on-players")) { + if (victim is Player && plugin.configYml.getBool("effects.telekinesis.on-players")) { return } diff --git a/core/src/main/kotlin/com/willfp/libreforge/effects/templates/MineBlockEffect.kt b/core/src/main/kotlin/com/willfp/libreforge/effects/templates/MineBlockEffect.kt index 1a4d77a7b..f27fd9cc0 100644 --- a/core/src/main/kotlin/com/willfp/libreforge/effects/templates/MineBlockEffect.kt +++ b/core/src/main/kotlin/com/willfp/libreforge/effects/templates/MineBlockEffect.kt @@ -6,6 +6,7 @@ import com.willfp.libreforge.effects.Effect import com.willfp.libreforge.plugin import com.willfp.libreforge.triggers.TriggerData import com.willfp.libreforge.triggers.TriggerParameter +import org.bukkit.Material import org.bukkit.block.Block import org.bukkit.entity.Player @@ -20,11 +21,15 @@ abstract class MineBlockEffect(id: String) : Effect(id) { } protected fun Player.breakBlocksSafely(blocks: Collection) { - this.runExempted { - for (block in blocks) { - block.setMetadata("block-ignore", plugin.createMetadataValue(true)) - this.breakBlock(block) - block.removeMetadata("block-ignore", plugin) + if (plugin.configYml.getBool("effects.use-setblock-break")) { + blocks.forEach { it.type = Material.AIR } + } else { + this.runExempted { + for (block in blocks) { + block.setMetadata("block-ignore", plugin.createMetadataValue(true)) + this.breakBlock(block) + block.removeMetadata("block-ignore", plugin) + } } } } diff --git a/core/src/main/resources/config.yml b/core/src/main/resources/config.yml index afaafb502..aa8c0f1ce 100644 --- a/core/src/main/resources/config.yml +++ b/core/src/main/resources/config.yml @@ -91,5 +91,15 @@ point-names: # If you have point names that look ugly (e.g. souls) then you can raytrace-distance: 80 # The distance that alt_click should check for a location -telekinesis: - on-players: true # Whether telekinesis should work on players +effects: + telekinesis: + on-players: true # Whether telekinesis should work on players + + # If this is set to true, effects like mine_radius, drill, etc. will simply set the block to air + # instead of actually breaking it. This **will** break compatibility with things, but will also majorly + # improve performance under load. + # Setting this to true means that not only will mine_block and block_item_drop not be triggered, but also + # that other plugins will not be able to interact with the event (e.g. no skill experience will be gained). + # Only set this option to true if you know what you're doing! + use-setblock-break: false + \ No newline at end of file