From 8394a2a05afdd642ae0be85e9b7600f3ebf9bb3e Mon Sep 17 00:00:00 2001 From: winterflyt <36+winterflyt@noreply.skidsolutions.xyz> Date: Mon, 30 Nov 2026 05:47:52 +0200 Subject: [PATCH] Upload files to "src/openonyx/events" --- src/openonyx/events/RotationMode.java | 18 +++++++ src/openonyx/events/RotationSettings.java | 60 ++++++++++++++++++++++ src/openonyx/events/TargetType.java | 62 +++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 src/openonyx/events/RotationMode.java create mode 100644 src/openonyx/events/RotationSettings.java create mode 100644 src/openonyx/events/TargetType.java diff --git a/src/openonyx/events/RotationMode.java b/src/openonyx/events/RotationMode.java new file mode 100644 index 0000000..ced443d --- /dev/null +++ b/src/openonyx/events/RotationMode.java @@ -0,0 +1,18 @@ +package openonyx.events; + +public enum RotationMode { + SMOOTH, + LINEAR, + INSTANT, + ACCELERATE; + + private static RotationMode[] L() { + RotationMode[] rotationModes = new RotationMode[4]; + boolean bl = true; + rotationModes[0] = INSTANT; + rotationModes[1] = LINEAR; + rotationModes[2] = SMOOTH; + rotationModes[3] = ACCELERATE; + return rotationModes; + } +} diff --git a/src/openonyx/events/RotationSettings.java b/src/openonyx/events/RotationSettings.java new file mode 100644 index 0000000..3419398 --- /dev/null +++ b/src/openonyx/events/RotationSettings.java @@ -0,0 +1,60 @@ +package openonyx.events; + +import openonyx.history.SettingGroup; +import openonyx.history.internal.BooleanSetting; +import openonyx.history.internal.EnumSetting; +import openonyx.history.internal.NumberSetting; + +public class RotationSettings extends SettingGroup { + public NumberSetting yawSpeedMax; + public EnumSetting moveFix; + public NumberSetting aimReRoll; + public NumberSetting smoothing; + public NumberSetting acceleration; + public NumberSetting pitchSpeedMax; + public NumberSetting pitchJitter; + public NumberSetting pitchSpeed; + public NumberSetting aimSpread; + public EnumSetting rotation = new EnumSetting<>("Rotation", RotationMode.SMOOTH).describe("How the aim moves toward the target"); + public BooleanSetting sensitivityFix; + public NumberSetting yawSpeed = new NumberSetting("Yaw speed", 45.0, 1.0, 180.0, 1.0) + .withSuffix("°/t") + .visibleWhen(() -> !this.rotation.is(RotationMode.INSTANT)); + public NumberSetting yawJitter; + public BooleanSetting speedVariance; + public NumberSetting startSpeed; + + public RotationSettings() { + super("Rotations"); + this.pitchSpeed = new NumberSetting("Pitch speed", 30.0, 1.0, 180.0, 1.0).withSuffix("°/t").visibleWhen(() -> !this.rotation.is(RotationMode.INSTANT)); + this.smoothing = new NumberSetting("Smoothing", 70.0, 0.0, 95.0, 5.0) + .withSuffix("%") + .describe("Share of the remaining angle kept each tick") + .visibleWhen(() -> this.rotation.is(RotationMode.SMOOTH)); + this.acceleration = new NumberSetting("Acceleration", 15.0, 1.0, 90.0, 1.0) + .withSuffix("°/t²") + .visibleWhen(() -> this.rotation.is(RotationMode.ACCELERATE)); + this.startSpeed = new NumberSetting("Start speed", 25.0, 5.0, 100.0, 5.0) + .withSuffix("%") + .describe("Speed the ramp begins at") + .visibleWhen(() -> this.rotation.is(RotationMode.ACCELERATE)); + this.speedVariance = new BooleanSetting("Speed variance", true) + .describe("Rolls a fresh turn speed for every flick") + .visibleWhen(() -> !this.rotation.is(RotationMode.INSTANT)); + this.yawSpeedMax = new NumberSetting("Yaw speed max", 75.0, 1.0, 180.0, 1.0) + .withSuffix("°/t") + .visibleWhen(() -> !this.rotation.is(RotationMode.INSTANT) && this.speedVariance.isEnabled()); + this.pitchSpeedMax = new NumberSetting("Pitch speed max", 50.0, 1.0, 180.0, 1.0) + .withSuffix("°/t") + .visibleWhen(() -> !this.rotation.is(RotationMode.INSTANT) && this.speedVariance.isEnabled()); + this.yawJitter = new NumberSetting("Yaw jitter", 0.0, 0.0, 5.0, 0.1).withSuffix("°"); + this.pitchJitter = new NumberSetting("Pitch jitter", 0.0, 0.0, 5.0, 0.1).withSuffix("°"); + this.aimSpread = new NumberSetting("Aim spread", 25.0, 0.0, 100.0, 5.0).withSuffix("%").describe("How far from the closest point the aim may wander"); + this.aimReRoll = new NumberSetting("Aim re-roll", 0.0, 0.0, 60.0, 5.0) + .withSuffix("t") + .describe("0 keeps one point per target") + .visibleWhen(() -> this.aimSpread.getValue() > 0.0); + this.sensitivityFix = new BooleanSetting("Sensitivity fix", true).describe("Snaps each delta to the mouse grid"); + this.moveFix = new EnumSetting<>("Move fix", RotationFixMode.SILENT).describe("Keeps movement consistent with the rotation the server sees"); + } +} diff --git a/src/openonyx/events/TargetType.java b/src/openonyx/events/TargetType.java new file mode 100644 index 0000000..43770d3 --- /dev/null +++ b/src/openonyx/events/TargetType.java @@ -0,0 +1,62 @@ +package openonyx.events; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.player.EntityPlayer; +import openonyx.core.MinecraftAccess; +import openonyx.features.combat.AntiBot; + +public enum TargetType { + ENEMY, + TEAM, + MOBS, + SELF; + + public static final String[] e; + + private static TargetType[] L() { + TargetType[] targetTypes = new TargetType[4]; + boolean bl = true; + targetTypes[0] = SELF; + targetTypes[1] = ENEMY; + targetTypes[2] = TEAM; + targetTypes[3] = MOBS; + return targetTypes; + } + + static { + String[] strings = new String[4]; + boolean bl = true; + strings[0] = "Self"; + strings[1] = "Enemy"; + strings[2] = "Team"; + strings[3] = "Mobs"; + e = strings; + } + + public static TargetType L(EntityLivingBase entityLivingBase) { + EntityLivingBase entityLivingBase1 = entityLivingBase; + Minecraft minecraft = MinecraftAccess.mc; + if (MinecraftAccess.mc.thePlayer == null || minecraft.theWorld == null) { + return null; + } else if (!entityLivingBase1.isEntityAlive()) { + return null; + } else if (entityLivingBase1 instanceof EntityArmorStand) { + return null; + } else { + EntityPlayer entityPlayer; + if (entityLivingBase1 instanceof EntityPlayer && (entityPlayer = (EntityPlayer)entityLivingBase1).isSpectator()) { + return null; + } else if (AntiBot.L(entityLivingBase1)) { + return null; + } else if (entityLivingBase1 == minecraft.thePlayer) { + return minecraft.gameSettings.thirdPersonView == 0 ? null : SELF; + } else if (entityLivingBase1 instanceof EntityPlayer entityPlayer1) { + return EntityRelationUtils.L(minecraft.thePlayer, entityPlayer1) ? TEAM : ENEMY; + } else { + return MOBS; + } + } + } +}