diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java index 52f2c3cf1..3c047127b 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java @@ -43,7 +43,6 @@ import java.util.Set; public class CannonShellEntity extends FastThrowableProjectile implements GeoEntity { private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public String animationProcedure = "empty"; private float damage = 0; private float radius = 0; private float explosionDamage = 0; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java index 29bf1af3c..554a403cc 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java @@ -23,7 +23,6 @@ import net.minecraft.world.level.block.BellBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.EntityHitResult; -import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; import net.neoforged.neoforge.event.EventHooks; import net.neoforged.neoforge.network.PacketDistributor; @@ -122,24 +121,6 @@ public class SmallCannonShellEntity extends FastThrowableProjectile implements G ParticleTool.spawnSmallExplosionParticles(this.level(), vec3); } - private void causeExplodeBlock(HitResult result) { - CustomExplosion explosion = new CustomExplosion(this.level(), this, - ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), - this, - this.getOwner()), - explosionDamage, - result.getLocation().x, - result.getLocation().y, - result.getLocation().z, - explosionRadius, - ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). - setDamageMultiplier(1.25f); - explosion.explode(); - EventHooks.onExplosionStart(this.level(), explosion); - explosion.finalizeExplosion(false); - ParticleTool.spawnSmallExplosionParticles(this.level(), result.getLocation()); - } - @Override public void tick() { super.tick(); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java index 308a26e1b..af93576d5 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java @@ -531,38 +531,6 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, this.setXRot(Mth.clamp(this.getXRot() + Mth.clamp(diffX, -0.8f, 0.8f), -45, 5f)); } - public void autoAim() { - if (this.getEnergy() <= 0) return; - - Entity target = SeekTool.seekLivingEntity(this, this.level(), 64, 30); - - if (target == null) return; - - float yRot = this.getYRot(); - if (yRot < 0) { - yRot += 360; - } - yRot = yRot + 90 % 360; - - var BarrelRoot = new Vector3d(4.95, 2.25, 0); - BarrelRoot.rotateY(-yRot * Mth.DEG_TO_RAD); - - Vec3 barrelRootPos = new Vec3(this.getX() + BarrelRoot.x, this.getY() + BarrelRoot.y, this.getZ() + BarrelRoot.z); - Vec3 targetVec = new Vec3(target.getX() - barrelRootPos.x, target.getEyeY() - barrelRootPos.y, target.getZ() - barrelRootPos.z).normalize(); - - double d0 = targetVec.x; - double d1 = targetVec.y; - double d2 = targetVec.z; - double d3 = Math.sqrt(d0 * d0 + d2 * d2); - this.setXRot(Mth.wrapDegrees((float) (-(Mth.atan2(d1, d3) * 57.2957763671875)))); - float targetY = Mth.wrapDegrees((float) (Mth.atan2(d2, d0) * 57.2957763671875) - 90.0F); - - float diffY = Math.clamp(-90f, 90f, Mth.wrapDegrees(targetY - this.getYRot())); - - this.setYRot(this.getYRot() + Mth.clamp(0.5f * diffY, -1f, 1f)); - this.setRot(this.getYRot(), this.getXRot()); - } - protected void clampRotation(Entity entity) { float f = Mth.wrapDegrees(entity.getXRot()); float f1 = Mth.clamp(f, -45.0F, 5); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java index eea500664..745ae5d41 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java @@ -174,7 +174,7 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo } private void handleAmmo() { - if (!(this.getFirstPassenger() instanceof Player player)) return; + if (!(this.getFirstPassenger() instanceof Player)) return; int ammoCount = this.getItemStacks().stream().filter(stack -> { if (stack.is(ModItems.AMMO_BOX.get())) {