Files
VS--Improved-Aerodynamics/src/main/java/dev/lumareth/improvedAerodynamics/Config.java
T

143 lines
8.5 KiB
Java

package dev.lumareth.improvedAerodynamics;
import net.minecraftforge.common.ForgeConfigSpec;
public final class Config {
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
static {
BUILDER.push("terrainStreaming");
}
public static final ForgeConfigSpec.DoubleValue LOOKAHEAD_SECONDS = BUILDER
.comment("How many seconds of flight ahead of each ship terrain is loaded for")
.defineInRange("lookaheadSeconds", 3.0D, 0.5D, 20.0D);
public static final ForgeConfigSpec.DoubleValue MIN_SHIP_SPEED = BUILDER
.comment("Ships slower than this (blocks per second) are left to normal player chunk loading")
.defineInRange("minShipSpeed", 8.0D, 0.0D, 1000.0D);
public static final ForgeConfigSpec.IntValue CORRIDOR_MARGIN_CHUNKS = BUILDER
.comment("Extra chunks loaded on each side of a ship's predicted path")
.defineInRange("corridorMarginChunks", 1, 0, 8);
public static final ForgeConfigSpec.IntValue MAX_NEW_CHUNKS_PER_TICK = BUILDER
.comment("Upper limit of chunks newly requested (and newly given an air placeholder) per tick, protects the tick rate")
.defineInRange("maxNewChunksPerTick", 64, 1, 1024);
static {
BUILDER.pop();
BUILDER.push("airPlaceholder");
}
public static final ForgeConfigSpec.BooleanValue ENABLE_AIR_PLACEHOLDER = BUILDER
.comment("Valkyrien Skies treats terrain it has not received yet as solid, so ships hit a wall at unloaded chunks.",
"When enabled, chunks on a ship's path that are not loaded yet are treated as air above the estimated",
"world generation surface until the real terrain arrives. Everything below that stays solid.")
.define("enableAirPlaceholder", false);
public static final ForgeConfigSpec.IntValue PLACEHOLDER_SURFACE_MARGIN = BUILDER
.comment("Blocks above the estimated surface that stay solid, covers trees and structures")
.defineInRange("placeholderSurfaceMargin", 32, 0, 256);
public static final ForgeConfigSpec.IntValue PLACEHOLDER_RELEASE_TICKS = BUILDER
.comment("Ticks a placeholder chunk stays air after no ship needs it anymore, then it goes back to solid")
.defineInRange("placeholderReleaseTicks", 100, 20, 6000);
static {
BUILDER.pop();
BUILDER.comment("Warium VS (and Futurism) flight physics. Only has an effect when those mods are installed").push("flight");
}
public static final ForgeConfigSpec.BooleanValue SMOOTH_FORCE_DELIVERY = BUILDER
.comment("Warium computes its forces 20 times per second but applies them in only one of the physics substeps",
"in between, which makes thrust and lift jerky. When enabled, each tick's forces are spread evenly",
"over all substeps. The total push per tick stays the same, so existing craft keep their tuning")
.define("smoothForceDelivery", true);
public static final ForgeConfigSpec.BooleanValue PHYSICS_RATE_AERODYNAMICS = BUILDER
.comment("Recompute wing, stabilizer, control surface and air brake forces every physics substep from the",
"ship's current motion instead of once per tick from its motion one tick ago. Uses Warium's own",
"formulas, so craft fly the same, minus the wobble. Required for auto trim and the improved flight model")
.define("physicsRateAerodynamics", true);
public static final ForgeConfigSpec.BooleanValue CONTROL_SMOOTHING = BUILDER
.comment("Control surfaces move back to neutral as smoothly as they deflect, instead of snapping back on key release")
.define("controlSmoothing", true);
public static final ForgeConfigSpec.BooleanValue IMPLICIT_DAMPING = BUILDER
.comment("Integrate aerodynamic damping implicitly, so many wings on a light craft can no longer overshoot",
"and make it shake. Only changes anything where the damping would otherwise overshoot")
.define("implicitDamping", true);
public static final ForgeConfigSpec.BooleanValue IMPROVED_FLIGHT_MODEL = BUILDER
.comment("Replace Warium's lift and damping with a model based on each surface's angle of attack:",
"lift grows with the square of airspeed, the air pressure at the altitude and the wing's shape (long narrow",
"wings lift better), surfaces stall one by one when their angle of attack gets",
"too high, and stalled surfaces stop damping rotation, which allows post-stall maneuvers with",
"thrust vectoring. Changes how craft fly")
.define("improvedFlightModel", false);
public static final ForgeConfigSpec.DoubleValue LIFT_SCALE = BUILDER
.comment("Improved flight model: multiplier for the lift of all surfaces (drag is unchanged). Raise it if a craft",
"cannot stay up at the speed it should fly at, lower it for craft that climb too easily")
.defineInRange("liftScale", 1.0D, 0.1D, 10.0D);
public static final ForgeConfigSpec.DoubleValue STALL_ANGLE_SCALE = BUILDER
.comment("Improved flight model: multiplier for the angle of attack at which surfaces stall")
.defineInRange("stallAngleScale", 1.0D, 0.5D, 2.0D);
public static final ForgeConfigSpec.DoubleValue STABILIZER_DRAG = BUILDER
.comment("Improved flight model: parasitic drag coefficient of stabilizers and vertical wings. They stabilize",
"with lift, so this only costs speed. Wings use Warium's 1.0, which also stands in for fuselage drag")
.defineInRange("stabilizerDrag", 0.2D, 0.0D, 2.0D);
public static final ForgeConfigSpec.BooleanValue TRANSONIC_DRAG = BUILDER
.comment("Improved flight model: zero-lift drag rises steeply around the speed of sound, so craft can no longer",
"cruise supersonic without a lot of thrust or a clean shape. Induced and stall drag are not affected")
.define("transonicDrag", true);
public static final ForgeConfigSpec.DoubleValue SPEED_OF_SOUND = BUILDER
.comment("Improved flight model: speed of sound in blocks per second, Mach 1 for the transonic drag")
.defineInRange("speedOfSound", 100.0D, 10.0D, 1000.0D);
public static final ForgeConfigSpec.DoubleValue TRANSONIC_PEAK_DRAG = BUILDER
.comment("Improved flight model: multiplier for zero-lift drag at its peak, at Mach 1.05")
.defineInRange("transonicPeakDrag", 4.0D, 1.0D, 20.0D);
public static final ForgeConfigSpec.DoubleValue SUPERSONIC_DRAG = BUILDER
.comment("Improved flight model: multiplier for zero-lift drag once fully supersonic, from Mach 1.3")
.defineInRange("supersonicDrag", 2.0D, 1.0D, 20.0D);
public static final ForgeConfigSpec.BooleanValue VORTEX_LIFT = BUILDER
.comment("Improved flight model: wings with a low aspect ratio (delta wings) stall later and get extra lift at",
"high angles of attack from leading-edge vortices. Wings with an aspect ratio of 3 or more are not affected")
.define("vortexLift", true);
public static final ForgeConfigSpec.DoubleValue VORTEX_STALL_BONUS = BUILDER
.comment("Improved flight model: extra stall angle of the lowest aspect ratio wings (1 or less) as a fraction of",
"the normal stall angle, 1.0 doubles it, for example from 16 to 32 degrees")
.defineInRange("vortexStallBonus", 1.0D, 0.0D, 3.0D);
public static final ForgeConfigSpec.DoubleValue VORTEX_LIFT_STRENGTH = BUILDER
.comment("Improved flight model: multiplier for the extra lift the vortices make at high angles of attack")
.defineInRange("vortexLiftStrength", 1.0D, 0.0D, 3.0D);
public static final ForgeConfigSpec.DoubleValue TRIM_AUTHORITY = BUILDER
.comment("Auto trim: largest pitch input (fraction of full deflection) the trim may hold")
.defineInRange("trimAuthority", 0.5D, 0.0D, 1.0D);
public static final ForgeConfigSpec.DoubleValue TRIM_MIN_SPEED = BUILDER
.comment("Auto trim: below this airspeed (blocks per second) the trim holds its current value")
.defineInRange("trimMinSpeed", 10.0D, 0.0D, 100.0D);
static {
BUILDER.pop();
}
static final ForgeConfigSpec SPEC = BUILDER.build();
private Config() {
}
}