diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/DestroyableProjectileEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/DestroyableProjectileEntity.java deleted file mode 100644 index 0149349e3..000000000 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/DestroyableProjectileEntity.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.atsuishio.superbwarfare.entity.projectile; - -public interface DestroyableProjectileEntity { -} diff --git a/src/main/java/com/atsuishio/superbwarfare/tools/SeekTool.java b/src/main/java/com/atsuishio/superbwarfare/tools/SeekTool.java index 5f43e207c..d9b2162bf 100644 --- a/src/main/java/com/atsuishio/superbwarfare/tools/SeekTool.java +++ b/src/main/java/com/atsuishio/superbwarfare/tools/SeekTool.java @@ -2,11 +2,11 @@ package com.atsuishio.superbwarfare.tools; import com.atsuishio.superbwarfare.config.server.SeekConfig; import com.atsuishio.superbwarfare.entity.projectile.DecoyEntity; -import com.atsuishio.superbwarfare.entity.projectile.DestroyableProjectileEntity; import com.atsuishio.superbwarfare.entity.projectile.SmokeDecoyEntity; import com.atsuishio.superbwarfare.entity.projectile.SwarmDroneEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; +import com.atsuishio.superbwarfare.init.ModTags; import net.minecraft.core.BlockPos; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.entity.Entity; @@ -197,7 +197,7 @@ public class SeekTool { public static boolean baseFilter(Entity entity) { return entity.isAlive() - && !(entity instanceof HangingEntity || (entity instanceof Projectile && !(entity instanceof DestroyableProjectileEntity))) + && !(entity instanceof HangingEntity || (entity instanceof Projectile && !entity.getType().is(ModTags.EntityTypes.DESTROYABLE_PROJECTILE))) && !(entity instanceof Player player && player.isSpectator()) && !isInBlackList(entity); } diff --git a/src/main/java/com/atsuishio/superbwarfare/tools/TraceTool.java b/src/main/java/com/atsuishio/superbwarfare/tools/TraceTool.java index 0da47821d..60c8c0e3e 100644 --- a/src/main/java/com/atsuishio/superbwarfare/tools/TraceTool.java +++ b/src/main/java/com/atsuishio/superbwarfare/tools/TraceTool.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.tools; import com.atsuishio.superbwarfare.entity.projectile.DecoyEntity; -import com.atsuishio.superbwarfare.entity.projectile.DestroyableProjectileEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -109,7 +108,7 @@ public class TraceTool { Vec3 viewVec = vehicle.getBarrelVector(1); Vec3 toVec = eye.add(viewVec.x * entityReach, viewVec.y * entityReach, viewVec.z * entityReach); AABB aabb = vehicle.getBoundingBox().expandTowards(viewVec.scale(entityReach)).inflate(1.0D, 1.0D, 1.0D); - EntityHitResult entityhitresult = ProjectileUtil.getEntityHitResult(vehicle, eye, toVec, aabb, p -> !p.isSpectator() && p.isAlive() && !(p instanceof Projectile && !(p instanceof DestroyableProjectileEntity)) && SeekTool.baseFilter(p) && !(p instanceof DecoyEntity) && smokeFilter(p), distance); + EntityHitResult entityhitresult = ProjectileUtil.getEntityHitResult(vehicle, eye, toVec, aabb, p -> !p.isSpectator() && p.isAlive() && SeekTool.baseFilter(p) && !(p instanceof DecoyEntity) && smokeFilter(p), distance); if (entityhitresult != null) { hitResult = entityhitresult;