优化代码
This commit is contained in:
parent
4e8fae569d
commit
76bb21c602
1 changed files with 16 additions and 22 deletions
|
@ -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));
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue