Fix magnitude for 'Explosion' always being '0' (SD-7555)

The magnitude value has not been parsed and evaluated correctly if it was a string (default is `1 * {level}`
This commit is contained in:
Christian Koop 2021-04-13 09:39:47 +02:00
parent 1c8bdd0cae
commit 6032ecd012
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
2 changed files with 6 additions and 1 deletions

View File

@ -91,6 +91,7 @@
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>fr.mrmicky</groupId>
@ -108,6 +109,7 @@
<groupId>com.songoda</groupId>
<artifactId>UltimateBottles</artifactId>
<version>1_0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>

View File

@ -2,6 +2,7 @@ package com.songoda.epicenchants.effect.effects;
import com.songoda.epicenchants.effect.EffectExecutor;
import com.songoda.epicenchants.enums.EventType;
import com.songoda.epicenchants.objects.LeveledModifier;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -15,6 +16,8 @@ public class Explode extends EffectExecutor {
@Override
public void execute(@NotNull Player user, @Nullable LivingEntity opponent, int level, EventType eventType) {
consume(entity -> entity.getWorld().createExplosion(entity.getLocation(), getSection().getInt("magnitude")), user, opponent);
consume(entity -> entity.getWorld().createExplosion(entity.getLocation(), (float) LeveledModifier
.of(getSection().getString("magnitude")).get(level, level, user, opponent)),
user, opponent);
}
}