Add vectored afterburner nozzle with afterburner key and exhaust style
- Add vectored afterburner nozzle block with AzureLib model, deflection, throttle and afterburner state - Drive nozzles from the vehicle control node and map pitch, roll and yaw to differential deflection - Add afterburner toggle key and packet, linked to the control node - Replace Warium exhaust effect entities with improved flames, particles and sounds when exhaustStyle is improved - Add /aero seedgen to measure the air ceiling for the air placeholder - Upgrade Warium VS to 1.1.7 and make the lift use horizontal speed
This commit is contained in:
1 parent
1e659816b8
commit
70eb237d70
56 files changed
+2197
-12
No files matched your search
@@ -46,7 +46,7 @@ public final class AutoTrimToggle {
|
||||
* The control node the seat under the player is linked to. Warium's control seat block finds its seat entity
|
||||
* within half a block of itself, so the seat block is at the entity's block or just below it.
|
||||
*/
|
||||
private static BlockEntity findNode(Level level, BlockPos seatPos) {
|
||||
public static BlockEntity findNode(Level level, BlockPos seatPos) {
|
||||
for (BlockPos pos : new BlockPos[]{seatPos, seatPos.below()}) {
|
||||
BlockEntity seat = level.getBlockEntity(pos);
|
||||
if (seat == null || !seat.getPersistentData().contains("ControlX")) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.Set;
|
||||
*/
|
||||
public final class MixinPlugin implements IMixinConfigPlugin {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger("improved_aerodynamics");
|
||||
private static final String WARIUM_VERSION = "1.1.6";
|
||||
private static final String WARIUM_VERSION = "1.1.7";
|
||||
private static final String FUTURISM_VERSION = "0.0.4";
|
||||
|
||||
private boolean warium;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dev.lumareth.improvedAerodynamics.flight;
|
||||
|
||||
/**
|
||||
* Warium VS 1.1.6's aerodynamic forces, term for term as its block procedures compute them, but evaluated from the
|
||||
* Warium VS 1.1.7's aerodynamic forces, term for term as its block procedures compute them, but evaluated from the
|
||||
* ship's current motion. Like in Warium every block uses the velocity of the ship's center of mass. The procedures'
|
||||
* conditions (air around the block, minimum speed, linked control node) were already checked on the server thread.
|
||||
* Quirks are kept on purpose so craft fly exactly as before: vertical wings have no drag (Warium never sets the
|
||||
@@ -31,7 +31,8 @@ final class WariumAero {
|
||||
switch (s.type()) {
|
||||
case WING -> {
|
||||
out.addForce(r, 0.0, v[1] * Math.abs(v[1]) * -45.0 * p / m, 0.0);
|
||||
out.addForce(r, 0.0, Math.abs(fx * v[0] + fz * v[2]) * 160.0 * p, 0.0);
|
||||
// Lift follows the horizontal speed whichever way the wing faces
|
||||
out.addForce(r, 0.0, Math.hypot(v[0], v[2]) * 160.0 * p, 0.0);
|
||||
double damping = speed * 600.0 * p / m;
|
||||
out.addTorque(-w[0] * damping, -0.1 * w[1] * damping, -w[2] * damping);
|
||||
double drag = -speed * p / m;
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package dev.lumareth.improvedAerodynamics.flight.mixin.warium;
|
||||
|
||||
import dev.lumareth.improvedAerodynamics.exhaust.ImprovedExhaust;
|
||||
import net.mcreator.valkyrienwarium.procedures.BypassedCompressorScriptProcedure;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
/** The improved exhaust style for the medium bypassed compressor, whose jet effect is an exhaust too: no effect entity, the flame of this mod, see {@link ImprovedExhaust}. */
|
||||
@Mixin(value = BypassedCompressorScriptProcedure.class, remap = false)
|
||||
public abstract class BypassedCompressorScriptProcedureMixin {
|
||||
@Inject(method = "execute", at = @At("HEAD"))
|
||||
private static void improvedAerodynamics$begin(LevelAccessor world, double x, double y, double z, BlockState blockstate, CallbackInfo ci) {
|
||||
ImprovedExhaust.begin();
|
||||
}
|
||||
|
||||
@Redirect(method = "execute", at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/level/ServerLevel;m_7967_(Lnet/minecraft/world/entity/Entity;)Z"))
|
||||
private static boolean improvedAerodynamics$addEffect(ServerLevel level, Entity entity) {
|
||||
return ImprovedExhaust.addEffectEntity(level, entity);
|
||||
}
|
||||
|
||||
@Inject(method = "execute", at = @At("TAIL"))
|
||||
private static void improvedAerodynamics$plume(LevelAccessor world, double x, double y, double z, BlockState blockstate, CallbackInfo ci) {
|
||||
ImprovedExhaust.plume(world, x, y, z, blockstate);
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package dev.lumareth.improvedAerodynamics.flight.mixin.warium;
|
||||
|
||||
import dev.lumareth.improvedAerodynamics.exhaust.ImprovedExhaust;
|
||||
import net.mcreator.valkyrienwarium.procedures.JetExhaustOnTickUpdateProcedure;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
/** The improved exhaust style: no effect entities, a bigger particle plume, see {@link ImprovedExhaust}. */
|
||||
@Mixin(value = JetExhaustOnTickUpdateProcedure.class, remap = false)
|
||||
public abstract class JetExhaustOnTickUpdateProcedureMixin {
|
||||
@Inject(method = "execute", at = @At("HEAD"))
|
||||
private static void improvedAerodynamics$begin(LevelAccessor world, double x, double y, double z, BlockState blockstate, CallbackInfo ci) {
|
||||
ImprovedExhaust.begin();
|
||||
}
|
||||
|
||||
@Redirect(method = "execute", at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/level/ServerLevel;m_7967_(Lnet/minecraft/world/entity/Entity;)Z"))
|
||||
private static boolean improvedAerodynamics$addEffect(ServerLevel level, Entity entity) {
|
||||
return ImprovedExhaust.addEffectEntity(level, entity);
|
||||
}
|
||||
|
||||
@Inject(method = "execute", at = @At("TAIL"))
|
||||
private static void improvedAerodynamics$plume(LevelAccessor world, double x, double y, double z, BlockState blockstate, CallbackInfo ci) {
|
||||
ImprovedExhaust.plume(world, x, y, z, blockstate);
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package dev.lumareth.improvedAerodynamics.flight.mixin.warium;
|
||||
|
||||
import dev.lumareth.improvedAerodynamics.exhaust.ImprovedExhaust;
|
||||
import net.mcreator.valkyrienwarium.procedures.VTOLExhaustTickProcedure;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
/** The improved exhaust style for the VTOL exhaust: no effect entity, the flame of this mod, see {@link ImprovedExhaust}. */
|
||||
@Mixin(value = VTOLExhaustTickProcedure.class, remap = false)
|
||||
public abstract class VTOLExhaustTickProcedureMixin {
|
||||
@Inject(method = "execute", at = @At("HEAD"))
|
||||
private static void improvedAerodynamics$begin(LevelAccessor world, double x, double y, double z, BlockState blockstate, CallbackInfo ci) {
|
||||
ImprovedExhaust.begin();
|
||||
}
|
||||
|
||||
@Redirect(method = "execute", at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/level/ServerLevel;m_7967_(Lnet/minecraft/world/entity/Entity;)Z"))
|
||||
private static boolean improvedAerodynamics$addEffect(ServerLevel level, Entity entity) {
|
||||
return ImprovedExhaust.addEffectEntity(level, entity);
|
||||
}
|
||||
|
||||
@Inject(method = "execute", at = @At("TAIL"))
|
||||
private static void improvedAerodynamics$plume(LevelAccessor world, double x, double y, double z, BlockState blockstate, CallbackInfo ci) {
|
||||
ImprovedExhaust.plume(world, x, y, z, blockstate);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user