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 07f966c04..63339e5de 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java @@ -175,7 +175,7 @@ public class SmallCannonShellEntity extends FastThrowableProjectile implements G .getEntities(this, this.getBoundingBox() .expandTowards(this.getDeltaMovement()) - .inflate(0.5) + .inflate(0.75) ); for (Entity entity : entities) { diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java index 38a5b429e..8cad2570f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Hpj11Entity.java @@ -229,6 +229,12 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti this.setDeltaMovement(this.getDeltaMovement().add(0.0, -0.04, 0.0)); } + if (this.getFirstPassenger() instanceof Player player && fireInputDown) { + if ((this.entityData.get(AMMO) > 0 || InventoryTool.hasCreativeAmmoBox(player)) && !cannotFire) { + vehicleShoot(player, 0); + } + } + this.entityData.set(GUN_ROTATE, this.entityData.get(GUN_ROTATE) * 0.8f); setGunRot(getGunRot() + entityData.get(GUN_ROTATE)); @@ -307,9 +313,7 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti if (target.distanceTo(this) <= 144 && VectorTool.calculateAngle(getViewVector(1), targetVec) < 10) { if (checkNoClip(target, barrelRootPos) && entityData.get(AMMO) > 0) { vehicleShoot(player, 0); - findEntityOnPath(barrelRootPos, targetVec); - } else { changeTargetTimer++; } @@ -550,12 +554,12 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti @Override public int mainGunRpm(Player player) { - return 1200; + return 0; } @Override public boolean canShoot(Player player) { - return (this.entityData.get(AMMO) > 0 || InventoryTool.hasCreativeAmmoBox(player)) && !cannotFire; + return false; } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java index c800c67e9..5e5f7d3b8 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java @@ -71,6 +71,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements public boolean upInputDown; public boolean downInputDown; public boolean decoyInputDown; + public boolean fireInputDown; public double lastTickSpeed; public double lastTickVerticalSpeed; public int collisionCoolDown; @@ -135,6 +136,8 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements = (keys & 0b0100000) > 0; decoyInputDown = (keys & 0b1000000) > 0; + fireInputDown + = (keys & 0b1000001) > 0; } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java b/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java index e76545783..0af8e672f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/event/ClientEventHandler.java @@ -270,6 +270,9 @@ public class ClientEventHandler { if (ModKeyMappings.RELEASE_DECOY.isDown()) { keys |= 0b1000000; } + if (holdFireVehicle) { + keys |= 0b1000001; + } } if (keys != keysCache) {