From c1886d7da5b3c14a8ade9e783c79ce9eb19fe4a3 Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Thu, 22 May 2025 16:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96DPS=E5=8F=91=E7=94=B5?= =?UTF-8?q?=E6=9C=BA=E5=92=8C=E6=A0=87=E9=9D=B6=E7=9A=84=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/entity/DPSGeneratorEntity.java | 8 ++++---- .../com/atsuishio/superbwarfare/entity/TargetEntity.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/DPSGeneratorEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/DPSGeneratorEntity.java index 50a44a6b9..0bdf2d15d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/DPSGeneratorEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/DPSGeneratorEntity.java @@ -152,6 +152,10 @@ public class DPSGeneratorEntity extends LivingEntity implements GeoEntity { @Override public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) { + if (player.getMainHandItem() != ItemStack.EMPTY) { + return InteractionResult.PASS; + } + if (player.isShiftKeyDown()) { if (!this.level().isClientSide()) { this.discard(); @@ -161,10 +165,6 @@ public class DPSGeneratorEntity extends LivingEntity implements GeoEntity { player.addItem(new ItemStack(ModItems.DPS_GENERATOR_DEPLOYER.get())); } } else { - if (player.getMainHandItem() != ItemStack.EMPTY) { - return InteractionResult.PASS; - } - this.lookAt(EntityAnchorArgument.Anchor.EYES, new Vec3((player.getX()), this.getY(), (player.getZ()))); this.setXRot(0); this.xRotO = this.getXRot(); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/TargetEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/TargetEntity.java index c75cd92ec..868a1a101 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/TargetEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/TargetEntity.java @@ -135,6 +135,10 @@ public class TargetEntity extends LivingEntity implements GeoEntity { @Override public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) { + if (player.getMainHandItem() != ItemStack.EMPTY) { + return InteractionResult.PASS; + } + if (player.isShiftKeyDown()) { if (!this.level().isClientSide()) { this.discard(); @@ -144,10 +148,6 @@ public class TargetEntity extends LivingEntity implements GeoEntity { player.addItem(new ItemStack(ModItems.TARGET_DEPLOYER.get())); } } else { - if (player.getMainHandItem() != ItemStack.EMPTY) { - return InteractionResult.PASS; - } - this.lookAt(EntityAnchorArgument.Anchor.EYES, new Vec3((player.getX()), this.getY(), (player.getZ()))); this.setXRot(0); this.xRotO = this.getXRot();