@Override
  public boolean switchItem(
      EntityRef fromInventory,
      EntityRef instigator,
      int slotFrom,
      EntityRef toInventory,
      int slotTo) {
    if (!InventoryUtils.moveItem(instigator, fromInventory, slotFrom, toInventory, slotTo)) {
      return false;
    }

    MoveItemRequest request =
        new MoveItemRequest(instigator, fromInventory, slotFrom, toInventory, slotTo, changeId++);
    pendingMoves.put(request.getChangeId(), request);
    localPlayer.getClientEntity().send(request);

    return true;
  }
Exemple #2
-1
 private EntityRef[] getInputEntities() {
   return new EntityRef[] {localPlayer.getClientEntity(), localPlayer.getCharacterEntity()};
 }
  @Override
  public boolean moveItemToSlots(
      EntityRef instigator,
      EntityRef fromInventory,
      int slotFrom,
      EntityRef toInventory,
      List<Integer> toSlots) {
    if (!InventoryUtils.moveItemToSlots(
        instigator, fromInventory, slotFrom, toInventory, toSlots)) {
      return false;
    }

    MoveItemToSlotsRequest request =
        new MoveItemToSlotsRequest(
            instigator, fromInventory, slotFrom, toInventory, toSlots, changeId++);
    pendingMoves.put(request.getChangeId(), request);
    localPlayer.getClientEntity().send(request);

    return true;
  }