Upload files to "src/openonyx/events"

This commit is contained in:
winterflyt committed 2026-11-30 05:47:52 +02:00
1 parent 41d3e86632
commit 8394a2a05a
3 files changed
+140

No files matched your search

+18
View File
@@ -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;
}
}
+60
View File
@@ -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<RotationFixMode> moveFix;
public NumberSetting aimReRoll;
public NumberSetting smoothing;
public NumberSetting acceleration;
public NumberSetting pitchSpeedMax;
public NumberSetting pitchJitter;
public NumberSetting pitchSpeed;
public NumberSetting aimSpread;
public EnumSetting<RotationMode> 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");
}
}
+62
View File
@@ -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;
}
}
}
}