Search in sources :

Example 1 with CharacterImpulseEvent

use of org.terasology.engine.logic.characters.CharacterImpulseEvent in project Terasology by MovingBlocks.

the class MovementDebugCommands method pushCharacterCommand.

@Command(value = "pushCharacter", shortDescription = "Pushes you in the direction (x, y, z)", runOnServer = true)
public String pushCharacterCommand(@Sender EntityRef sender, @CommandParam("x") float x, @CommandParam("y") float y, @CommandParam("z") float z) {
    ClientComponent clientComponent = sender.getComponent(ClientComponent.class);
    clientComponent.character.send(new CharacterImpulseEvent(new Vector3f(x, y, z)));
    return "Pushing character with " + x + " " + y + " " + z;
}
Also used : Vector3f(org.joml.Vector3f) ClientComponent(org.terasology.engine.network.ClientComponent) CharacterImpulseEvent(org.terasology.engine.logic.characters.CharacterImpulseEvent) Command(org.terasology.engine.logic.console.commandSystem.annotations.Command)

Aggregations

Vector3f (org.joml.Vector3f)1 CharacterImpulseEvent (org.terasology.engine.logic.characters.CharacterImpulseEvent)1 Command (org.terasology.engine.logic.console.commandSystem.annotations.Command)1 ClientComponent (org.terasology.engine.network.ClientComponent)1