Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
500139c
first test for crystal aura
emyfops Nov 10, 2024
ca69b2c
Merge branch 'master' into feature/combat
emyfops Jan 5, 2025
ca63e6d
crystal aura
emyfops Jan 5, 2025
f4cee65
better checks and visualization
emyfops Jan 6, 2025
0b6eff3
Update CrystalAura.kt
emyfops Jan 8, 2025
50fec70
Merge branch 'master' into feature/combat
emyfops Jan 9, 2025
2781a5e
Merge branch 'master' into feature/combat
emyfops Jan 9, 2025
743911b
Merge branch 'master' into feature/combat
Avanatiker Jan 9, 2025
63f358f
removed caura delay check
emyfops Jan 9, 2025
e93d412
inlined killaura target
emyfops Jan 9, 2025
f7f8794
feat: tps clock
emyfops Jan 9, 2025
ac67df8
Merge branch 'feature/combat' of https://github.com/Avanatiker/NeoLam…
emyfops Jan 9, 2025
7631fa4
Rework ServerTPS
Avanatiker Jan 9, 2025
9329c6f
Fix esp builder bounding box not shifted by position
Avanatiker Jan 9, 2025
b03a3d9
Add RotationMode.NONE
Avanatiker Jan 9, 2025
4341b84
ESP builder rename
Avanatiker Jan 9, 2025
d262d00
Dynamic targeting range
Avanatiker Jan 9, 2025
2ed4623
Use disconnect to clean up server tps
Avanatiker Jan 9, 2025
89ac694
Crystal Aura rewrite
Avanatiker Jan 9, 2025
5310b56
Troll PvPers
Avanatiker Jan 9, 2025
bcb6546
Get state a bit later
Avanatiker Jan 9, 2025
b13b9ea
Merge branch 'master' into feature/combat
Avanatiker Jan 9, 2025
6791554
Merge branch 'master' into feature/combat
Avanatiker Jan 10, 2025
8be6c5f
Fix rotation validity checks and crystal placement
Avanatiker Jan 10, 2025
31c2ff8
Explosion targeting
Avanatiker Jan 10, 2025
e9d244c
Merge branch 'master' into feature/combat
Avanatiker Jan 10, 2025
178f35a
Fix missing merge stuff
Avanatiker Jan 10, 2025
9dd364a
coordinate hud module
emyfops Jan 10, 2025
4e391c0
ref: fakeplayer nil id
emyfops Jan 10, 2025
45ca49f
ref: coordinate hud
emyfops Jan 11, 2025
da168c0
Fix LimitedDecayQueue MutableIterator
Avanatiker Jan 12, 2025
1bba52a
CrystalAura exploding
Avanatiker Jan 12, 2025
5d7a706
fix: fake player targeting
emyfops Jan 12, 2025
ac6054b
ref: use mc's reach
emyfops Jan 12, 2025
4d7df22
ref: raycast arguments
emyfops Jan 12, 2025
bd40575
disable fake player on shutdown
emyfops Jan 12, 2025
f218933
clear caura on disable
emyfops Jan 12, 2025
3af2f41
fix: kill aura reach
emyfops Jan 12, 2025
156d16c
Disable FakePlayer on disconnect
Avanatiker Jan 13, 2025
64218f1
Timer (for delays and periodic actions)
blade1234567 Jan 15, 2025
3fd3626
FakePlayer crash fix
blade1234567 Jan 16, 2025
ae4e40f
async crystal aura
blade1234567 Jan 17, 2025
f38db93
Merge branch 'master' into feature/combat
emyfops Jan 17, 2025
d5c51e4
idk what happened
emyfops Jan 17, 2025
a9ab201
Lightfast CrystalAura
blade1234567 Jan 19, 2025
fd89186
OP Predictions
blade1234567 Jan 19, 2025
d72809c
Rotation & refactor
blade1234567 Jan 19, 2025
cb85548
Timer refactor
blade1234567 Jan 20, 2025
1c710ae
Fixed & improved predictions
blade1234567 Jan 20, 2025
bc19659
Cleaned up & improved predictions
blade1234567 Jan 20, 2025
0fbd682
Accurate Timer with duration type
Avanatiker Jan 21, 2025
478dd20
Request system, Rotation request rework, HotbarManager
blade1234567 Feb 2, 2025
6c9993a
Remove deprecated rotation fix and fix wrong hit check
Avanatiker Feb 4, 2025
e38cdb3
Use proper update event
Avanatiker Feb 4, 2025
b7c9113
Make requests data classes so we can debug them better
Avanatiker Feb 4, 2025
82396e2
Merge branch 'master' into feature/combat
Avanatiker Feb 5, 2025
ebe0bd4
Configuration delegation
Avanatiker Feb 6, 2025
d22b73d
Fix default values and visibility
Avanatiker Feb 6, 2025
3876523
UpdatableLazy Kdocs
Avanatiker Feb 6, 2025
e60615f
Some fixes
Avanatiker Feb 6, 2025
fca9ae2
Decision making on tick post
Avanatiker Feb 6, 2025
f70179f
Add build config to simulator
Avanatiker Feb 6, 2025
42c1c0e
Task duration
Avanatiker Feb 6, 2025
d95eda5
Fix player collision check for simulation
Avanatiker Feb 6, 2025
30cc651
Surface scan margin
Avanatiker Feb 6, 2025
4d63c79
Move breaking into build task. Item pickup strategy still missing
Avanatiker Feb 7, 2025
1614f38
Distinct block update event for server updates
Avanatiker Feb 7, 2025
50654c6
Fix stuff
Avanatiker Feb 7, 2025
51db458
Revert to old surface scan function as new one was flawed and it hurts
Avanatiker Feb 7, 2025
48f1144
Propagating Blueprint
Avanatiker Feb 7, 2025
4adfb18
Nullable withdrawal or deposit tasks
Avanatiker Feb 7, 2025
505ba1d
Sort build results by rotation distance
Avanatiker Feb 7, 2025
db4a568
Cleanup
Avanatiker Feb 7, 2025
6bd7d89
Indicate non raycasting rotation. Not yet possible bc of internal cas…
Avanatiker Feb 7, 2025
f181bd4
Baritone movement fix, surface scan for rotation dsl
blade1234567 Feb 7, 2025
a7b7d63
Fix BuildTask context build timing, block inaccurate pathing positions
Avanatiker Feb 7, 2025
75965ba
FakePlayer refactor, ca speed debug
blade1234567 Feb 8, 2025
48fc1d7
Merge remote-tracking branch 'origin/feature/combat' into feature/combat
blade1234567 Feb 8, 2025
1e73519
resettableLazy() -> updatableLazy()
Avanatiker Feb 7, 2025
7ca5a36
Bring back placement blocking by entities result
Avanatiker Feb 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import baritone.Baritone;
import baritone.api.utils.Rotation;
import baritone.utils.player.BaritonePlayerContext;
import com.lambda.interaction.RotationManager;
import com.lambda.interaction.request.rotation.RotationManager;
import com.lambda.util.BaritoneUtils;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import baritone.api.event.events.RotationMoveEvent;
import baritone.api.utils.Rotation;
import baritone.behavior.LookBehavior;
import com.lambda.interaction.RotationManager;
import com.lambda.interaction.request.rotation.RotationManager;
import com.lambda.util.BaritoneUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
package com.lambda.mixin.entity;

import com.lambda.event.EventFlow;
import com.lambda.event.events.InventoryEvent;
import com.lambda.event.events.PlayerEvent;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
Expand All @@ -34,6 +36,7 @@
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

Expand Down Expand Up @@ -83,6 +86,11 @@ public void clickSlotHead(int syncId, int slotId, int button, SlotActionType act
if (EventFlow.post(click).isCanceled()) ci.cancel();
}

@Redirect(method = "syncSelectedSlot", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerInventory;selectedSlot:I"))
public int overrideSelectedSlotSync(PlayerInventory instance) {
return EventFlow.post(new InventoryEvent.HotbarSlot.Update(instance.selectedSlot)).getSlot();
}

@Inject(method = "updateBlockBreakingProgress", at = @At("HEAD"), cancellable = true)
private void updateBlockBreakingProgressPre(BlockPos pos, Direction side, CallbackInfoReturnable<Boolean> cir) {
var event = EventFlow.post(new PlayerEvent.Breaking.Update(pos, side, currentBreakingProgress));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.lambda.event.events.PlayerEvent;
import com.lambda.event.events.TickEvent;
import com.lambda.interaction.PlayerPacketManager;
import com.lambda.interaction.RotationManager;
import com.lambda.interaction.request.rotation.RotationManager;
import net.minecraft.client.input.Input;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.MovementType;
Expand Down Expand Up @@ -97,8 +97,6 @@ void sendBegin(CallbackInfo ci) {
ci.cancel();
PlayerPacketManager.sendPlayerPackets();
autoJumpEnabled = Lambda.getMc().options.getAutoJump().getValue();

RotationManager.update();
}

@Inject(method = "tick", at = @At(value = "HEAD"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.lambda.event.EventFlow;
import com.lambda.event.events.EntityEvent;
import com.lambda.event.events.PlayerEvent;
import com.lambda.interaction.RotationManager;
import com.lambda.interaction.request.rotation.RotationManager;
import com.lambda.util.math.Vec2d;
import net.minecraft.entity.Entity;
import net.minecraft.entity.MovementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.lambda.Lambda;
import com.lambda.event.EventFlow;
import com.lambda.event.events.MovementEvent;
import com.lambda.interaction.RotationManager;
import com.lambda.interaction.request.rotation.RotationManager;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.lambda.event.EventFlow;
import com.lambda.event.events.MovementEvent;
import com.lambda.interaction.RotationManager;
import com.lambda.interaction.request.rotation.RotationManager;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2025 Lambda
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.lambda.mixin.entity;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import static net.minecraft.entity.player.PlayerInventory.isValidHotbarIndex;

@Mixin(PlayerInventory.class)
public class PlayerInventoryMixin {
@Inject(method = "getMainHandStack", at = @At(value = "HEAD"), cancellable = true)
public void handleSpoofedMainHandStack(CallbackInfoReturnable<ItemStack> cir) {
PlayerInventory instance = (PlayerInventory) (Object) this;
MinecraftClient mc = MinecraftClient.getInstance();
ClientPlayerInteractionManager interaction = mc.interactionManager;

if (instance.player != mc.player || interaction == null) return;

int actualSlot = interaction.lastSelectedSlot;

cir.setReturnValue(
isValidHotbarIndex(actualSlot) ? instance.main.get(actualSlot) : ItemStack.EMPTY
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

@Mixin(ClientPlayNetworkHandler.class)
public class ClientPlayNetworkHandlerMixin {
@Inject(method = "onUpdateSelectedSlot", at = @At("TAIL"))
@Inject(method = "onUpdateSelectedSlot", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/NetworkThreadUtils;forceMainThread(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/listener/PacketListener;Lnet/minecraft/util/thread/ThreadExecutor;)V", shift = At.Shift.AFTER), cancellable = true)
private void onUpdateSelectedSlot(UpdateSelectedSlotS2CPacket packet, CallbackInfo ci) {
EventFlow.post(new InventoryEvent.SelectedHotbarSlotUpdate(packet.getSlot()));
if (EventFlow.post(new InventoryEvent.HotbarSlot.Sync(packet.getSlot())).isCanceled()) ci.cancel();
}

@Inject(method = "onScreenHandlerSlotUpdate", at = @At("TAIL"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package com.lambda.mixin.render;

import com.lambda.interaction.RotationManager;
import com.lambda.interaction.request.rotation.RotationManager;
import com.lambda.module.modules.player.Freecam;
import com.lambda.module.modules.render.CameraTweaks;
import net.minecraft.client.render.Camera;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package com.lambda.mixin.render;

import com.lambda.task.TaskFlow;
import com.lambda.task.RootTask;
import com.lambda.util.DebugInfoHud;
import net.minecraft.client.gui.hud.DebugHud;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -36,6 +36,6 @@ private void onGetRightText(CallbackInfoReturnable<List<String>> cir) {

@Inject(method = "getLeftText", at = @At("TAIL"))
private void onGetLeftText(CallbackInfoReturnable<List<String>> cir) {
cir.getReturnValue().addAll(List.of(TaskFlow.INSTANCE.toString().split("\n")));
cir.getReturnValue().addAll(List.of(RootTask.INSTANCE.toString().split("\n")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package com.lambda.mixin.render;

import com.lambda.Lambda;
import com.lambda.interaction.RotationManager;
import com.lambda.interaction.request.rotation.RotationManager;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.LivingEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@

import com.lambda.event.EventFlow;
import com.lambda.event.events.EntityEvent;
import com.lambda.event.events.WorldEvent;
import com.lambda.module.modules.render.WorldColors;
import com.lambda.util.math.ColorKt;
import net.minecraft.block.BlockState;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -33,10 +36,17 @@
@Mixin(ClientWorld.class)
public class ClientWorldMixin {
@Inject(method = "addEntity", at = @At("HEAD"), cancellable = true)
private void addEntity(Entity entity, CallbackInfo ci) {
private void onAddEntity(Entity entity, CallbackInfo ci) {
if (EventFlow.post(new EntityEvent.EntitySpawn(entity)).isCanceled()) ci.cancel();
}

@Inject(method = "removeEntity", at = @At("HEAD"))
private void onRemoveEntity(int entityId, Entity.RemovalReason removalReason, CallbackInfo ci) {
Entity entity = ((ClientWorld) (Object) this).getEntityById(entityId);
if (entity == null) return;
EventFlow.post(new EntityEvent.EntityRemoval(entity, removalReason));
}

@Inject(method = "getCloudsColor", at = @At("HEAD"), cancellable = true)
private void getCloudsColorInject(float tickDelta, CallbackInfoReturnable<Vec3d> cir) {
if (WorldColors.INSTANCE.isEnabled() && WorldColors.getCustomClouds()) {
Expand All @@ -50,4 +60,9 @@ private void getSkyColorInject(Vec3d cameraPos, float tickDelta, CallbackInfoRet
cir.setReturnValue(ColorKt.getVec3d(WorldColors.getSkyColor()));
}
}

@Inject(method = "handleBlockUpdate", at = @At("HEAD"), cancellable = true)
private void handleBlockUpdateInject(BlockPos pos, BlockState newState, int flags, CallbackInfo ci) {
if (EventFlow.post(new WorldEvent.BlockUpdate.Server(pos, newState)).isCanceled()) ci.cancel();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
public abstract class WorldMixin {
@Inject(method = "onBlockChanged", at = @At("TAIL"))
void onBlockChanged(BlockPos pos, BlockState oldBlock, BlockState newBlock, CallbackInfo ci) {
EventFlow.post(new WorldEvent.BlockChange(pos, oldBlock, newBlock));
EventFlow.post(new WorldEvent.BlockUpdate.Client(pos, oldBlock, newBlock));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.lambda.command.LambdaCommand
import com.lambda.interaction.construction.StructureRegistry
import com.lambda.interaction.construction.blueprint.Blueprint.Companion.toStructure
import com.lambda.interaction.construction.blueprint.StaticBlueprint.Companion.toBlueprint
import com.lambda.task.TaskFlow.run
import com.lambda.task.RootTask.run
import com.lambda.task.tasks.BuildTask
import com.lambda.task.tasks.BuildTask.Companion.build
import com.lambda.threading.runSafe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.lambda.brigadier.argument.literal
import com.lambda.brigadier.execute
import com.lambda.brigadier.required
import com.lambda.command.LambdaCommand
import com.lambda.task.TaskFlow
import com.lambda.task.RootTask
import com.lambda.util.Communication.info
import com.lambda.util.extension.CommandBuilder

Expand All @@ -34,15 +34,15 @@ object TaskCommand : LambdaCommand(
required(literal("cancel")) {
execute {
this@TaskCommand.info("Cancelling all tasks")
TaskFlow.cancel()
RootTask.cancel()
}
}

required(literal("clear")) {
execute {
this@TaskCommand.info("Clearing all tasks")
TaskFlow.cancel()
TaskFlow.clear()
RootTask.cancel()
RootTask.clear()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.lambda.interaction.material.container.ContainerManager
import com.lambda.interaction.material.container.ContainerManager.containerWithMaterial
import com.lambda.interaction.material.container.ContainerManager.containerWithSpace
import com.lambda.interaction.material.transfer.TransferResult
import com.lambda.task.TaskFlow.run
import com.lambda.task.RootTask.run
import com.lambda.util.Communication.info
import com.lambda.util.extension.CommandBuilder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ interface BuildConfig {
val pathing: Boolean
val stayInRange: Boolean
val collectDrops: Boolean
val maxPendingInteractions: Int
val interactionTimeout: Int

// Breaking
val rotateForBreak: Boolean
val breakConfirmation: Boolean
val maxPendingBreaks: Int
val breaksPerTick: Int
val breakWeakBlocks: Boolean
val forceSilkTouch: Boolean
Expand All @@ -37,7 +38,5 @@ interface BuildConfig {
// Placing
val rotateForPlace: Boolean
val placeConfirmation: Boolean
val placeTimeout: Int
val maxPendingPlacements: Int
val placementsPerTick: Int
}
35 changes: 17 additions & 18 deletions common/src/main/kotlin/com/lambda/config/groups/BuildSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,36 @@
package com.lambda.config.groups

import com.lambda.config.Configurable
import com.lambda.module.modules.client.TaskFlowModule.setting
import com.lambda.util.BlockUtils.allSigns

class BuildSettings(
c: Configurable,
vis: () -> Boolean = { true }
) : BuildConfig {
enum class Page {
GENERAL, BREAK, PLACE
General, Break, Place
}

private val page by c.setting("Build Page", Page.GENERAL, "Current page", vis)
private val page by c.setting("Build Page", Page.General, "Current page", vis)

// General
override val pathing by c.setting("Pathing", true, "Path to blocks") { vis() && page == Page.GENERAL }
override val stayInRange by c.setting("Stay In Range", true, "Stay in range of blocks") { vis() && page == Page.GENERAL && pathing }
override val collectDrops by c.setting("Collect All Drops", false, "Collect all drops when breaking blocks") { vis() && page == Page.GENERAL }
override val pathing by c.setting("Pathing", true, "Path to blocks") { vis() && page == Page.General }
override val stayInRange by c.setting("Stay In Range", true, "Stay in range of blocks") { vis() && page == Page.General && pathing }
override val collectDrops by c.setting("Collect All Drops", false, "Collect all drops when breaking blocks") { vis() && page == Page.General }
override val maxPendingInteractions by c.setting("Max Pending Interactions", 1, 1..10, 1, "Dont wait for this many interactions for the server response") { vis() && page == Page.General }

// Breaking
override val rotateForBreak by c.setting("Rotate For Break", true, "Rotate towards block while breaking") { vis() && page == Page.BREAK }
override val breakConfirmation by c.setting("Break Confirmation", false, "Wait for block break confirmation") { vis() && page == Page.BREAK }
override val maxPendingBreaks by c.setting("Max Pending Breaks", 1, 1..10, 1, "Maximum pending block breaks") { vis() && page == Page.BREAK }
override val breaksPerTick by c.setting("Instant Breaks Per Tick", 5, 1..30, 1, "Maximum instant block breaks per tick") { vis() && page == Page.BREAK }
override val breakWeakBlocks by c.setting("Break Weak Blocks", false, "Break blocks that dont have structural integrity (e.g: grass)") { vis() && page == Page.BREAK }
override val forceSilkTouch by c.setting("Force Silk Touch", false, "Force silk touch when breaking blocks") { vis() && page == Page.BREAK }
override val ignoredBlocks by setting("Ignored Blocks", allSigns, "Blocks that wont be broken") { vis() && page == Page.BREAK }
override val rotateForBreak by c.setting("Rotate For Break", true, "Rotate towards block while breaking") { vis() && page == Page.Break }
override val breakConfirmation by c.setting("Break Confirmation", false, "Wait for block break confirmation") { vis() && page == Page.Break }
override val breaksPerTick by c.setting("Instant Breaks Per Tick", 5, 1..30, 1, "Maximum instant block breaks per tick") { vis() && page == Page.Break }
override val breakWeakBlocks by c.setting("Break Weak Blocks", false, "Break blocks that dont have structural integrity (e.g: grass)") { vis() && page == Page.Break }
override val forceSilkTouch by c.setting("Force Silk Touch", false, "Force silk touch when breaking blocks") { vis() && page == Page.Break }
override val ignoredBlocks by c.setting("Ignored Blocks", allSigns, "Blocks that wont be broken") { vis() && page == Page.Break }

// Placing
override val rotateForPlace by c.setting("Rotate For Place", true, "Rotate towards block while placing") { vis() && page == Page.PLACE }
override val placeConfirmation by c.setting("Place Confirmation", true, "Wait for block placement confirmation") { vis() && page == Page.PLACE }
override val placeTimeout by c.setting("Place Timeout", 10, 1..30, 1, "Timeout for block placement in ticks", unit = " ticks") { vis() && page == Page.PLACE && placeConfirmation }
override val maxPendingPlacements by c.setting("Max Pending Places", 1, 1..10, 1, "Maximum pending block places") { vis() && page == Page.PLACE }
override val placementsPerTick by c.setting("Instant Places Per Tick", 1, 1..30, 1, "Maximum instant block places per tick") { vis() && page == Page.PLACE }
override val rotateForPlace by c.setting("Rotate For Place", true, "Rotate towards block while placing") { vis() && page == Page.Place }
override val placeConfirmation by c.setting("Place Confirmation", true, "Wait for block placement confirmation") { vis() && page == Page.Place }
override val placementsPerTick by c.setting("Instant Places Per Tick", 1, 1..30, 1, "Maximum instant block places per tick") { vis() && page == Page.Place }

override val interactionTimeout by c.setting("Interaction Timeout", 10, 1..30, 1, "Timeout for block breaks in ticks", unit = " ticks") { vis() && (page == Page.Place && placeConfirmation || page == Page.Break && breakConfirmation) }
}
31 changes: 31 additions & 0 deletions common/src/main/kotlin/com/lambda/config/groups/HotbarSettings.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2025 Lambda
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.lambda.config.groups

import com.lambda.config.Configurable
import com.lambda.interaction.request.Priority
import com.lambda.interaction.request.hotbar.HotbarConfig

class HotbarSettings(
c: Configurable,
priority: Priority = 0,
vis: () -> Boolean = { true }
) : HotbarConfig(priority) {
override val keepTicks by c.setting("Keep Ticks", 3, 0..20, 1, "The number of ticks to keep the current hotbar selection active", " ticks", vis)
override var switchPause by c.setting("Switch Pause", 0, 0..20, 1, "The delay in ticks to pause actions after switching to the slot", " ticks", vis)
}
Loading