feat(AutoMount): Add AutoMount module#240
feat(AutoMount): Add AutoMount module#240IceTank wants to merge 6 commits intolambda-client:1.21.11from
Conversation
|
Not tested yet |
|
Works now |
src/main/kotlin/com/lambda/module/modules/movement/AutoMount.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/module/modules/movement/AutoMount.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/module/modules/movement/AutoMount.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/module/modules/movement/AutoMount.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/module/modules/movement/AutoMount.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/module/modules/movement/AutoMount.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/module/modules/movement/AutoMount.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/lambda/module/modules/movement/AutoMount.kt
Outdated
Show resolved
Hide resolved
|
oh yeah, also use connection inside of SafeContext rather than mc.networkHandler |
| transitive-accessible class net/minecraft/screen/slot/ArmorSlot | ||
| transitive-accessible field net/minecraft/screen/slot/ArmorSlot equipmentSlot Lnet/minecraft/entity/EquipmentSlot; | ||
| transitive-accessible field net/minecraft/entity/Entity FLAGS Lnet/minecraft/entity/data/TrackedData; | ||
| accessible method net/minecraft/entity/Entity canAddPassenger (Lnet/minecraft/entity/Entity;)Z |
There was a problem hiding this comment.
add transitive- at the beginning
| var lastEntity: Entity? = null | ||
|
|
||
| init { | ||
| setDefaultAutomationConfig("AutoMount") |
There was a problem hiding this comment.
best to hide unused configs in the automation config
| ) { | ||
| var autoRemount by setting("Auto Remount", false, description = "Automatically remounts if you get off") | ||
| var autoMountEntities by setting("Auto Mount Entities", true, description = "Automatically mounts nearby entities in range") | ||
| var autoMountEntityList by setting("Auto Mount Entity List", mutableListOf(), Registries.ENTITY_TYPE.toList()) { autoMountEntities } |
There was a problem hiding this comment.
we have an entity selection settings group now which you could use and modify the default selected
| var hit: VisibilityChecker.CheckedHit? = null | ||
| rotationRequest { | ||
| hit = lookAtEntity(entity) | ||
| }.submit() |
There was a problem hiding this comment.
no check for if the rotation is done
| runSafeAutomated { | ||
| var hit: VisibilityChecker.CheckedHit? = null | ||
| rotationRequest { | ||
| hit = lookAtEntity(entity) |
There was a problem hiding this comment.
this doesnt actually set the rotation in the request. Best to set the hit value before the request, then set the rotation in the request
| } | ||
| } | ||
|
|
||
| private fun SafeContext.interactEntity(entity: Entity) { |
There was a problem hiding this comment.
could make the whole function AutomatedSafeContext rather than SafeContext as one of the call sites already has an automated safe context and it would cut down on an extra indent
| } | ||
| } else { | ||
| connection.sendPacket(PlayerInteractEntityC2SPacket.interactAt(entity, false, Hand.MAIN_HAND, Vec3d(0.5, 0.5, 0.5))) | ||
| connection.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, false, Hand.MAIN_HAND)) |
There was a problem hiding this comment.
isnt this only sent if the first one isnt successful in vanilla mc?
| }.submit() | ||
| hit?.let { | ||
| val hitResult = it.hit as? EntityHitResult ?: return@let | ||
| interaction.interactEntityAtLocation(player, entity, hitResult, Hand.MAIN_HAND) |
There was a problem hiding this comment.
this doesnt have the player sneaking override to set it to false
| return@let | ||
| } | ||
| if (canRide(it)) { | ||
| intervalTimer.reset() |
There was a problem hiding this comment.
could prob put this at the start of interactEntity as its called before every invocation
Add AutoMount module to automatically mount or remount entities