diff --git a/src/main/java/eu/m724/tweaks/knockback/KnockbackListener.java b/src/main/java/eu/m724/tweaks/knockback/KnockbackListener.java index 14e4764..3239d5c 100644 --- a/src/main/java/eu/m724/tweaks/knockback/KnockbackListener.java +++ b/src/main/java/eu/m724/tweaks/knockback/KnockbackListener.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Minecon724 + * Copyright (C) 2025 Minecon724 * Tweaks724 is licensed under the GNU General Public License. See the LICENSE.md file * in the project root for the full license text. */ @@ -13,12 +13,13 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityKnockbackByEntityEvent; import org.bukkit.plugin.Plugin; +import org.bukkit.util.Vector; import java.util.HashMap; import java.util.Map; public class KnockbackListener implements Listener { - private final Map modifiers = new HashMap<>(); + private final Map modifiers = new HashMap<>(); public KnockbackListener(Plugin plugin) { TweaksConfig.getConfig().knockbackModifiers().forEach((k, v) -> { @@ -45,7 +46,7 @@ public class KnockbackListener implements Listener { } if (mod == 1) return; - modifiers.put(type, mod); + modifiers.put(type, new Vector(mod, mod >= 1 ? mod : 1, mod)); // don't touch vertical }); if (!modifiers.isEmpty())