Upload files to "src/openonyx/features/player/internal"
This commit is contained in:
1 parent
71f9ed0dcf
commit
9ed08f30af
2 files changed
+65
No files matched your search
@@ -0,0 +1,35 @@
|
|||||||
|
package openonyx.features.player.internal;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import openonyx.history.Setting;
|
||||||
|
import openonyx.history.internal.BooleanSetting;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
import openonyx.protocol.RotationConfig;
|
||||||
|
import openonyx.protocol.RotationRequest;
|
||||||
|
|
||||||
|
public class ScaffoldRotationSettings extends RotationConfig {
|
||||||
|
public BooleanSetting considerInventory = new BooleanSetting("Consider inventory", false).visibleWhen(Setting.BOOLEAN_SUPPLIER);
|
||||||
|
private final transient FeatureSupport_419 featureSupport_419;
|
||||||
|
public NumberSetting rotationVariance = new NumberSetting("Rotation variance", 0.3, 0.0, 3.0, 0.05)
|
||||||
|
.withSuffix("°")
|
||||||
|
.describe("Wobbles the sent yaw by a mouse step or two each tick so no two placements go out with the same yaw (Grim DuplicateRotPlace). 0 turns it off.");
|
||||||
|
|
||||||
|
public RotationRequest L(RotationRequest rotationRequest) {
|
||||||
|
return this.rotationVariance.getValue() <= 0.0
|
||||||
|
? rotationRequest
|
||||||
|
: new RotationRequest(
|
||||||
|
rotationRequest.getAngles(),
|
||||||
|
rotationRequest.getEntity(),
|
||||||
|
List.of(new ScaffoldRotationSettingsPart(this, rotationRequest.getRotationSmoothers())),
|
||||||
|
rotationRequest.L(),
|
||||||
|
rotationRequest.L(),
|
||||||
|
rotationRequest.L(),
|
||||||
|
rotationRequest.getMovementFixMode(),
|
||||||
|
rotationRequest.getConditionalAction()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScaffoldRotationSettings() {
|
||||||
|
this.featureSupport_419 = new FeatureSupport_419();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package openonyx.features.player.internal;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import openonyx.protocol.RotationRequest;
|
||||||
|
import openonyx.protocol.group_m.Angles;
|
||||||
|
import openonyx.protocol.internal.internal.RotationSmoother;
|
||||||
|
|
||||||
|
final class ScaffoldRotationSettingsPart implements RotationSmoother {
|
||||||
|
private final List<RotationSmoother> rotationSmoothers;
|
||||||
|
|
||||||
|
private ScaffoldRotationSettingsPart(ScaffoldRotationSettings scaffoldRotationSettings, List list) {
|
||||||
|
this.scaffoldRotationSettings = scaffoldRotationSettingsx;
|
||||||
|
this.rotationSmoothers = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Angles L(RotationRequest rotationRequest, Angles angles, Angles angles1) {
|
||||||
|
angles1 = angles1;
|
||||||
|
|
||||||
|
Iterator iterator;
|
||||||
|
for (Iterator iterator1 = iterator = this.rotationSmoothers.iterator(); iterator1.hasNext(); iterator1 = iterator) {
|
||||||
|
angles1 = ((RotationSmoother)iterator.next()).L(rotationRequest, angles, angles1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Angles(
|
||||||
|
this.scaffoldRotationSettings.featureSupport_419.L(angles1.yaw2(), this.scaffoldRotationSettings.rotationVariance.getValue()), angles1.pitch2()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user