use of org.terasology.logic.console.commandSystem.annotations.Command in project Terasology by MovingBlocks.
the class ServerCommands method kickUserByID.
@Command(shortDescription = "Kick user by ID", runOnServer = true, requiredPermission = PermissionManager.USER_MANAGEMENT_PERMISSION)
public String kickUserByID(@CommandParam("userId") int userId) {
for (EntityRef clientEntity : entityManager.getEntitiesWith(ClientComponent.class)) {
EntityRef clientInfo = clientEntity.getComponent(ClientComponent.class).clientInfo;
NetworkComponent nc = clientInfo.getComponent(NetworkComponent.class);
if (userId == nc.getNetworkId()) {
return kick(clientEntity);
}
}
throw new IllegalArgumentException("No such user with ID " + userId);
}
use of org.terasology.logic.console.commandSystem.annotations.Command in project Terasology by MovingBlocks.
the class MovementDebugCommands method sleigh.
@Command(shortDescription = "Toggles the maximum slope the player can walk up", runOnServer = true, requiredPermission = PermissionManager.CHEAT_PERMISSION)
public String sleigh(@Sender EntityRef client) {
ClientComponent clientComp = client.getComponent(ClientComponent.class);
CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class);
if (move != null) {
float oldFactor = move.slopeFactor;
if (move.slopeFactor > 0.7f) {
move.slopeFactor = 0.6f;
} else {
move.slopeFactor = 0.9f;
}
clientComp.character.saveComponent(move);
return "Slope factor is now " + move.slopeFactor + " (was " + oldFactor + ")";
}
return "";
}
use of org.terasology.logic.console.commandSystem.annotations.Command 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;
}
use of org.terasology.logic.console.commandSystem.annotations.Command in project Terasology by MovingBlocks.
the class MovementDebugCommands method flight.
@Command(shortDescription = "Grants flight", runOnServer = true, requiredPermission = PermissionManager.CHEAT_PERMISSION)
public String flight(@Sender EntityRef client) {
ClientComponent clientComp = client.getComponent(ClientComponent.class);
clientComp.character.send(new SetMovementModeEvent(MovementMode.FLYING));
return "Flight mode toggled";
}
use of org.terasology.logic.console.commandSystem.annotations.Command in project Terasology by MovingBlocks.
the class MovementDebugCommands method hjump.
@Command(shortDescription = "Jump really high", runOnServer = true, requiredPermission = PermissionManager.CHEAT_PERMISSION)
public String hjump(@Sender EntityRef client) {
ClientComponent clientComp = client.getComponent(ClientComponent.class);
CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class);
if (move != null) {
move.jumpSpeed = 75f;
clientComp.character.saveComponent(move);
return "High-jump mode activated";
}
return "";
}
Aggregations