Skip to content

Commit 064b78f

Browse files
committed
BrokenBlockHandler documentation
1 parent 9f6c8dd commit 064b78f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

common/src/main/kotlin/com/lambda/interaction/request/breaking/BrokenBlockHandler.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ import net.minecraft.block.OperatorBlock
3737
import net.minecraft.entity.ItemEntity
3838
import net.minecraft.util.math.ChunkSectionPos
3939

40+
/**
41+
* This object is designed to handle blocks that have been broken client side, yet are awaiting
42+
* confirmation from the server, and / or an item drop.
43+
*
44+
* @see BreakManager
45+
*/
4046
object BrokenBlockHandler {
4147
val pendingBreaks = LimitedDecayQueue<BreakInfo>(
4248
TaskFlowModule.build.maxPendingInteractions, TaskFlowModule.build.interactionTimeout * 50L
@@ -109,13 +115,17 @@ object BrokenBlockHandler {
109115
}
110116

111117
/**
112-
* Removes the [info] from the break manager, and requesters, pending interation collections.
118+
* Removes the [info] from the break manager, and requesters, pending interaction collections.
113119
*/
114120
private fun BreakInfo.stopPending() {
115121
pendingBreaks.remove(this)
116122
pendingInteractions.remove(context)
117123
}
118124

125+
/**
126+
* Sets the size limit and decay time for the [pendingBreaks] [LimitedDecayQueue]
127+
* using the [request]'s configs
128+
*/
119129
fun setPendingConfigs(request: BreakRequest) {
120130
pendingBreaks.setSizeLimit(request.build.breaking.maxPendingBreaks)
121131
pendingBreaks.setDecayTime(request.build.interactionTimeout * 50L)

0 commit comments

Comments
 (0)