Upload files to "src/openonyx/features/render"

This commit is contained in:
winterflyt committed 2026-11-30 05:56:33 +02:00
1 parent f9f78fbcb1
commit d3f8cb753d
5 files changed
+158

No files matched your search

@@ -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;
}
}
@@ -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("%");
}
}
@@ -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);
}
}
@@ -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<BlockMode> block = new EnumSetting<>("Block", BlockMode.SMOOTH)
.describe("Raises the sword higher and lets it sweep along with the swing");
public EnumSetting<AnimationsSwingMode> 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;
}
}
@@ -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;
}
}