diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/ClaymoreEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/ClaymoreEntity.java index ac559150b..015eca347 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/ClaymoreEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/ClaymoreEntity.java @@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.entity; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity; import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.tools.CustomExplosion; import com.atsuishio.superbwarfare.tools.EntityFindUtil; @@ -180,7 +181,7 @@ public class ClaymoreEntity extends Entity implements GeoEntity, AnimatedEntity, final Vec3 center = new Vec3(x + 1.5 * this.getLookAngle().x, y + 1.5 * this.getLookAngle().y, z + 1.5 * this.getLookAngle().z); for (Entity target : level.getEntitiesOfClass(Entity.class, new AABB(center, center).inflate(2.5 / 2d), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) { var condition = this.getOwner() != target - && target instanceof LivingEntity + && (target instanceof LivingEntity || target instanceof VehicleEntity) && !(target instanceof TargetEntity) && !(target instanceof Player player && (player.isCreative() || player.isSpectator())) && (this.getOwner() != null && !this.getOwner().isAlliedTo(target) || target.getTeam() == null || target.getTeam().getName().equals("TDM")) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MobileVehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MobileVehicleEntity.java index 719ccfea7..620b1d937 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MobileVehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MobileVehicleEntity.java @@ -15,6 +15,7 @@ import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.util.Mth; +import net.minecraft.world.entity.AreaEffectCloud; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MoverType; @@ -138,7 +139,7 @@ public class MobileVehicleEntity extends EnergyVehicleEntity { var entities = level().getEntities(EntityTypeTest.forClass(Entity.class), frontBox, entity -> entity != this && entity != getFirstPassenger() && entity.getVehicle() == null) .stream().filter(entity -> entity.isAlive() - && !(entity instanceof ItemEntity || entity instanceof Projectile || entity instanceof ProjectileEntity || entity instanceof LaserEntity || entity instanceof FlareDecoyEntity) + && !(entity instanceof ItemEntity || entity instanceof Projectile || entity instanceof ProjectileEntity || entity instanceof LaserEntity || entity instanceof FlareDecoyEntity || entity instanceof AreaEffectCloud) && !(entity instanceof Player player && (player.isSpectator() || player.isCreative()))) .toList(); diff --git a/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java b/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java index 124ddfd7b..0ca0e0ff6 100644 --- a/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java @@ -166,7 +166,7 @@ public class ClientEventHandler { float xRot = player.getViewXRot(event.getPartialTick()) - xRotOffset; float yRot = player.getViewYRot(event.getPartialTick()) - yRotOffset; turnRot[0] = Mth.clamp(0.05 * xRot, -5, 5) * (1 - 0.75 * zoomTime); - turnRot[1] = Mth.clamp(0.05 * yRot, -10, 10) * (1 - 0.75 * zoomTime) + 1.5f * (Mth.DEG_TO_RAD * recoilHorizon) * (0.5 + 0.4 * fireSpread); + turnRot[1] = Mth.clamp(0.05 * yRot, -10, 10) * (1 - 0.75 * zoomTime); turnRot[2] = Mth.clamp(0.1 * yRot, -10, 10) * (1 - zoomTime); } @@ -263,12 +263,12 @@ public class ClientEventHandler { boolean lookAtEntity = false; - Entity lookingEntity = TraceTool.findLookingEntity(player, 3.5); + Entity lookingEntity = TraceTool.findLookingEntity(player, player.getEntityReach() + 2); - BlockHitResult result = player.level().clip(new ClipContext(player.getEyePosition(), player.getEyePosition().add(player.getLookAngle().scale(3.5)), + BlockHitResult result = player.level().clip(new ClipContext(player.getEyePosition(), player.getEyePosition().add(player.getLookAngle().scale(player.getBlockReach() + 2)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player)); - Vec3 looking = Vec3.atLowerCornerOf(player.level().clip(new ClipContext(player.getEyePosition(), player.getEyePosition().add(player.getLookAngle().scale(3.5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player)).getBlockPos()); + Vec3 looking = Vec3.atLowerCornerOf(player.level().clip(new ClipContext(player.getEyePosition(), player.getEyePosition().add(player.getLookAngle().scale(player.getBlockReach() + 2)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player)).getBlockPos()); BlockState blockState = player.level().getBlockState(BlockPos.containing(looking.x(), looking.y(), looking.z())); if (lookingEntity != null) { @@ -1356,6 +1356,9 @@ public class ClientEventHandler { zoom = false; holdFire = false; ClickHandler.switchZoom = false; + lungeDraw = 30; + lungeSprint = 0; + lungeAttack = 0; } } diff --git a/src/main/java/com/atsuishio/superbwarfare/item/LungeMine.java b/src/main/java/com/atsuishio/superbwarfare/item/LungeMine.java index 8dbd8fc44..a8ed98120 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/LungeMine.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/LungeMine.java @@ -41,7 +41,7 @@ public class LungeMine extends Item implements GeoItem, AnimatedItem { public static ItemDisplayContext transformType; public LungeMine() { - super(new Properties().stacksTo(64)); + super(new Properties().stacksTo(4)); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/mixins/MouseHandlerMixin.java b/src/main/java/com/atsuishio/superbwarfare/mixins/MouseHandlerMixin.java index 678813260..a894e7192 100644 --- a/src/main/java/com/atsuishio/superbwarfare/mixins/MouseHandlerMixin.java +++ b/src/main/java/com/atsuishio/superbwarfare/mixins/MouseHandlerMixin.java @@ -48,6 +48,10 @@ public class MouseHandlerMixin { return ClientEventHandler.zoomVehicle ? 0.23 : 0.28; } + if (player.getVehicle() instanceof Ah6Entity ah6Entity && !ah6Entity.onGround() && ah6Entity.getFirstPassenger() == player) { + return 0.28; + } + if (stack.is(ModItems.MONITOR.get()) && stack.getOrCreateTag().getBoolean("Using") && stack.getOrCreateTag().getBoolean("Linked")) { return 0.33 / (1 + 0.08 * (droneFovLerp - 1)); } diff --git a/src/main/java/com/atsuishio/superbwarfare/network/message/LungeMineAttackMessage.java b/src/main/java/com/atsuishio/superbwarfare/network/message/LungeMineAttackMessage.java index 7c7bcc7bc..761f193d9 100644 --- a/src/main/java/com/atsuishio/superbwarfare/network/message/LungeMineAttackMessage.java +++ b/src/main/java/com/atsuishio/superbwarfare/network/message/LungeMineAttackMessage.java @@ -1,6 +1,7 @@ package com.atsuishio.superbwarfare.network.message; import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.tools.CustomExplosion; @@ -56,7 +57,7 @@ public class LungeMineAttackMessage { } Entity lookingEntity = EntityFindUtil.findEntity(player.level(), String.valueOf(message.uuid)); if (lookingEntity != null) { - lookingEntity.hurt(ModDamageTypes.causeLungeMineDamage(player.level().registryAccess(), player, player), 150); + lookingEntity.hurt(ModDamageTypes.causeLungeMineDamage(player.level().registryAccess(), player, player), lookingEntity instanceof VehicleEntity ? 400 : 150); causeLungeMineExplode(player.level(), player, lookingEntity); } } else if (message.type == 1) { diff --git a/src/main/java/com/atsuishio/superbwarfare/tools/SeekTool.java b/src/main/java/com/atsuishio/superbwarfare/tools/SeekTool.java index 24dc385f0..41ecd66bc 100644 --- a/src/main/java/com/atsuishio/superbwarfare/tools/SeekTool.java +++ b/src/main/java/com/atsuishio/superbwarfare/tools/SeekTool.java @@ -5,6 +5,7 @@ import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity; import com.atsuishio.superbwarfare.entity.vehicle.MobileVehicleEntity; import net.minecraft.core.BlockPos; import net.minecraft.util.Mth; +import net.minecraft.world.entity.AreaEffectCloud; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.ExperienceOrb; import net.minecraft.world.entity.decoration.ArmorStand; @@ -38,7 +39,7 @@ public class SeekTool { && e.isAlive() && e.getVehicle() == null && !(e instanceof Player player && (player.isSpectator())) - && !(e instanceof ItemEntity || e instanceof ExperienceOrb || e instanceof HangingEntity || e instanceof ProjectileEntity || e instanceof Projectile || e instanceof ArmorStand) + && !(e instanceof ItemEntity || e instanceof ExperienceOrb || e instanceof HangingEntity || e instanceof ProjectileEntity || e instanceof Projectile || e instanceof ArmorStand || e instanceof ClaymoreEntity || e instanceof AreaEffectCloud) ) { return level.clip(new ClipContext(entity.getEyePosition(), e.getEyePosition(), ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, entity)).getType() != HitResult.Type.BLOCK; @@ -53,7 +54,7 @@ public class SeekTool { if (e.distanceTo(entity) <= seekRange && calculateAngle(e, entity) < seekAngle && e != entity && e.isAlive() - && !(e instanceof ItemEntity || e instanceof ExperienceOrb || e instanceof HangingEntity || e instanceof ProjectileEntity || e instanceof Projectile || e instanceof ArmorStand) + && !(e instanceof ItemEntity || e instanceof ExperienceOrb || e instanceof HangingEntity || e instanceof ProjectileEntity || e instanceof Projectile || e instanceof ArmorStand || e instanceof ClaymoreEntity || e instanceof AreaEffectCloud) && e.getVehicle() == null && !(e instanceof Player player && (player.isSpectator())) && (!e.isAlliedTo(entity) || e.getTeam() == null || e.getTeam().getName().equals("TDM"))) { @@ -70,7 +71,7 @@ public class SeekTool { if (e.distanceTo(entity) <= seekRange && calculateAngle(e, entity) < seekAngle && e != entity && e.isAlive() - && !(e instanceof ItemEntity || e instanceof ExperienceOrb || e instanceof HangingEntity || e instanceof ProjectileEntity || e instanceof Projectile || e instanceof ArmorStand) + && !(e instanceof ItemEntity || e instanceof ExperienceOrb || e instanceof HangingEntity || e instanceof ProjectileEntity || e instanceof Projectile || e instanceof ArmorStand || e instanceof ClaymoreEntity || e instanceof AreaEffectCloud) && e.getVehicle() == null && !(e instanceof Player player && (player.isSpectator())) && (!e.isAlliedTo(entity) || e.getTeam() == null || e.getTeam().getName().equals("TDM"))) { @@ -85,7 +86,7 @@ public class SeekTool { return StreamSupport.stream(EntityFindUtil.getEntities(level).getAll().spliterator(), false) .filter(e -> e.distanceToSqr(pos.getX(), pos.getY(), pos.getZ()) <= range * range && e.isAlive() - && !(e instanceof ItemEntity || e instanceof ExperienceOrb || e instanceof HangingEntity || e instanceof ProjectileEntity || e instanceof Projectile || e instanceof ArmorStand || e instanceof ClaymoreEntity) + && !(e instanceof ItemEntity || e instanceof ExperienceOrb || e instanceof HangingEntity || e instanceof ProjectileEntity || e instanceof Projectile || e instanceof ArmorStand || e instanceof ClaymoreEntity || e instanceof AreaEffectCloud) && !(e instanceof Player player && player.isSpectator())) .toList(); }