-Removed 4 sendMessage functions that can already be done with Minecraft formatted codes.
This commit is contained in:
Luis C.M committed 2022-06-28 01:23:42 -05:00
1 parent 37e12b81d0
commit 0aa9303f61
2 files changed
+14 -42

No files matched your search

@@ -241,56 +241,34 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
PlayerData data = PlayerDataController.instance.getPlayerData(player);
return data.factionData.getFactionPoints(faction);
}
/**
* @param message The message you want to send
*/
public void sendMessage(String message){
player.addChatMessage(new ChatComponentTranslation(NoppesStringUtils.formatText(message,player)));
}
/**
* @param message The message you want to send
*/
public void sendMessage(String message, EnumChatFormatting color, boolean bold, boolean italic, boolean underlined) {
ChatComponentTranslation chat = new ChatComponentTranslation(NoppesStringUtils.formatText(message,player));
ChatStyle style = new ChatStyle();
style.setColor(color);
style.setBold(bold);
style.setItalic(italic);
style.setUnderlined(underlined);
chat.setChatStyle(style);
player.addChatMessage(chat);
public void sendMessage(String message, String color, boolean bold, boolean italic, boolean underlined) {
sendMessage(message, color, bold, italic, underlined, false, false);
}
public void sendMessage(String message, String color, boolean bold, boolean italic, boolean obfuscated, boolean strikethrough, boolean underlined) {
EnumChatFormatting c = getColor(color);
if (c == null)
return;
/**
* @param message The message you want to send
*/
public void sendMessage(String message, EnumChatFormatting color, boolean bold, boolean italic, boolean obfuscated, boolean strikethrough, boolean underlined) {
ChatComponentTranslation chat = new ChatComponentTranslation(NoppesStringUtils.formatText(message,player));
ChatStyle style = new ChatStyle();
style.setColor(color);
style.setColor(c);
style.setBold(bold);
style.setItalic(italic);
style.setObfuscated(obfuscated);
style.setStrikethrough(strikethrough);
style.setUnderlined(underlined);
chat.setChatStyle(style);
player.addChatMessage(chat);
}
public void sendMessage(String message, String color, boolean bold, boolean italic, boolean underlined) {
EnumChatFormatting c = getColor(color);
if (c == null) return;
sendMessage(message, c, bold, italic, underlined);
}
public void sendMessage(String message, String color, boolean bold, boolean italic, boolean obfuscated, boolean strikethrough, boolean underlined) {
EnumChatFormatting c = getColor(color);
if (c == null) return;
sendMessage(message, c, bold, italic, obfuscated, strikethrough, underlined);
}
private EnumChatFormatting getColor(String color) {
switch (color) {
case "black": return EnumChatFormatting.BLACK;
@@ -93,18 +93,12 @@ public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>
int getFactionPoints(int faction);
/**
* @param message The message you want to send
* @param message The message you want to send. Compatible with formatting codes, which can be found on the attached link.
* @see <a href="https://static.wikia.nocookie.net/minecraft_gamepedia/images/7/7e/Minecraft_Formatting.gif/revision/latest/scale-to-width-down/200?cb=20200828001454">Minecraft formatting codes</a>
*
*/
void sendMessage(String message);
void sendMessage(String message, EnumChatFormatting color, boolean bold, boolean italic, boolean underlined);
void sendMessage(String message, EnumChatFormatting color, boolean bold, boolean italic, boolean obfuscated, boolean strikethrough, boolean underlined);
void sendMessage(String message, String color, boolean bold, boolean italic, boolean underlined);
void sendMessage(String message, String color, boolean bold, boolean italic, boolean obfuscated, boolean strikethrough, boolean underlined);
/**
* @return Return gamemode. 0: Survival, 1: Creative, 2: Adventure
*/