Search in sources :

Example 1 with CharacterImpulseEvent

use of org.terasology.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.terasology.math.geom.Vector3f) ClientComponent(org.terasology.network.ClientComponent) CharacterImpulseEvent(org.terasology.logic.characters.CharacterImpulseEvent) Command(org.terasology.logic.console.commandSystem.annotations.Command)

Aggregations

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