Skip to content

Commit 675bd77

Browse files
committed
improvements
1 parent 3676ccf commit 675bd77

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,15 @@ object BreakManager : RequestHandler<BreakRequest>(
508508
*
509509
* If a primary [BreakInfo] is active, as long as the tick stage is valid, it is transformed
510510
* into a secondary break, so a new primary can be initialized. This means sending a
511-
* [net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action] with action: [net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK]
511+
* PlayerActionC2SPacket with action: STOP_DESTROY_BLOCK
512512
* packet to the server to start the automated breaking server side.
513513
*
514514
* If there is no way to keep both breaks, and the primary break hasn't been updated yet,
515515
* the primary break is canceled. Otherwise, the break cannot be started.
516516
*
517517
* @return the [BreakInfo], or null, if the break context wasn't accepted.
518+
*
519+
* @see net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket
518520
*/
519521
private fun AutomatedSafeContext.initNewBreak(
520522
requestCtx: BreakContext,
@@ -691,9 +693,11 @@ object BreakManager : RequestHandler<BreakRequest>(
691693
}
692694

693695
/**
694-
* A modified version of the vanilla [net.minecraft.client.network.ClientPlayerInteractionManager.updateBlockBreakingProgress] method.
696+
* A modified version of the vanilla updateBlockBreakingProgress method.
695697
*
696698
* @return if the update was successful.
699+
*
700+
* @see net.minecraft.client.network.ClientPlayerInteractionManager.updateBlockBreakingProgress
697701
*/
698702
private fun SafeContext.updateBreakProgress(info: BreakInfo): Unit = info.request.runSafeAutomated {
699703
val ctx = info.context
@@ -783,9 +787,11 @@ object BreakManager : RequestHandler<BreakRequest>(
783787
}
784788

785789
/**
786-
* A modified version of the minecraft [net.minecraft.client.network.ClientPlayerInteractionManager.attackBlock] method.
790+
* A modified version of the minecraft attackBlock method.
787791
*
788792
* @return if the block started breaking successfully.
793+
*
794+
* @see net.minecraft.client.network.ClientPlayerInteractionManager.attackBlock
789795
*/
790796
private fun AutomatedSafeContext.startBreaking(info: BreakInfo): Boolean {
791797
val ctx = info.context

src/main/kotlin/com/lambda/interaction/request/breaking/BreakRequest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ import net.minecraft.util.math.BlockPos
3939
* A private constructor is used to force use of the cleaner [BreakRequestDsl] builder. This is
4040
* accessed through the [breakRequest] method.
4141
*
42-
* @param contexts A collection of [BreakContext]'s gathered from the [com.lambda.interaction.construction.simulation.BuildSimulator].
42+
* @param contexts A collection of [BreakContext]'s gathered from the BuildSimulator.
4343
* @param pendingInteractions A mutable, concurrent list to store the pending actions.
44+
*
45+
* @see com.lambda.interaction.construction.simulation.BuildSimulator
4446
*/
4547
data class BreakRequest private constructor(
4648
val contexts: Collection<BreakContext>,

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ object BrokenBlockHandler : PostActionHandler<BreakInfo>() {
139139
}
140140

141141
/**
142-
* A modified version of the minecraft [net.minecraft.client.world.ClientWorld.breakBlock] method.
142+
* A modified version of the minecraft breakBlock method.
143143
*
144144
* Performs the actions required to display breaking particles, sounds, texture overlay, etc.
145145
* based on the user's settings.
146+
*
147+
* @see net.minecraft.client.world.ClientWorld.breakBlock
146148
*/
147149
fun SafeContext.destroyBlock(info: BreakInfo) {
148150
val ctx = info.context

src/main/kotlin/com/lambda/interaction/request/hotbar/HotbarManager.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ object HotbarManager : RequestHandler<HotbarRequest>(
124124
}
125125

126126
/**
127-
* Sets the [activeRequest]. This also calls [net.minecraft.client.network.ClientPlayerInteractionManager.syncSelectedSlot] to
127+
* Sets the [activeRequest]. This also calls syncSelectedSlot to
128128
* update the server now to keep predictability.
129+
*
130+
* @see net.minecraft.client.network.ClientPlayerInteractionManager.syncSelectedSlot
129131
*/
130132
private fun AutomatedSafeContext.setActiveRequest(request: HotbarRequest) {
131133
maxSwapsThisTick = hotbarConfig.swapsPerTick

src/main/kotlin/com/lambda/interaction/request/inventory/InventoryManager.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ object InventoryManager : RequestHandler<InventoryRequest>(
157157
private fun getStacks(slots: Collection<Slot>) = slots.map { it.stack.copy() }
158158

159159
/**
160-
* A modified version of the [net.minecraft.client.network.ClientPlayNetworkHandler.onInventory] method
160+
* A modified version of the minecraft onInventory method
161+
*
162+
* @see net.minecraft.client.network.ClientPlayNetworkHandler.onInventory
161163
*/
162164
@JvmStatic
163165
fun onInventoryUpdate(packet: InventoryS2CPacket, original: Operation<Void>){

src/main/kotlin/com/lambda/interaction/request/placing/PlaceManager.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ object PlaceManager : RequestHandler<PlaceRequest>(
207207
}
208208

209209
/**
210-
* A modified version of the minecraft [net.minecraft.client.network.ClientPlayerInteractionManager.interactBlock] method,
210+
* A modified version of the minecraft interactBlock method,
211211
* renamed to better suit its usage.
212+
*
213+
* @see net.minecraft.client.network.ClientPlayerInteractionManager.interactBlock
212214
*/
213215
private fun AutomatedSafeContext.placeBlock(placeContext: PlaceContext, request: PlaceRequest, hand: Hand): ActionResult {
214216
interaction.syncSelectedSlot()
@@ -225,7 +227,9 @@ object PlaceManager : RequestHandler<PlaceRequest>(
225227
}
226228

227229
/**
228-
* A modified version of the minecraft [net.minecraft.client.network.ClientPlayerInteractionManager.interactBlockInternal] method.
230+
* A modified version of the minecraft interactBlockInternal method.
231+
*
232+
* @see net.minecraft.client.network.ClientPlayerInteractionManager.interactBlockInternal
229233
*/
230234
private fun AutomatedSafeContext.interactBlockInternal(
231235
placeContext: PlaceContext,
@@ -266,7 +270,9 @@ object PlaceManager : RequestHandler<PlaceRequest>(
266270
}
267271

268272
/**
269-
* A modified version of the minecraft [net.minecraft.item.Item.useOnBlock] method.
273+
* A modified version of the minecraft useOnBlock method.
274+
*
275+
* @see net.minecraft.item.Item.useOnBlock
270276
*/
271277
private fun AutomatedSafeContext.useOnBlock(
272278
placeContext: PlaceContext,
@@ -294,7 +300,9 @@ object PlaceManager : RequestHandler<PlaceRequest>(
294300
}
295301

296302
/**
297-
* A modified version of the minecraft [net.minecraft.item.BlockItem.place] method.
303+
* A modified version of the minecraft place method.
304+
*
305+
* @see net.minecraft.item.BlockItem.place
298306
*/
299307
private fun AutomatedSafeContext.place(
300308
placeContext: PlaceContext,

0 commit comments

Comments
 (0)