mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Expand ChatAPI
This commit is contained in:
parent
16a4b78580
commit
3cf01cb6f3
@ -22,6 +22,7 @@ Version 1.4.04-dev
|
|||||||
! Changed config node name for the skill experience modifiers from "Experience.Formula.Multiplier.[Skill]" to "Experience.Formula.Modifier.[Skill]"
|
! Changed config node name for the skill experience modifiers from "Experience.Formula.Multiplier.[Skill]" to "Experience.Formula.Modifier.[Skill]"
|
||||||
! Updated localization files
|
! Updated localization files
|
||||||
! mcMMO abilities can no longer be activated while in Creative mode
|
! mcMMO abilities can no longer be activated while in Creative mode
|
||||||
|
! Expanded ChatAPI to allow toggling of chat states for users
|
||||||
- Removed deprecated functions from API classes.
|
- Removed deprecated functions from API classes.
|
||||||
- Removed functions for getting the PlayerProfile - using API classes is preferred, but if not the McMMOPlayer should be used instead
|
- Removed functions for getting the PlayerProfile - using API classes is preferred, but if not the McMMOPlayer should be used instead
|
||||||
- Removed Ender Dragon, Wither, and Witch from granting combat experience and related configuration options
|
- Removed Ender Dragon, Wither, and Witch from granting combat experience and related configuration options
|
||||||
|
@ -105,4 +105,40 @@ public final class ChatAPI {
|
|||||||
public static boolean isUsingAdminChat(String playerName) {
|
public static boolean isUsingAdminChat(String playerName) {
|
||||||
return UserManager.getPlayer(playerName).getAdminChatMode();
|
return UserManager.getPlayer(playerName).getAdminChatMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle the party chat mode of a player.
|
||||||
|
*
|
||||||
|
* @param player The player to toggle party chat on.
|
||||||
|
*/
|
||||||
|
public static void togglePartyChat(Player player) {
|
||||||
|
togglePartyChat(player.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle the party chat mode of a player.
|
||||||
|
*
|
||||||
|
* @param playerName The name of the player to toggle party chat on.
|
||||||
|
*/
|
||||||
|
public static void togglePartyChat(String playerName) {
|
||||||
|
UserManager.getPlayer(playerName).setPartyChat(!isUsingPartyChat(playerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle the admin chat mode of a player.
|
||||||
|
*
|
||||||
|
* @param player The player to toggle admin chat on.
|
||||||
|
*/
|
||||||
|
public static void toggleAdminChat(Player player) {
|
||||||
|
toggleAdminChat(player.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle the admin chat mode of a player.
|
||||||
|
*
|
||||||
|
* @param playerName The name of the player to toggle party chat on.
|
||||||
|
*/
|
||||||
|
public static void toggleAdminChat(String playerName){
|
||||||
|
UserManager.getPlayer(playerName).setAdminChat(!isUsingAdminChat(playerName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user