Package org.terasology.logic.players.event

Examples of org.terasology.logic.players.event.SelectItemRequest


    @ReceiveEvent(components = {CharacterComponent.class})
    public void onNextItem(ToolbarNextButton event, EntityRef entity) {
        CharacterComponent character = localPlayer.getCharacterEntity().getComponent(CharacterComponent.class);
        int nextSlot = (character.selectedItem + 1) % 10;
        localPlayer.getCharacterEntity().send(new SelectItemRequest(nextSlot));
        event.consume();
    }
View Full Code Here


    @ReceiveEvent(components = {CharacterComponent.class})
    public void onPrevItem(ToolbarPrevButton event, EntityRef entity) {
        CharacterComponent character = localPlayer.getCharacterEntity().getComponent(CharacterComponent.class);
        int prevSlot = (character.selectedItem + 9) % 10;
        localPlayer.getCharacterEntity().send(new SelectItemRequest(prevSlot));
        event.consume();
    }
View Full Code Here

    }

    @ReceiveEvent(components = {CharacterComponent.class})
    public void onSlotButton(ToolbarSlotButton event, EntityRef entity) {
        CharacterComponent character = entity.getComponent(CharacterComponent.class);
        localPlayer.getCharacterEntity().send(new SelectItemRequest(event.getSlot()));
        event.consume();
    }
View Full Code Here

TOP

Related Classes of org.terasology.logic.players.event.SelectItemRequest

Copyright © 2018 www.massapicom. 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.