use of org.terasology.logic.inventory.InventoryManager in project Terasology by MovingBlocks.
the class InventoryCell method takeAmount.
private void takeAmount(int amount) {
EntityRef characterEntity = CoreRegistry.get(LocalPlayer.class).getCharacterEntity();
InventoryManager inventoryManager = CoreRegistry.get(InventoryManager.class);
inventoryManager.moveItem(getTransferEntity(), characterEntity, 0, getTargetInventory(), getTargetSlot(), amount);
}
use of org.terasology.logic.inventory.InventoryManager in project Terasology by MovingBlocks.
the class InventoryCell method giveAmount.
private void giveAmount(int amount) {
EntityRef characterEntity = CoreRegistry.get(LocalPlayer.class).getCharacterEntity();
InventoryManager inventoryManager = CoreRegistry.get(InventoryManager.class);
inventoryManager.moveItem(getTargetInventory(), characterEntity, getTargetSlot(), getTransferEntity(), 0, amount);
}
use of org.terasology.logic.inventory.InventoryManager in project Terasology by MovingBlocks.
the class InventoryCell method swapItem.
private void swapItem() {
EntityRef characterEntity = CoreRegistry.get(LocalPlayer.class).getCharacterEntity();
InventoryManager inventoryManager = CoreRegistry.get(InventoryManager.class);
inventoryManager.switchItem(getTransferEntity(), characterEntity, 0, getTargetInventory(), getTargetSlot());
}
Aggregations