public static void askForName(Conversable whom, IPet pet, boolean admin) { new ConversationFactory(EchoPet.getPlugin()) .withModality(true) .withLocalEcho(false) .withPrefix(new NameConversationPrefix()) .withTimeout(90) .withFirstPrompt(new NamePrompt(pet, admin)) .withEscapeSequence("exit") .withEscapeSequence("quit") .buildConversation(whom).begin(); }
public static ConversationFactory buildBasicConversation() { return new ConversationFactory(HoloAPI.getCore()) .withModality(true) .withLocalEcho(false) .withPrefix(new InputConversationPrefix()) .withTimeout(90) .withEscapeSequence("exit"); }
public final void createGroup(Player player, String world) { GroupCreationWizard wizard = new GroupCreationWizard(player, world); Conversation conversation = new ConversationFactory(plugin).withFirstPrompt(wizard).withPrefix(new Prefix()) .withEscapeSequence("exit").addConversationAbandonedListener(wizard).buildConversation(player); conversation.begin(); }
private static ConversationFactory buildFactory() { return new ConversationFactory(SparkTrailPlugin.getInstance()) .withModality(true) .withLocalEcho(true) .withPrefix(new InputConversationPrefix()) .withTimeout(90) .withEscapeSequence("exit") .withEscapeSequence("quit"); }
public CheckerConvo(MondoChest plugin) { this.plugin = plugin; this.conversationFactory = new ConversationFactory(plugin) .withModality(false) .withPrefix(new ConvoPrefix()) .withFirstPrompt(new CheckerPrompt()) .withTimeout(60) .withEscapeSequence("/quit") .addConversationAbandonedListener(this); }
public AccessConvo(MondoChest plugin, MondoListener listener) { this.bankManager = plugin.getBankManager(); this.listener = listener; this.conversationFactory = new ConversationFactory(plugin) .withModality(false) .withPrefix(new ConvoPrefix()) .withFirstPrompt(new AccessPrompt()) .withTimeout(60) .withEscapeSequence("/quit") .addConversationAbandonedListener(this); }
@Override public void perform() { InvitePrompt prompt = new InvitePrompt(player, plugin); Conversation convo = new ConversationFactory(plugin) .withFirstPrompt(prompt) .withPrefix(new Prefix(plugin)) .buildConversation(player); convo.begin(); }
/** * Get default conversation. Your need to set the FirstPrompt before calling build * * @return the conversation factory */ public static ConversationFactory getDefaultConversation() { ConversationFactory factory; factory = new ConversationFactory(SkyApi.getSCB()).withModality(true).withPrefix(new CustomPrefix()).withEscapeSequence("/quit") .thatExcludesNonPlayersWithMessage("Only players can run this conversation").withLocalEcho(false).addConversationAbandonedListener(new ConAbandonedEvent()).withTimeout(60); return factory; }
public CmdUnexempt(final Plugin plugin, String[] callArgs, CommandType type) { super(plugin, callArgs, type); this.db = IPCheck.getInstance().getDatabaseController(); setName(getLocalString("CMD_UNEXEMPT")); setHelp(getLocalString("HELP_UNEXEMPT")); setSyntax("ipc unexempt <PLAYER | IP>"); setPermissions(new Permission[]{ new Permission("ipcheck.use"), new Permission("ipcheck.unexempt")}); setConversationFactory(new ConversationFactory(plugin)); }
public CmdExempt(final Plugin plugin, String[] callArgs, CommandType type) { super(plugin, callArgs, type); this.db = IPCheck.getInstance().getDatabaseController(); setName(getLocalString("CMD_EXEMPT")); setHelp(getLocalString("HELP_EXEMPT")); setSyntax("ipc exempt <PLAYER | IP>"); setPermissions(new Permission[]{ new Permission("ipcheck.use"), new Permission("ipcheck.exempt")}); setConversationFactory(new ConversationFactory(plugin)); }
public static ConversationFactory getConversationFactory() { return CONVERSATION_FACTORY; }
public ConversationFactory(Plugin plugin) { }
public ConversationFactory withModality(boolean modal) { return null; }
public ConversationFactory withLocalEcho(boolean localEchoEnabled) { return null; }
public ConversationFactory withPrefix(ConversationPrefix prefix) { return null; }
public ConversationFactory withTimeout(int timeoutSeconds) { return null; }
public ConversationFactory withFirstPrompt(Prompt firstPrompt) { return null; }
public ConversationFactory withInitialSessionData(Map<Object,Object> initialSessionData) { return null; }
public ConversationFactory withEscapeSequence(String escapeSequence) { return null; }
public ConversationFactory withConversationCanceller(ConversationCanceller canceller) { return null; }
public ConversationFactory thatExcludesNonPlayersWithMessage(String playerOnlyMessage) { return null; }
public ConversationFactory addConversationAbandonedListener(ConversationAbandonedListener listener) { return null; }
public Bank(World world, List<Location> coords, JavaPlugin plugin, String name, boolean toDB) throws MarkerNumberException, NotInTownException { super(world, coords, plugin); if(db == null) db = new DBBanksAccess(plugin); this.name = name; Location loc1 = coords.get(0), loc2 = coords.get(1); if(loc1.getBlockY() > loc2.getBlockY()) bankArea = getSelectiveArea(loc1, loc2, (loc2.getBlockY() - 10), (loc2.getBlockY() + 50)); else bankArea = getSelectiveArea(loc1, loc2, (loc1.getBlockY() - 10), (loc1.getBlockY() + 50)); // Town town = null; // for(Block b : bankArea) { // if(Town.getTownAtBlock(b) != null) { // town = Town.getTownAtBlock(b); // break; // } // } // //You can only make a Bank if it is COMPLETELY within a town. // if(town == null) throw new NotInTownException("bank"); // else if(!town.getTownArea().containsAll(bankArea)) throw new NotInTownException("bank"); // else this.town = town; //Find the tellers and initialize the conversation factory. employees = findTellers(); teller = new ConversationFactory(plugin); //This has the potential to be 0, in which case, the default is 3 blocks. tellerDiameter = plugin.getConfig().getInt("bank.teller.diameter"); if(tellerDiameter == 0) tellerDiameter = 2; //Create the areas where conversations can take place. initializeTellers(); checkingInterest = 3; loanInterest = 3; creditInterest = 3; //Register Events and add to Static Master-List Map add(); if(toDB) addToDB(coords); }
public ConversationFactory getTeller() { return teller; }
public void setTeller(ConversationFactory teller) { this.teller = teller; }
public ConversationFactory getConversationFactory(String string) { if (cfs.containsKey(string)) return cfs.get(string); return null; }