Some ContentAPI usage

This commit is contained in:
dam 2026-06-13 03:09:18 +03:00
parent 189d989a28
commit cd74bb46b1
No known key found for this signature in database
GPG key ID: 4AF4E722399663FB
2 changed files with 13 additions and 10 deletions

View file

@ -250,7 +250,7 @@ public abstract class MovementPulse extends Pulse {
if (near || pulse()) {
if (mover instanceof Player) {
if (near) {
((Player) mover).getPacketDispatch().sendMessage("I can't reach that.");
sendMessage((Player) mover, "I can't reach that.");
}
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext((Player) mover));
}

View file

@ -1,6 +1,9 @@
package core.game.node.entity.combat
import core.ServerConstants
import core.api.face
import core.api.sendMessage
import core.api.stopWalk
import core.game.container.impl.EquipmentContainer
import core.game.node.Node
import core.game.node.entity.Entity
@ -273,15 +276,15 @@ object CombatMovementIntents {
attacker, target, attacker.location, projectedTargetLocation, trace
)
) {
attacker.walkingQueue.reset()
attacker.face(target)
stopWalk(attacker)
face(attacker, target)
projectedLocations[attacker] = attacker.location
reserveOccupiedTiles(reservedTiles, attacker, attacker.location)
return
}
if (canAttackFrom(attacker, target, attacker.location, targetLocation, trace)) {
attacker.walkingQueue.reset()
attacker.face(target)
stopWalk(attacker)
face(attacker, target)
projectedLocations[attacker] = attacker.location
reserveOccupiedTiles(reservedTiles, attacker, attacker.location)
return
@ -298,7 +301,7 @@ object CombatMovementIntents {
return
}
walkPath(attacker, attackPath)
attacker.face(target)
face(attacker, target)
projectedLocations[attacker] = attackPath.projectedLocation
reserveOccupiedTiles(reservedTiles, attacker, attackPath.projectedLocation)
return
@ -313,7 +316,7 @@ object CombatMovementIntents {
attacker, target, projectedAttackerLocation, targetLocation, trace
)
) {
attacker.face(target)
face(attacker, target)
projectedLocations[attacker] = projectedAttackerLocation
reserveOccupiedTiles(reservedTiles, attacker, projectedAttackerLocation)
return
@ -334,7 +337,7 @@ object CombatMovementIntents {
}
walkPath(attacker, attackPath)
attacker.face(target)
face(attacker, target)
projectedLocations[attacker] = attackPath.projectedLocation
reserveOccupiedTiles(reservedTiles, attacker, attackPath.projectedLocation)
return
@ -1111,9 +1114,9 @@ object CombatMovementIntents {
@JvmStatic
fun stopUnreachableCombat(attacker: Entity) {
attacker.properties.combatPulse.stop()
attacker.walkingQueue.reset()
stopWalk(attacker)
if (attacker is Player) {
attacker.packetDispatch.sendMessage("I can't reach that!")
sendMessage(attacker, "I can't reach that!")
}
}