Skip to content

Commit 96ad379

Browse files
committed
rename placement settings to interaction settings
1 parent 596695b commit 96ad379

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ class InteractSettings(
3030
c: Configurable,
3131
baseGroup: NamedEnum
3232
) : SettingGroup(c), InteractConfig {
33-
override val rotate by c.setting("Rotate For Place", true, "Rotate towards block while placing").group(baseGroup).index()
33+
override val rotate by c.setting("Rotate For Interact", true, "Rotate towards block while placing").group(baseGroup).index()
3434
override val airPlace by c.setting("Air Place", AirPlaceMode.None, "Allows for placing blocks without adjacent faces").group(baseGroup).index()
3535
override val axisRotateSetting by c.setting("Axis Rotate", true, "Overrides the Rotate For Place setting and rotates the player on each axis to air place rotational blocks") { airPlace.isEnabled }.group(baseGroup).index()
36-
override val sorter by c.setting("Place Sorter", ActionConfig.SortMode.Tool, "The order in which placements are performed").group(baseGroup).index()
37-
override val tickStageMask by c.setting("Place Stage Mask", setOf(TickEvent.Input.Post), ALL_STAGES.toSet(), description = "The sub-tick timing at which place actions are performed").group(baseGroup).index()
38-
override val placeConfirmationMode by c.setting("Place Confirmation", PlaceConfirmationMode.PlaceThenAwait, "Wait for block placement confirmation").group(baseGroup).index()
39-
override val maxPendingPlacements by c.setting("Max Pending Placements", 5, 0..30, 1, "The maximum amount of pending placements").group(baseGroup).index()
40-
override val placementsPerTick by c.setting("Places Per Tick", 1, 1..30, 1, "Maximum instant block places per tick").group(baseGroup).index()
41-
override val swing by c.setting("Swing On Place", true, "Swings the players hand when placing").group(baseGroup).index()
42-
override val swingType by c.setting("Place Swing Type", BuildConfig.SwingType.Vanilla, "The style of swing") { swing }.group(baseGroup).index()
36+
override val sorter by c.setting("Interaction Sorter", ActionConfig.SortMode.Tool, "The order in which placements are performed").group(baseGroup).index()
37+
override val tickStageMask by c.setting("Interaction Stage Mask", setOf(TickEvent.Input.Post), ALL_STAGES.toSet(), description = "The sub-tick timing at which place actions are performed").group(baseGroup).index()
38+
override val interactConfirmationMode by c.setting("Interact Confirmation", PlaceConfirmationMode.PlaceThenAwait, "Wait for block placement confirmation").group(baseGroup).index()
39+
override val maxPendingInteractions by c.setting("Max Pending Interactions", 5, 0..30, 1, "The maximum amount of pending placements").group(baseGroup).index()
40+
override val interactionsPerTick by c.setting("Interactions Per Tick", 1, 1..30, 1, "Maximum instant block places per tick").group(baseGroup).index()
41+
override val swing by c.setting("Swing On Interact", true, "Swings the players hand when placing").group(baseGroup).index()
42+
override val swingType by c.setting("Interact Swing Type", BuildConfig.SwingType.Vanilla, "The style of swing") { swing }.group(baseGroup).index()
4343
override val sounds by c.setting("Place Sounds", true, "Plays the placing sounds").group(baseGroup).index()
4444
}

src/main/kotlin/com/lambda/interaction/request/interacting/InteractConfig.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ interface InteractConfig : ActionConfig, ISettingGroup {
2828
val airPlace: AirPlaceMode
2929
val axisRotateSetting: Boolean
3030
val axisRotate get() = rotate && airPlace.isEnabled && axisRotateSetting
31-
val placeConfirmationMode: PlaceConfirmationMode
32-
val maxPendingPlacements: Int
33-
val placementsPerTick: Int
31+
val interactConfirmationMode: PlaceConfirmationMode
32+
val maxPendingInteractions: Int
33+
val interactionsPerTick: Int
3434
val swing: Boolean
3535
val swingType: BuildConfig.SwingType
3636
val sounds: Boolean

src/main/kotlin/com/lambda/interaction/request/interacting/InteractManager.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,14 @@ object InteractManager : RequestHandler<InteractRequest>(
200200
.filter { !isPosBlocked(it.blockPos) }
201201
.take(
202202
min(
203-
interactConfig.maxPendingPlacements - pendingActions.size,
203+
interactConfig.maxPendingInteractions - pendingActions.size,
204204
buildConfig.maxPendingInteractions - request.pendingInteractions.size
205205
).coerceAtLeast(0)
206206
)
207207
.toMutableList()
208208
logger.debug("${potentialPlacements.size} potential placements")
209209

210-
maxPlacementsThisTick = interactConfig.placementsPerTick
210+
maxPlacementsThisTick = interactConfig.interactionsPerTick
211211
}
212212

213213
/**
@@ -339,14 +339,14 @@ object InteractManager : RequestHandler<InteractRequest>(
339339
sendInteractPacket(hand, hitResult)
340340
}
341341

342-
if (interactConfig.placeConfirmationMode != InteractConfig.PlaceConfirmationMode.None) {
342+
if (interactConfig.interactConfirmationMode != InteractConfig.PlaceConfirmationMode.None) {
343343
InteractInfo(interactContext, request.pendingInteractions, request.onPlace, interactConfig).startPending()
344344
}
345345

346346
val itemStack = itemPlacementContext.stack
347347
itemStack.decrementUnlessCreative(1, player)
348348

349-
if (interactConfig.placeConfirmationMode == InteractConfig.PlaceConfirmationMode.AwaitThenPlace)
349+
if (interactConfig.interactConfirmationMode == InteractConfig.PlaceConfirmationMode.AwaitThenPlace)
350350
return ActionResult.SUCCESS
351351

352352
// TODO: Implement restriction checks (e.g., world height) to prevent unnecessary server requests when the
@@ -367,7 +367,7 @@ object InteractManager : RequestHandler<InteractRequest>(
367367

368368
if (interactConfig.sounds) placeSound(state, blockPos)
369369

370-
if (interactConfig.placeConfirmationMode == InteractConfig.PlaceConfirmationMode.None) {
370+
if (interactConfig.interactConfirmationMode == InteractConfig.PlaceConfirmationMode.None) {
371371
request.onPlace?.invoke(this, interactContext.blockPos)
372372
}
373373

src/main/kotlin/com/lambda/interaction/request/interacting/InteractedBlockHandler.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ object InteractedBlockHandler : PostActionHandler<InteractInfo>() {
3535
DEFAULT.buildConfig.interactionTimeout * 50L
3636
) {
3737
info("${it::class.simpleName} at ${it.context.blockPos.toShortString()} timed out")
38-
if (it.interactConfig.placeConfirmationMode != InteractConfig.PlaceConfirmationMode.AwaitThenPlace) {
38+
if (it.interactConfig.interactConfirmationMode != InteractConfig.PlaceConfirmationMode.AwaitThenPlace) {
3939
runSafe {
4040
world.setBlockState(it.context.blockPos, it.context.cachedState)
4141
}
@@ -66,7 +66,7 @@ object InteractedBlockHandler : PostActionHandler<InteractInfo>() {
6666

6767
pending.stopPending()
6868

69-
if (pending.interactConfig.placeConfirmationMode == InteractConfig.PlaceConfirmationMode.AwaitThenPlace)
69+
if (pending.interactConfig.interactConfirmationMode == InteractConfig.PlaceConfirmationMode.AwaitThenPlace)
7070
with(pending.context) { placeSound(expectedState, blockPos) }
7171
pending.onPlace?.invoke(this, pending.context.blockPos)
7272
}

0 commit comments

Comments
 (0)