From 0699c9b4f025f0cf51d2a860ac03f9349e18a615 Mon Sep 17 00:00:00 2001 From: MATRIX-feather Date: Sun, 22 Oct 2023 16:04:19 +0800 Subject: [PATCH] =?UTF-8?q?misc:=20=E4=BD=BFFlyAbility=E6=AF=8F=E9=9A=94?= =?UTF-8?q?=E4=B8=80=E6=AE=B5=E6=97=B6=E9=97=B4=E6=A3=80=E6=9F=A5=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E7=8E=A9=E5=AE=B6=E9=A3=9E=E8=A1=8C=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/xiamomc/morph/abilities/impl/FlyAbility.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java b/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java index f856c05e..2d2e68e2 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java +++ b/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java @@ -16,6 +16,7 @@ import xiamomc.morph.config.ConfigOption; import xiamomc.morph.config.MorphConfigManager; import xiamomc.morph.misc.DisguiseState; +import xiamomc.morph.misc.NmsRecord; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; @@ -90,6 +91,14 @@ public boolean handle(Player player, DisguiseState state) double delta; + // 检查玩家飞行速度是否正确 + if (plugin.getCurrentTick() % 10 == 0) + { + var configSpeed = config.getFlyingSpeed(); + if (player.getFlySpeed() != configSpeed && NmsRecord.ofPlayer(player).gameMode.isSurvival()) + player.setFlySpeed(configSpeed); + } + // 当玩家骑乘实体时不要计算位移 if (player.getVehicle() == null) {