From aca9e5708fa8fae12dfdc6c0dbbe97ad73e1a2a3 Mon Sep 17 00:00:00 2001 From: winterflyt <36+winterflyt@noreply.skidsolutions.xyz> Date: Mon, 30 Nov 2026 05:59:14 +0200 Subject: [PATCH] Upload files to "src/openonyx/features/render" --- src/openonyx/features/render/SpawnAtMode.java | 27 +++++++++ src/openonyx/features/render/StartMode.java | 35 ++++++++++++ src/openonyx/features/render/Style.java | 27 +++++++++ .../features/render/SwingAnimation.java | 53 +++++++++++++++++ src/openonyx/features/render/SwingTimer.java | 57 +++++++++++++++++++ 5 files changed, 199 insertions(+) create mode 100644 src/openonyx/features/render/SpawnAtMode.java create mode 100644 src/openonyx/features/render/StartMode.java create mode 100644 src/openonyx/features/render/Style.java create mode 100644 src/openonyx/features/render/SwingAnimation.java create mode 100644 src/openonyx/features/render/SwingTimer.java diff --git a/src/openonyx/features/render/SpawnAtMode.java b/src/openonyx/features/render/SpawnAtMode.java new file mode 100644 index 0000000..89c6d11 --- /dev/null +++ b/src/openonyx/features/render/SpawnAtMode.java @@ -0,0 +1,27 @@ +package openonyx.features.render; + +import openonyx.history.DisplayNamed; + +public enum SpawnAtMode implements DisplayNamed { + ATTACK("Attack"), + WALKING("Walking"); + + private final String H; + + @Override + public String getDisplayName() { + return this.H; + } + + SpawnAtMode(String string1) { + this.H = string1; + } + + private static SpawnAtMode[] L() { + SpawnAtMode[] spawnAtModes = new SpawnAtMode[2]; + boolean bl = true; + spawnAtModes[0] = ATTACK; + spawnAtModes[1] = WALKING; + return spawnAtModes; + } +} diff --git a/src/openonyx/features/render/StartMode.java b/src/openonyx/features/render/StartMode.java new file mode 100644 index 0000000..486b543 --- /dev/null +++ b/src/openonyx/features/render/StartMode.java @@ -0,0 +1,35 @@ +package openonyx.features.render; + +import openonyx.history.DisplayNamed; + +public enum StartMode implements DisplayNamed { + MIDDLE("Middle", 0.0F), + FEET("Feet", -90.0F), + HEAD("Head", 90.0F); + + private final float H; + private final String e; + + @Override + public String getDisplayName() { + return this.e; + } + + private static StartMode[] L() { + StartMode[] startModes = new StartMode[3]; + boolean bl = true; + startModes[0] = FEET; + startModes[1] = MIDDLE; + startModes[2] = HEAD; + return startModes; + } + + StartMode(String string1, float f) { + this.e = string1; + this.H = f; + } + + public float L() { + return this.H; + } +} diff --git a/src/openonyx/features/render/Style.java b/src/openonyx/features/render/Style.java new file mode 100644 index 0000000..77c0dd4 --- /dev/null +++ b/src/openonyx/features/render/Style.java @@ -0,0 +1,27 @@ +package openonyx.features.render; + +import openonyx.history.DisplayNamed; + +public enum Style implements DisplayNamed { + OUTLINE("Outline"), + FILLED("Outline + fill"); + + private final String e; + + Style(String string1) { + this.e = string1; + } + + private static Style[] L() { + Style[] styles = new Style[2]; + boolean bl = true; + styles[0] = OUTLINE; + styles[1] = FILLED; + return styles; + } + + @Override + public String getDisplayName() { + return this.e; + } +} diff --git a/src/openonyx/features/render/SwingAnimation.java b/src/openonyx/features/render/SwingAnimation.java new file mode 100644 index 0000000..c95164d --- /dev/null +++ b/src/openonyx/features/render/SwingAnimation.java @@ -0,0 +1,53 @@ +package openonyx.features.render; + +import openonyx.history.SettingSection; +import openonyx.history.internal.BooleanSetting; +import openonyx.history.internal.EnumSetting; +import openonyx.history.internal.NumberSetting; + +public final class SwingAnimation extends SettingSection { + public final BooleanSetting swordsOnly = new BooleanSetting("Swords only", false); + public final NumberSetting positionX; + public final EnumSetting curve; + public final NumberSetting rotationZ; + public final NumberSetting positionZ; + public final NumberSetting scaleZ; + public final NumberSetting scaleY; + public final NumberSetting strength; + public final NumberSetting positionY; + public final NumberSetting rotationX; + public final BooleanSetting matchVanilla; + public final NumberSetting rotationY; + public final NumberSetting scaleX; + public final NumberSetting speed; + public final BooleanSetting replaceVanillaSwing = new BooleanSetting("Replace vanilla swing", true); + + private NumberSetting d(String string) { + return new NumberSetting(string, 1.0, 0.1, 3.0, 0.01); + } + + private NumberSetting L(String string, double d) { + return new NumberSetting(string, d, -720.0, 720.0, 1.0).withSuffix("deg"); + } + + private SwingAnimation() { + super("Animation", true); + this.matchVanilla = new BooleanSetting("Match vanilla", false).describe("Uses vanilla's own swing motion instead of the curve below"); + this.strength = new NumberSetting("Strength", 100.0, 0.0, 200.0, 5.0).withSuffix("%"); + this.curve = new EnumSetting<>("Curve", CurveMode.SMOOTH); + this.speed = new NumberSetting("Speed", 1.0, 0.1, 5.0, 0.05).withSuffix("x"); + this.positionX = this.describe("Animation X"); + this.positionY = this.describe("Animation Y"); + this.positionZ = this.describe("Animation Z"); + this.rotationX = this.L("Animation rotation X", -51.0); + this.rotationY = this.L("Animation rotation Y", 0.0); + this.rotationZ = this.L("Animation rotation Z", 0.0); + this.scaleX = this.d("Animation scale X"); + this.scaleY = this.d("Animation scale Y"); + this.scaleZ = this.d("Animation scale Z"); + } + + private NumberSetting describe(String string) { + return new NumberSetting(string, 0.0, -2.0, 2.0, 0.01); + } +} diff --git a/src/openonyx/features/render/SwingTimer.java b/src/openonyx/features/render/SwingTimer.java new file mode 100644 index 0000000..4854f3d --- /dev/null +++ b/src/openonyx/features/render/SwingTimer.java @@ -0,0 +1,57 @@ +package openonyx.features.render; + +final class SwingTimer { + private float d; + private long i; + private long f = -1L; + private static final float H = 1.0E-4F; + private long e; + + private void d() { + this.f = -1L; + this.i = 300000000L; + this.d = 0.0F; + this.e = -1L; + } + + private SwingTimer() { + this.i = 300000000L; + this.e = -1L; + } + + private float L(float f, long l) { + long m = System.nanoTime(); + boolean bl = fx > 1.0E-4F && (this.d <= 1.0E-4F || fx + 1.0E-4F < this.d); + this.d = fx; + if (bl) { + this.f = m; + this.i = l; + } + + if (this.f < 0L) { + return 0.0F; + } else if ((fx = (float)(m - this.f) / (float)this.i) >= 1.0F) { + this.f = -1L; + return 0.0F; + } else { + return Math.clamp(fx, 0.0F, 1.0F); + } + } + + private static long L(long l, float f) { + return Math.max(1L, (long)((float)l / Math.max(fx, 0.01F))); + } + + private float L(long l) { + long m = System.nanoTime(); + if (this.e < 0L) { + this.e = m; + } + + return (float)((m - this.e) % l) / (float)l; + } + + private void L() { + this.e = -1L; + } +}