diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java index dbeabad7..8f035d97 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/EventBlocker.java @@ -36,6 +36,7 @@ import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.FireworkExplodeEvent; +import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.ItemStack; @@ -233,4 +234,10 @@ public class EventBlocker extends FreedomService event.setCancelled(true); } } + + @EventHandler(priority = EventPriority.NORMAL) + public void onPlayerDeath(PlayerDeathEvent event) + { + event.setDeathMessage(event.getDeathMessage()); + } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tabcolor.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tabcolor.java deleted file mode 100644 index ae56f860..00000000 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tabcolor.java +++ /dev/null @@ -1,65 +0,0 @@ -package me.totalfreedom.totalfreedommod.command; - -import java.util.Iterator; -import java.util.Map; -import me.totalfreedom.totalfreedommod.rank.Rank; -import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang.StringUtils; -import org.bukkit.ChatColor; -import org.bukkit.command.Command; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_IN_GAME) -@CommandParameters(description = "Change your tab color", usage = "/ ") -public class Command_tabcolor extends FreedomCommand -{ - - @Override - public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) - { - - if (!FUtil.isExecutive(sender.getName())) - { - return noPerms(); - } - - if (args.length != 1) - { - return false; - } - - if ("list".equalsIgnoreCase(args[0])) - { - msg("Colors: " + StringUtils.join(FUtil.CHAT_COLOR_NAMES.keySet(), ", ")); - return true; - } - - final String needle = args[0].trim().toLowerCase(); - ChatColor color = null; - final Iterator> it = FUtil.CHAT_COLOR_NAMES.entrySet().iterator(); - while (it.hasNext()) - { - final Map.Entry entry = it.next(); - if (entry.getKey().contains(needle)) - { - color = entry.getValue(); - break; - } - } - - if (color == null) - { - msg("Invalid color: " + needle + " - Use \"/tabcolor list\" to list colors."); - return true; - } - - playerSender.setPlayerListName(StringUtils.substring(color + sender.getName(), 0, 16)); - - final String newTabColor = color + ChatColor.stripColor(playerSender.getDisplayName()).trim() + ChatColor.WHITE; - - msg("Your tab name will now appear as: " + newTabColor); - - return true; - } -} diff --git a/src/main/java/me/totalfreedom/totalfreedommod/discord/DiscordToMinecraftListener.java b/src/main/java/me/totalfreedom/totalfreedommod/discord/DiscordToMinecraftListener.java index d9ac140b..aa4ac771 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/discord/DiscordToMinecraftListener.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/discord/DiscordToMinecraftListener.java @@ -26,7 +26,7 @@ public class DiscordToMinecraftListener extends ListenerAdapter { message += " " + tag; } - message += " " + ChatColor.RED + member.getEffectiveName() + ChatColor.DARK_GRAY + ": " + ChatColor.RESET + event.getMessage().getContentRaw(); + message += " " + ChatColor.RED + ChatColor.stripColor(member.getEffectiveName()) + ChatColor.DARK_GRAY + ": " + ChatColor.RESET + ChatColor.stripColor(event.getMessage().getContentDisplay()); FUtil.bcastMsg(message); } }