Пример #1
0
 @Override
 public void handle(
     Player player,
     Inventory inventoryOne,
     Inventory inventoryTwo,
     SlottedItem itemOne,
     SlottedItem itemTwo) {
   if (inventoryOne != player.getInventory() || inventoryTwo != player.getInventory()) {
     return;
   }
   if (!recipe.getRequirements().hasRequirementsDisplayOne(player)) {
     return;
   }
   SlottedItem secondary = itemOne.getItem().getId() == PESTLE_AND_MORTAR ? itemTwo : itemOne;
   if (player.getInventory().getAmount(secondary.getItem().getId()) < 2) {
     player.startAction(new HerbloreAction(player, recipe, 1));
     return;
   }
   player.send(new InterfaceItemMessage(309, 2, 200, recipe.getProduct()));
   player.setInterfaceText(
       309, 6, "<br><br><br><br><br>" + ItemDefinitions.forId(recipe.getProduct()).getName());
   player.getInterfaceSet().openChatbox(309);
   player
       .getInterfaceSet()
       .getChatbox()
       .setListener(new HerbloreInterfaceListener(player, recipe));
 }
Пример #2
0
 @Override
 public void handle(Player player, Player selectedPlayer) {
   player.startAction(new TradeRequestAction(player, selectedPlayer));
 }