-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add expectPlayerChat, a way to expect for messages on the chat
- Loading branch information
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/br/com/finalcraft/evernifecore/util/FCChatUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package br.com.finalcraft.evernifecore.util; | ||
|
||
import br.com.finalcraft.evernifecore.chatmenuapi.listeners.CMListener; | ||
import br.com.finalcraft.evernifecore.chatmenuapi.listeners.expectedchat.ExpectedChat; | ||
import br.com.finalcraft.evernifecore.chatmenuapi.menu.ChatMenuAPI; | ||
import org.bukkit.entity.Player; | ||
|
||
public class FCChatUtil { | ||
|
||
/** | ||
* Expect a player's to chat a message. | ||
* | ||
* @param player The player to expect a chat from. | ||
* @param chatAction The action to perform when the player chats. | ||
*/ | ||
public static ExpectedChat expectPlayerChat(Player player, CMListener.IChatAction chatAction) { | ||
return ChatMenuAPI.getChatListener().expectPlayerChat(player, chatAction, 0, null, null); | ||
} | ||
|
||
/** | ||
* Expect a player's to chat a message. | ||
* | ||
* @param player The player to expect a chat from. | ||
* @param chatAction The action to perform when the player chats. | ||
* @param expiration The time in milliseconds the wait for the chat. | ||
*/ | ||
public static ExpectedChat expectPlayerChat(Player player, CMListener.IChatAction chatAction, long expiration) { | ||
return ChatMenuAPI.getChatListener().expectPlayerChat(player, chatAction, expiration, null, null); | ||
} | ||
|
||
/** | ||
* Expect a player's to chat a message. | ||
* | ||
* @param player The player to expect a chat from. | ||
* @param chatAction The action to perform when the player chats. | ||
* @param expiration The time in milliseconds the wait for the chat. | ||
* @param onExpireAction The action to perform when the chat expires. | ||
*/ | ||
public static ExpectedChat expectPlayerChat(Player player, CMListener.IChatAction chatAction, long expiration, Runnable onExpireAction) { | ||
return ChatMenuAPI.getChatListener().expectPlayerChat(player, chatAction, expiration, onExpireAction, null); | ||
} | ||
|
||
/** | ||
* Expect a player's to chat a message. | ||
* | ||
* @param player The player to expect a chat from. | ||
* @param chatAction The action to perform when the player chats. | ||
* @param expiration The time in milliseconds the wait for the chat. | ||
* @param onExpireAction The action to perform when the chat expires. | ||
* @param onPlayerQuitAction The action to perform when the player quits. | ||
*/ | ||
public static ExpectedChat expectPlayerChat(Player player, CMListener.IChatAction chatAction, long expiration, Runnable onExpireAction, Runnable onPlayerQuitAction) { | ||
return ChatMenuAPI.getChatListener().expectPlayerChat(player, chatAction, expiration, onExpireAction, onPlayerQuitAction); | ||
} | ||
|
||
} |