Package org.bukkit.conversations

Examples of org.bukkit.conversations.Conversation


        if(!(sender instanceof Player))
            throw new CommandException("Can only add CommandItems as a player!");
        if(((Player) sender).getInventory().getItemInHand() == null)
            throw new CommandException("Invalid Item for CommandItems!");
        Conversation convo = conversationFactory.buildConversation((Conversable) sender);
        convo.getContext().setSessionData("item", ((HumanEntity) sender).getInventory().getItemInHand());
        List<ItemStack> consumables = new ArrayList<ItemStack>();
        for(int i = 0; i <= 8; i++) {
            if(i == ((HumanEntity) sender).getInventory().getHeldItemSlot())
                continue;
            ItemStack stack = ((HumanEntity) sender).getInventory().getItem(i);
            if(!ItemUtil.isStackValid(stack))
                continue;
            consumables.add(stack);
        }
        convo.getContext().setSessionData("consumables", consumables);

        convo.begin();
    }
View Full Code Here


      AutoRefMatch m = plugin.getMatch(invited.getWorld());
      if (m != null && m.isPlayer(invited) && m.getCurrentState().inProgress()) continue;

      // otherwise, invite them
      if (invited.getWorld() != match.getWorld())
        new Conversation(plugin, invited, new InvitationPrompt(match, from)).begin();
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of org.bukkit.conversations.Conversation

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.