Files
OpenOnyx/src/openonyx/protocol/RotationConfig.java
T

77 lines
3.1 KiB
Java

package openonyx.protocol;
import java.util.List;
import net.minecraft.entity.Entity;
import openonyx.history.ModeSetting;
import openonyx.history.SettingGroup;
import openonyx.history.internal.EnumSetting;
import openonyx.history.internal.NumberSetting;
import openonyx.protocol.group_m.Angles;
import openonyx.protocol.internal.MovementFixMode;
import openonyx.protocol.internal.internal.internal.SmoothingMode;
import openonyx.protocol.internal.internal.internal.internal.AccelerationSmoothing;
import openonyx.protocol.internal.internal.internal.internal.LinearSmoothing;
import openonyx.protocol.internal.internal.internal.internal.SigmoidSmoothing;
import openonyx.utilities.ConditionalAction;
public class RotationConfig extends SettingGroup {
private final ModeSetting<SmoothingMode> modeSetting;
private final EnumSetting<MovementFixMode> movementCorrection;
private final NumberSetting resetThreshold;
private final NumberSetting ticksUntilReset;
public RotationConfig(MovementFixMode movementFixMode) {
RotationConfig rotationConfig1 = this;
rotationConfig1./* $VF: Unable to resugar constructor */<init>("Rotations");
LinearSmoothing linearSmoothing = new LinearSmoothing();
SmoothingMode[] smoothingModes = new SmoothingMode[3];
boolean bl = true;
smoothingModes[0] = linearSmoothing;
smoothingModes[1] = new AccelerationSmoothing();
smoothingModes[2] = new SigmoidSmoothing();
rotationConfig1.modeSetting = new ModeSetting<>("Angle smooth", linearSmoothing, smoothingModes);
rotationConfig1.movementCorrection = new EnumSetting<>("Movement correction", movementFixMode);
rotationConfig1.resetThreshold = new NumberSetting("Reset threshold", 2.0, 1.0, 180.0, 1.0)
.withSuffix("°")
.describe("How close the aim has to get to your real look while easing back before control snaps to you");
rotationConfig1.ticksUntilReset = new NumberSetting("Ticks until reset", 5.0, 1.0, 30.0, 1.0)
.withSuffix(" ticks")
.describe("How long the last aim is held after the module stops updating it, before it eases back");
}
public RotationRequest L(Angles angles, Entity entity, boolean bl, ConditionalAction conditionalAction) {
RotationConfig rotationConfig1 = this;
List list = List.of(rotationConfig1.modeSetting.getValue());
return new RotationRequest(
angles,
entity,
list,
(int)Math.round(rotationConfig1.ticksUntilReset.getValue()),
rotationConfig1.resetThreshold.getValue().floatValue(),
bl,
rotationConfig1.movementCorrection.getValue(),
conditionalAction
);
}
public RotationConfig() {
this(MovementFixMode.SILENT);
}
public int L(Angles angles) {
return this.modeSetting.getValue().L(RotationHandler.INSTANCE.getAngles(), angles);
}
public RotationRequest L(Angles angles) {
return this.L(angles, null, false, null);
}
public MovementFixMode L() {
return this.movementCorrection.getValue();
}
public RotationRequest L(Angles angles, boolean bl) {
return this.L(angles, null, bl, null);
}
}