mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-17 21:06:11 +00:00
bru
This commit is contained in:
parent
5cfb525a1f
commit
9de3388525
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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 = "/<command> <color>")
|
||||
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<Map.Entry<String, ChatColor>> it = FUtil.CHAT_COLOR_NAMES.entrySet().iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
final Map.Entry<String, ChatColor> 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;
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user