From 3c3c0d0bdaaaf8993dce0c353efa3b4fbbf15f49 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Sun, 15 Jun 2025 20:04:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E9=99=A4obb=20entity=E8=87=AA?= =?UTF-8?q?=E8=BA=AB=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atsuishio/superbwarfare/mixins/ProjectileUtilMixin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/atsuishio/superbwarfare/mixins/ProjectileUtilMixin.java b/src/main/java/com/atsuishio/superbwarfare/mixins/ProjectileUtilMixin.java index 6f38c28c2..f092a7259 100644 --- a/src/main/java/com/atsuishio/superbwarfare/mixins/ProjectileUtilMixin.java +++ b/src/main/java/com/atsuishio/superbwarfare/mixins/ProjectileUtilMixin.java @@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.mixins; import com.atsuishio.superbwarfare.entity.OBBEntity; import com.atsuishio.superbwarfare.tools.OBB; import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.projectile.Projectile; import net.minecraft.world.entity.projectile.ProjectileUtil; import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; @@ -27,6 +28,10 @@ public class ProjectileUtilMixin { for (var entity : pLevel.getEntities(pProjectile, pBoundingBox, pFilter)) { if (entity instanceof OBBEntity obbEntity) { + if (pProjectile instanceof Projectile projectile && + (projectile.getOwner() == entity || entity.getPassengers().contains(projectile.getOwner()))) { + continue; + } OBB obb = obbEntity.getOBB().inflate(pInflationAmount * 2); Optional optional = obb.clip(pStartVec.toVector3f(), pEndVec.toVector3f());