9
0
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:
_OfTeN_
2022-11-21 15:58:06 +03:00
parent 47605e4885
commit 685e3dbb2b
2 changed files with 10 additions and 0 deletions

View File

@@ -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
}

View File

@@ -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