Skip to content

Commit 72dc508

Browse files
committed
incredibly large break limits
1 parent 7e2b244 commit 72dc508

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/main/kotlin/com/lambda/config/blocks/BreakSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class BreakSettings(override val c: Config) : BreakConfig, ConfigBlock {
6262
override val rotate by c.setting("Rotate For Break", false, "Rotate towards block while breaking")
6363
// Pending / Post
6464
override val breakConfirmation by c.setting("Break Confirmation", BreakConfirmationMode.BreakThenAwait, "The style of confirmation used when breaking")
65-
override val breaksPerTick by c.setting("Breaks Per Tick", 30, 1..30, 1, "Maximum instant block breaks per tick")
65+
override val breaksPerTick by c.setting("Breaks Per Tick", 59, 1..60, 1, "Maximum instant block breaks per tick")
6666
override val whitelistMode by c.setting("Whitelist Mode", WhitelistMode.None, "The type of block selection used")
6767
override val whitelist by c.setting("Whitelist", mutableSetOf(), Registries.BLOCK.toSet(), "Only these selected blocks are allowed to be broken") { whitelistMode == WhitelistMode.Whitelist }
6868
override val blacklist by c.setting("Blacklist", mutableSetOf(), Registries.BLOCK.toSet(), "These selected blocks are not allowed to be broken") { whitelistMode == WhitelistMode.Blacklist }

src/main/kotlin/com/lambda/config/blocks/BuildSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class BuildSettings(override val c: Config) : BuildConfig, ConfigBlock {
3838
@Group(GENERAL_GROUP) override val collectDrops by c.setting("Collect All Drops", false, "Collect all drops when breaking blocks")
3939
@Group(GENERAL_GROUP) override val spleefEntities by c.setting("Spleef Entities", false, "Breaks blocks beneath entities blocking placements to get them out of the way")
4040
@Group(GENERAL_GROUP) override val cautionDoubleBlocks by c.setting("Caution Double Blocks", true, "Prevents spamming double blocks like doors, chests, etc when configured to interact more than once per tick")
41-
@Group(GENERAL_GROUP) override val maxPendingActions by c.setting("Max Pending Actions", 15, 1..30, 1, "The maximum count of pending interactions to allow before pausing future interactions")
41+
@Group(GENERAL_GROUP) override val maxPendingActions by c.setting("Max Pending Actions", 59, 1..60, 1, "The maximum count of pending interactions to allow before pausing future interactions")
4242
@Group(GENERAL_GROUP) override val actionTimeout by c.setting("Action Timeout", 10, 1..30, 1, "Timeout for block breaks in ticks", unit = " ticks")
4343
@Group(GENERAL_GROUP) override val maxBuildDependencies by c.setting("Max Sim Dependencies", 3, 0..10, 1, "Maximum dependency build results")
4444

src/main/kotlin/com/lambda/config/blocks/InteractSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class InteractSettings(override val c: Config) : InteractConfig, ConfigBlock {
3434
override val tickStageMask by c.setting("Interaction Stage Mask", setOf(TickEvent.Input.Post), ALL_STAGES.toSet(), "The sub-tick timing at which place actions are performed", displayClassName = true)
3535
override val interactConfirmationMode by c.setting("Interact Confirmation", InteractConfirmationMode.PlaceThenAwait, "Wait for block placement confirmation")
3636
override val interactDelay by c.setting("Interact Delay", 0, 0..3, 1, "Tick delay between interacting with another block")
37-
override val interactionsPerTick by c.setting("Interactions Per Tick", 9, 1..30, 1, "Maximum instant block places per tick")
37+
override val interactionsPerTick by c.setting("Interactions Per Tick", 9, 1..60, 1, "Maximum instant block places per tick")
3838
override val swing by c.setting("Swing On Interact", true, "Swings the players hand when placing")
3939
override val swingType by c.setting("Interact Swing Type", SwingType.Vanilla, "The style of swing") { swing }
4040
override val sounds by c.setting("Place Sounds", true, "Plays the placing sounds")

src/main/kotlin/com/lambda/interaction/managers/breaking/BreakManager.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ object BreakManager : Manager<BreakRequest>(
617617
}
618618
}
619619
breaksThisTick++
620-
if (info.type == Primary) breakDelay = info.getBreakDelay()
620+
if (info.type == Primary && !info.vanillaInstantBreakable) breakDelay = info.getBreakDelay()
621621
info.nullify()
622622
}
623623

@@ -701,7 +701,6 @@ object BreakManager : Manager<BreakRequest>(
701701

702702
if (gamemode.isCreative && world.worldBorder.contains(ctx.blockPos)) {
703703
if (!PacketLimitHandler.canSendPackets(1, PacketType.PlayerAction)) return
704-
breakDelay = info.getBreakDelay()
705704
lastPosStarted = ctx.blockPos
706705
onBlockBreak(info)
707706
info.startBreakPacket()
@@ -815,7 +814,6 @@ object BreakManager : Manager<BreakRequest>(
815814
onBlockBreak(info)
816815
info.startBreakPacket()
817816
PacketLimitHandler.sentPackets(1, PacketType.PlayerAction)
818-
breakDelay = info.getBreakDelay()
819817
if (breakConfig.swing.isEnabled()) swingHand(breakConfig.swingType, Hand.MAIN_HAND)
820818
return true
821819
}
@@ -828,7 +826,7 @@ object BreakManager : Manager<BreakRequest>(
828826
var packetCount = 1
829827
info.vanillaInstantBreakable = progress >= 1
830828
val isGrim = breakConfig.breakMode == BreakMode.Grim
831-
val oldGrim = breakConfig.breakMode == BreakMode.OldGrim
829+
val oldGrim = breakConfig.breakMode == BreakMode.OldGrim && !info.vanillaInstantBreakable
832830
val requiresSecondStop = instantBreakable && !info.vanillaInstantBreakable
833831

834832
if (isGrim) packetCount++
@@ -845,10 +843,8 @@ object BreakManager : Manager<BreakRequest>(
845843
blockState.onBlockBreakStart(world, ctx.blockPos, player)
846844
}
847845

848-
if (instantBreakable) {
849-
onBlockBreak(info)
850-
if (!info.vanillaInstantBreakable) breakDelay = info.getBreakDelay()
851-
} else {
846+
if (instantBreakable) onBlockBreak(info)
847+
else {
852848
info.apply {
853849
breaking = true
854850
breakingTicks = 1

0 commit comments

Comments
 (0)