Don't touch vertical knockback
This commit is contained in:
parent
afed2a8f78
commit
6e45491508
1 changed files with 4 additions and 3 deletions
|
@ -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<EntityType, Double> modifiers = new HashMap<>();
|
||||
private final Map<EntityType, Vector> 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())
|
||||
|
|
Loading…
Reference in a new issue