From d3f8cb753dc8e1ff2e81ffaf1aab025f7eb59d82 Mon Sep 17 00:00:00 2001 From: winterflyt <36+winterflyt@noreply.skidsolutions.xyz> Date: Mon, 30 Nov 2026 05:56:33 +0200 Subject: [PATCH] Upload files to "src/openonyx/features/render" --- src/openonyx/features/render/Ambience.java | 80 +++++++++++++++++++ .../features/render/AmbiencePart.java | 17 ++++ .../features/render/AmbiencePart2.java | 14 ++++ src/openonyx/features/render/Animations.java | 33 ++++++++ .../features/render/AnimationsSwingMode.java | 14 ++++ 5 files changed, 158 insertions(+) create mode 100644 src/openonyx/features/render/Ambience.java create mode 100644 src/openonyx/features/render/AmbiencePart.java create mode 100644 src/openonyx/features/render/AmbiencePart2.java create mode 100644 src/openonyx/features/render/Animations.java create mode 100644 src/openonyx/features/render/AnimationsSwingMode.java diff --git a/src/openonyx/features/render/Ambience.java b/src/openonyx/features/render/Ambience.java new file mode 100644 index 0000000..f7d143d --- /dev/null +++ b/src/openonyx/features/render/Ambience.java @@ -0,0 +1,80 @@ +package openonyx.features.render; + +import meteordevelopment.orbit.EventHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import openonyx.configuration.internal.PacketDirection; +import openonyx.configuration.internal.PacketEvent; +import openonyx.configuration.internal.RunTickEvent; +import openonyx.features.Module; +import openonyx.features.ModuleCategory; +import openonyx.history.internal.BooleanSetting; +import openonyx.history.internal.NumberSetting; + +public final class Ambience extends Module { + public BooleanSetting timeLock = new BooleanSetting("Time lock", false).describe("Locks the client-side time of day without changing server time"); + public AmbiencePart2 ambiencePart2; + public AmbiencePart ambiencePart; + private volatile S03PacketTimeUpdate s03PacketTimeUpdate; + public NumberSetting time = new NumberSetting("Time", 6000.0, 0.0, 24000.0, 100.0) + .withSuffix(" ticks") + .describe("World time to display (0 = sunrise, 6000 = noon, 18000 = midnight)") + .visibleWhen(this.timeLock); + + @EventHandler + private void onRunTick(RunTickEvent runTickEvent) { + if (mc.theWorld != null) { + if (this.timeLock.isEnabled()) { + mc.theWorld.setWorldTime(this.time.getInt()); + } else { + this.h(); + } + } + } + + public Ambience() { + super("Ambience", "Cinematic world lighting and color grading", ModuleCategory.RENDER); + this.ambiencePart2 = new AmbiencePart2(this); + this.ambiencePart = new AmbiencePart(this); + } + + @Override + protected void onDisable() { + this.h(); + } + + private void h() { + Ambience ambience1 = this; + S03PacketTimeUpdate s03PacketTimeUpdatex = ambience1.s03PacketTimeUpdate; + ambience1.s03PacketTimeUpdate = null; + if (s03PacketTimeUpdatex != null && mc.theWorld != null) { + mc.theWorld.setTotalWorldTime(s03PacketTimeUpdatex.getTotalWorldTime()); + mc.theWorld.setWorldTime(s03PacketTimeUpdatex.getWorldTime()); + } + } + + public boolean I() { + return this.isEnabled() && (this.ambiencePart2.isEnabled() || this.ambiencePart.isEnabled()); + } + + @EventHandler + private void onPacket(PacketEvent packetEvent) { + if (packetEvent.getPacketDirection() == PacketDirection.INCOMING) { + if (!packetEvent.isCancelled()) { + if (this.timeLock.isEnabled()) { + Packet packet; + if ((packet = packetEvent.getPacket()) instanceof S03PacketTimeUpdate) { + S03PacketTimeUpdate s03PacketTimeUpdatex = (S03PacketTimeUpdate)packet; + this.s03PacketTimeUpdate = s03PacketTimeUpdatex; + packetEvent.cancel(); + } + } + } + } + } + + @Override + protected void onEnable() { + this.s03PacketTimeUpdate = null; + } +} diff --git a/src/openonyx/features/render/AmbiencePart.java b/src/openonyx/features/render/AmbiencePart.java new file mode 100644 index 0000000..136635d --- /dev/null +++ b/src/openonyx/features/render/AmbiencePart.java @@ -0,0 +1,17 @@ +package openonyx.features.render; + +import openonyx.history.SettingGroup; +import openonyx.history.internal.NumberSetting; + +public final class AmbiencePart extends SettingGroup { + public NumberSetting vignette; + public NumberSetting saturation = new NumberSetting("Saturation", 100.0, 0.0, 180.0, 5.0).withSuffix("%"); + public NumberSetting filmGrain; + public NumberSetting contrast = new NumberSetting("Contrast", 100.0, 60.0, 160.0, 5.0).withSuffix("%"); + + private AmbiencePart(Ambience ambience) { + super("Color Grading", false); + this.vignette = new NumberSetting("Vignette", 10.0, 0.0, 80.0, 5.0).withSuffix("%"); + this.filmGrain = new NumberSetting("Film Grain", 0.0, 0.0, 30.0, 1.0).withSuffix("%"); + } +} diff --git a/src/openonyx/features/render/AmbiencePart2.java b/src/openonyx/features/render/AmbiencePart2.java new file mode 100644 index 0000000..9dff1a1 --- /dev/null +++ b/src/openonyx/features/render/AmbiencePart2.java @@ -0,0 +1,14 @@ +package openonyx.features.render; + +import openonyx.history.SettingGroup; +import openonyx.history.internal.ColorSetting; +import openonyx.history.internal.NumberSetting; + +public final class AmbiencePart2 extends SettingGroup { + public ColorSetting color = new ColorSetting("Color", -6718).D(); + public NumberSetting strength = new NumberSetting("Strength", 18.0, 0.0, 100.0, 1.0).withSuffix("%"); + + private AmbiencePart2(Ambience ambience) { + super("Light Color", false); + } +} diff --git a/src/openonyx/features/render/Animations.java b/src/openonyx/features/render/Animations.java new file mode 100644 index 0000000..59e6456 --- /dev/null +++ b/src/openonyx/features/render/Animations.java @@ -0,0 +1,33 @@ +package openonyx.features.render; + +import openonyx.core.OnyxClient; +import openonyx.features.Module; +import openonyx.features.ModuleCategory; +import openonyx.features.ModuleManager; +import openonyx.history.internal.EnumSetting; + +public class Animations extends Module { + public EnumSetting block = new EnumSetting<>("Block", BlockMode.SMOOTH) + .describe("Raises the sword higher and lets it sweep along with the swing"); + public EnumSetting swing = new EnumSetting<>("Swing", AnimationsSwingMode.SMOOTH) + .describe("Drives the item bob off the equip progress instead of the swing progress"); + + public Animations() { + super("Animations", "Changes the swinging and blocking item animations", ModuleCategory.RENDER); + } + + public static boolean h() { + Animations animations; + return (animations = L()) != null && animations.isEnabled() && animations.block.is(BlockMode.SMOOTH); + } + + public static boolean I() { + Animations animations; + return (animations = L()) != null && animations.isEnabled() && animations.swing.is(AnimationsSwingMode.SMOOTH); + } + + private static Animations L() { + ModuleManager moduleManager = OnyxClient.moduleManager; + return OnyxClient.moduleManager == null ? null : moduleManager.animations; + } +} diff --git a/src/openonyx/features/render/AnimationsSwingMode.java b/src/openonyx/features/render/AnimationsSwingMode.java new file mode 100644 index 0000000..ae46150 --- /dev/null +++ b/src/openonyx/features/render/AnimationsSwingMode.java @@ -0,0 +1,14 @@ +package openonyx.features.render; + +public enum AnimationsSwingMode { + SMOOTH, + VANILLA; + + private static AnimationsSwingMode[] L() { + AnimationsSwingMode[] animationsSwingModes = new AnimationsSwingMode[2]; + boolean bl = true; + animationsSwingModes[0] = VANILLA; + animationsSwingModes[1] = SMOOTH; + return animationsSwingModes; + } +}