Examples of ClientComponent


Examples of org.terasology.network.ClientComponent

    // TODO: However, it's unclear why the headless server needs a LocalPlayer,
    // TODO: instance. If that can be avoided the code in the following method
    // TODO: might be more rightfully placed in the LocalPlayer constructor.
    public void setClientEntity(EntityRef entity) {
        this.clientEntity = entity;
        ClientComponent clientComp = entity.getComponent(ClientComponent.class);
        if (clientComp != null) {
            clientComp.local = true;
            entity.saveComponent(clientComp);
        }
    }
View Full Code Here

Examples of org.terasology.network.ClientComponent

    public EntityRef getClientEntity() {
        return clientEntity;
    }

    public EntityRef getCharacterEntity() {
        ClientComponent client = clientEntity.getComponent(ClientComponent.class);
        if (client != null) {
            return client.character;
        }
        return EntityRef.NULL;
    }
View Full Code Here

Examples of org.terasology.network.ClientComponent

        EntityBuilder builder = entityManager.newBuilder("engine:player");
        builder.getComponent(LocationComponent.class).setWorldPosition(spawnPosition);
        builder.setOwner(controller);
        EntityRef transferSlot = entityManager.create("engine:transferSlot");

        ClientComponent clientComp = controller.getComponent(ClientComponent.class);
        if (clientComp != null) {
            ColorComponent colorComp = clientComp.clientInfo.getComponent(ColorComponent.class);
           
            MeshComponent meshComp = builder.getComponent(MeshComponent.class);
            meshComp.color = colorComp.color;
View Full Code Here

Examples of org.terasology.network.ClientComponent

@RegisterSystem
public class MovementDebugCommands extends BaseComponentSystem {

    @Command(shortDescription = "Grants flight and movement through walls", runOnServer = true)
    public String ghost(EntityRef client) {
        ClientComponent clientComp = client.getComponent(ClientComponent.class);
        clientComp.character.send(new SetMovementModeEvent(MovementMode.GHOSTING));

        return "Ghost mode toggled";
    }
View Full Code Here

Examples of org.terasology.network.ClientComponent

        return "Ghost mode toggled";
    }

    @Command(shortDescription = "Grants flight", runOnServer = true)
    public String flight(EntityRef client) {
        ClientComponent clientComp = client.getComponent(ClientComponent.class);
        clientComp.character.send(new SetMovementModeEvent(MovementMode.FLYING));

        return "Flight mode toggled";
    }
View Full Code Here

Examples of org.terasology.network.ClientComponent

    }


    @Command(shortDescription = "Set speed multiplier", helpText = "Set speedMultiplier", runOnServer = true)
    public String setSpeedMultiplier(@CommandParam("amount") float amount, EntityRef client) {
        ClientComponent clientComp = client.getComponent(ClientComponent.class);
        CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class);
        if (move != null) {
            float oldSpeedMultipler = move.speedMultiplier;
            move.speedMultiplier = amount;
            clientComp.character.saveComponent(move);
View Full Code Here

Examples of org.terasology.network.ClientComponent

        return "";
    }

    @Command(shortDescription = "Set jump speed", runOnServer = true)
    public String setJumpSpeed(@CommandParam("amount") float amount, EntityRef client) {
        ClientComponent clientComp = client.getComponent(ClientComponent.class);
        CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class);
        if (move != null) {
            float oldSpeed = move.jumpSpeed;
            move.jumpSpeed = amount;
            clientComp.character.saveComponent(move);
View Full Code Here

Examples of org.terasology.network.ClientComponent

        return "";
    }

    @Command(shortDescription = "Show your Movement stats")
    public String showMovement(EntityRef client) {
        ClientComponent clientComp = client.getComponent(ClientComponent.class);
        CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class);
        if (move != null) {
            return "Your SpeedMultiplier:" + move.speedMultiplier + " JumpSpeed:"
                    + move.jumpSpeed + " SlopeFactor:"
                    + move.slopeFactor + " RunFactor:" + move.runFactor;
View Full Code Here

Examples of org.terasology.network.ClientComponent

        return "You're dead I guess.";
    }

    @Command(shortDescription = "Go really fast", runOnServer = true)
    public String hspeed(EntityRef client) {
        ClientComponent clientComp = client.getComponent(ClientComponent.class);
        CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class);
        if (move != null) {
            move.speedMultiplier = 10f;
            move.jumpSpeed = 24f;
            clientComp.character.saveComponent(move);
View Full Code Here

Examples of org.terasology.network.ClientComponent

        return "";
    }

    @Command(shortDescription = "Jump really high", runOnServer = true)
    public String hjump(EntityRef client) {
        ClientComponent clientComp = client.getComponent(ClientComponent.class);
        CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class);
        HealthComponent health = clientComp.character.getComponent(HealthComponent.class);
        if (health != null && move != null) {
            move.jumpSpeed = 75f;
            health.fallingDamageSpeedThreshold = 85f;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.