use of org.terasology.logic.inventory.events.ChangeSelectedInventorySlotRequest in project Terasology by MovingBlocks.
the class CharacterInventorySystem method onPrevItem.
@ReceiveEvent(components = { CharacterComponent.class }, netFilter = RegisterMode.CLIENT)
public void onPrevItem(ToolbarPrevButton event, EntityRef entity, SelectedInventorySlotComponent selectedInventorySlotComponent) {
int prevSlot = (selectedInventorySlotComponent.slot + 9) % 10;
localPlayer.getCharacterEntity().send(new ChangeSelectedInventorySlotRequest(prevSlot));
event.consume();
}
use of org.terasology.logic.inventory.events.ChangeSelectedInventorySlotRequest in project Terasology by MovingBlocks.
the class CharacterInventorySystem method onNextItem.
@ReceiveEvent(components = { CharacterComponent.class }, netFilter = RegisterMode.CLIENT)
public void onNextItem(ToolbarNextButton event, EntityRef entity, SelectedInventorySlotComponent selectedInventorySlotComponent) {
int nextSlot = (selectedInventorySlotComponent.slot + 1) % 10;
localPlayer.getCharacterEntity().send(new ChangeSelectedInventorySlotRequest(nextSlot));
event.consume();
}
use of org.terasology.logic.inventory.events.ChangeSelectedInventorySlotRequest in project Terasology by MovingBlocks.
the class CharacterInventorySystem method onSlotButton.
@ReceiveEvent(components = { CharacterComponent.class }, netFilter = RegisterMode.CLIENT)
public void onSlotButton(ToolbarSlotButton event, EntityRef entity) {
localPlayer.getCharacterEntity().send(new ChangeSelectedInventorySlotRequest(event.getSlot()));
event.consume();
}
Aggregations