Skip to content

Commit

Permalink
collision damage multiplier config (#216)
Browse files Browse the repository at this point in the history
Adds a new config: collisionDamageMultiplier (default 40), to adjust how much damage do aircraft take when colliding, especifically.
  • Loading branch information
AtobaAzul authored Nov 4, 2024
1 parent fa59252 commit 9f29413
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions common/src/main/java/immersive_aircraft/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public static Config getInstance() {
@BooleanConfigEntry(true)
public boolean collisionDamage;

@FloatConfigEntry(40.0f)
public float collisionDamageMultiplier;

@BooleanConfigEntry(false)
public boolean burnFuelInCreative;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public void move(@NotNull MoverType movementType, @NotNull Vec3 movement) {
if (collision > 0) {
float repeat = 1.0f - (getDamageWobbleTicks() + 1) / 10.0f;
if (repeat > 0.0001f) {
float damage = collision * 40 * repeat * repeat;
float damage = collision * Config.getInstance().collisionDamageMultiplier * repeat * repeat;
NetworkHandler.sendToServer(new CollisionMessage(damage));
}
}
Expand Down

0 comments on commit 9f29413

Please sign in to comment.