From 76bb21c602f47083574311482278cbcc4b348c12 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Wed, 14 May 2025 13:52:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/mixins/EntityMixin.java | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/mixins/EntityMixin.java b/src/main/java/com/atsuishio/superbwarfare/mixins/EntityMixin.java index 8569c599b..febb7b888 100644 --- a/src/main/java/com/atsuishio/superbwarfare/mixins/EntityMixin.java +++ b/src/main/java/com/atsuishio/superbwarfare/mixins/EntityMixin.java @@ -1,25 +1,3 @@ - - -//@Mixin(Entity.class) -//public class EntityMixin { - - // TODO 优化后续逻辑 -// @Redirect(method = "turn(DD)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;setXRot(F)V", ordinal = 1)) -// public void turn(Entity instance, float pXRot) { -// if (instance instanceof Player player) { -// player.setXRot(player.getXRot()); -// while (player.getXRot() > 180F) { -// player.setXRot(player.getXRot() - 360F); -// } -// while (player.getYRot() <= -180F) { -// player.setXRot(player.getXRot() + 360F); -// } -// } else { -// instance.setXRot(Mth.clamp(instance.getXRot(), -90.0F, 90.0F)); -// } -// } -//} - package com.atsuishio.superbwarfare.mixins; import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity; @@ -59,4 +37,20 @@ public class EntityMixin { MobileVehicleEntity.IGNORE_ENTITY_GROUND_CHECK_STEPPING = false; } } + + // TODO 优化后续逻辑 +// @Redirect(method = "turn(DD)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;setXRot(F)V", ordinal = 1)) +// public void turn(Entity instance, float pXRot) { +// if (instance instanceof Player player) { +// player.setXRot(player.getXRot()); +// while (player.getXRot() > 180F) { +// player.setXRot(player.getXRot() - 360F); +// } +// while (player.getYRot() <= -180F) { +// player.setXRot(player.getXRot() + 360F); +// } +// } else { +// instance.setXRot(Mth.clamp(instance.getXRot(), -90.0F, 90.0F)); +// } +// } }