Upload files to "src/openonyx/features/player/internal/internal"

This commit is contained in:
winterflyt committed 2026-11-30 05:55:45 +02:00
1 parent 7b5104a062
commit f0dbd4615f
5 files changed
+96

No files matched your search

@@ -0,0 +1,5 @@
package openonyx.features.player.internal.internal;
public record BridgeAction(boolean jump, int sneakTime, boolean stopInput, boolean stepBack) {
public static final BridgeAction INSTANCE = new BridgeAction(false, 0, false, false);
}
@@ -0,0 +1,28 @@
package openonyx.features.player.internal.internal;
import openonyx.core.MinecraftAccess;
import openonyx.features.player.Scaffold;
import openonyx.interaction.internal.PlacementResult;
import openonyx.protocol.group_m.Angles;
import openonyx.utilities.PlayerUtils;
public class BridgeActionResolver implements MinecraftAccess {
public static BridgeAction L(PlacementResult placementResult, Angles angles, BridgeTechnique bridgeTechnique) {
PlacementResult placementResult1 = placementResult;
if (PlayerUtils.d(mc.thePlayer)) {
int i = ScaffoldClutch.INSTANCE.isEnabled() ? ScaffoldClutch.INSTANCE.L(angles) : Scaffold.INSTANCE.scaffoldRotationSettings.L(angles);
boolean bl = Scaffold.INSTANCE.L() <= 0;
boolean bl1 = i >= 1;
if (bl || bl1) {
return new BridgeAction(false, Math.max(1, i), false, false);
}
}
if (bridgeTechnique == null) {
return BridgeAction.INSTANCE;
}
BridgeAction bridgeAction;
return (bridgeAction = bridgeTechnique.L(placementResult1, angles)) != null ? bridgeAction : BridgeAction.INSTANCE;
}
}
@@ -0,0 +1,9 @@
package openonyx.features.player.internal.internal;
import openonyx.interaction.internal.PlacementResult;
import openonyx.protocol.group_m.Angles;
@FunctionalInterface
public interface BridgeTechnique {
BridgeAction L(PlacementResult placementResult, Angles angles);
}
@@ -0,0 +1,33 @@
package openonyx.features.player.internal.internal;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.Entity;
import openonyx.configuration.internal.PreTickEvent;
import openonyx.core.MinecraftAccess;
import openonyx.history.Setting;
import openonyx.history.SettingSection;
import openonyx.history.internal.BooleanSetting;
import openonyx.history.internal.NumberSetting;
import openonyx.utilities.PlayerUtils;
import openonyx.utilities.VecUtils;
public class ScaffoldAcceleration extends SettingSection implements MinecraftAccess {
public NumberSetting speedMultiplier = new NumberSetting("Speed multiplier", 0.6, 0.1, 3.0, 0.01);
public BooleanSetting onlyOnGround = new BooleanSetting("Only on ground", false);
public static final ScaffoldAcceleration INSTANCE = new ScaffoldAcceleration();
@EventHandler
private void onPreTick(PreTickEvent preTickEvent) {
if (mc.thePlayer != null) {
if (!this.onlyOnGround.getValue() || mc.thePlayer.onGround) {
double d = this.speedMultiplier.getFloat();
PlayerUtils.L(mc.thePlayer, VecUtils.d(PlayerUtils.L((Entity)mc.thePlayer), d, 1.0, d));
}
}
}
private ScaffoldAcceleration() {
super("Acceleration", false);
this.visibleWhen(Setting.BOOLEAN_SUPPLIER);
}
}
@@ -0,0 +1,21 @@
package openonyx.features.player.internal.internal;
import openonyx.history.SettingSection;
import openonyx.history.internal.BooleanSetting;
import openonyx.history.internal.NumberSetting;
public class ScaffoldAutoBlock extends SettingSection {
public static final ScaffoldAutoBlock INSTANCE = new ScaffoldAutoBlock();
public NumberSetting doNotUseBelowCount;
public BooleanSetting alwaysHoldBlock = new BooleanSetting("Always hold block", false)
.describe("Keeps the block slot held server-side the whole time instead of swapping to it only on the tick a block goes out");
public NumberSetting slotResetDelay = new NumberSetting("Slot reset delay", 5.0, 0.0, 40.0, 1.0)
.withSuffix(" ticks")
.describe("How long the silent slot is held after a placement before the real slot comes back");
private ScaffoldAutoBlock() {
super("Auto block", true);
this.doNotUseBelowCount = new NumberSetting("Do not use below count", 1.0, 0.0, 64.0, 1.0)
.describe("Leaves a stack alone once it is down to this many blocks");
}
}