diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/SpeedboatEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/SpeedboatEntity.java index 751ac2bf5..70ef3b51b 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/SpeedboatEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/SpeedboatEntity.java @@ -542,10 +542,6 @@ public class SpeedboatEntity extends MobileVehicleEntity implements GeoEntity, I } @Override - protected boolean canAddPassenger(Entity pPassenger) { - return this.getPassengers().size() < this.getMaxPassengers(); - } - public int getMaxPassengers() { return 5; } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/VehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/VehicleEntity.java index 5e006d059..4b1eb8f7e 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/VehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/VehicleEntity.java @@ -117,6 +117,11 @@ public class VehicleEntity extends Entity { player.setYRot(this.getYRot()); return player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS; } + if (this.getPassengers().size() < this.getMaxPassengers()) { + player.setXRot(this.getXRot()); + player.setYRot(this.getYRot()); + return player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS; + } } } else if (!this.level().isClientSide) { if (this.getFirstPassenger() == null) { @@ -129,6 +134,11 @@ public class VehicleEntity extends Entity { player.setYRot(this.getYRot()); return player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS; } + if (this.getPassengers().size() < this.getMaxPassengers()) { + player.setXRot(this.getXRot()); + player.setYRot(this.getYRot()); + return player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS; + } } return InteractionResult.PASS; } @@ -208,6 +218,15 @@ public class VehicleEntity extends Entity { return hasPassenger(attacker) || super.skipAttackInteraction(attacker); } + @Override + protected boolean canAddPassenger(Entity pPassenger) { + return this.getPassengers().size() < this.getMaxPassengers(); + } + + public int getMaxPassengers() { + return 1; + } + @Override public void baseTick() { super.baseTick();