mirror of
https://github.com/Auxilor/EcoSkills.git
synced 2026-01-06 15:51:52 +00:00
Added prevent-multiple-bleeding: true/false to serrated strikes config
This commit is contained in:
@@ -32,6 +32,11 @@ class EffectSerratedStrikes : Effect(
|
||||
return
|
||||
}
|
||||
|
||||
if (victim.hasMetadata("serratedStrikes") &&
|
||||
this.config.getBool("prevent-multiple-bleeding")) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.checkConditions(player)) {
|
||||
return
|
||||
}
|
||||
@@ -52,10 +57,13 @@ class EffectSerratedStrikes : Effect(
|
||||
|
||||
var currentBleedCount = 0
|
||||
|
||||
victim.setMetadata("serratedStrikes", plugin.metadataValueFactory.create(1))
|
||||
|
||||
plugin.runnableFactory.create { bukkitRunnable: RunnableTask ->
|
||||
currentBleedCount++
|
||||
victim.damage(bleedDamage)
|
||||
if (currentBleedCount >= bleedCount) {
|
||||
victim.removeMetadata("serratedStrikes", plugin)
|
||||
bukkitRunnable.cancel()
|
||||
return@create
|
||||
}
|
||||
|
||||
@@ -69,6 +69,8 @@ serrated_strikes:
|
||||
bleed-tick-spacing: 15
|
||||
# The amount of bleed ticks to give
|
||||
bleed-ticks: 4
|
||||
# Prevent multiple stacks of serrated strikes
|
||||
prevent-multiple-bleeding: false
|
||||
# Disabled worlds
|
||||
disabled-in-worlds: [ ]
|
||||
# Conditions
|
||||
|
||||
Reference in New Issue
Block a user