mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 10:39:05 +00:00
Removed @[player] messaging feature
Rarely used by players and adds complexity
This commit is contained in:
parent
1841cadcd2
commit
d70515ffe3
@ -236,162 +236,6 @@ public class ChatListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if(chat.startsWith("@")) {
|
||||
for(MineverseChatPlayer p : MineverseChat.onlinePlayers) {
|
||||
if(p.isOnline() && chat.startsWith("@" + p.getPlayer().getDisplayName().replace("§r", "") + " ")) {
|
||||
int add = 0;
|
||||
if(p.getPlayer().getDisplayName().contains("§r")) add = 2;
|
||||
String messageFormat = chat.substring(p.getPlayer().getDisplayName().length() + 1 - add);
|
||||
if(chat.length() <= p.getPlayer().getDisplayName().length() + 1 - add) {
|
||||
mcp.getPlayer().sendMessage(ChatColor.RED + "You must include a message.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if(!mcp.getPlayer().canSee(p.getPlayer())) {
|
||||
break;
|
||||
}
|
||||
if(p.getIgnores().contains(mcp.getUUID())) {
|
||||
mcp.getPlayer().sendMessage(ChatColor.GOLD + p.getName() + " is currently ignoring your messages.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if(!p.getMessageToggle()) {
|
||||
mcp.getPlayer().sendMessage(ChatColor.GOLD + p.getName() + " is currently blocking messages.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
String echo = "";
|
||||
String send = "";
|
||||
String spy = "";
|
||||
if(p.isAFK()) {
|
||||
mcp.getPlayer().sendMessage(ChatColor.GOLD + p.getPlayer().getDisplayName() + " is currently afk and might be unable to chat at this time.");
|
||||
}
|
||||
if(mcp.hasFilter()) {
|
||||
messageFormat = cc.FilterChat(messageFormat);
|
||||
}
|
||||
if(mcp.getPlayer().hasPermission("venturechat.color")) {
|
||||
messageFormat = Format.FormatStringColor(messageFormat);
|
||||
}
|
||||
if(mcp.getPlayer().hasPermission("venturechat.format")) {
|
||||
messageFormat = Format.FormatString(messageFormat);
|
||||
}
|
||||
if(plugin.getConfig().getString("tellformatto").equalsIgnoreCase("Default")) {
|
||||
echo = "You message " + p.getPlayer().getDisplayName() + ":" + ChatColor.valueOf(cc.tellColor.toUpperCase()) + messageFormat;
|
||||
}
|
||||
else {
|
||||
echo = Format.FormatStringAll(plugin.getConfig().getString("tellformatto").replace("{playerto}", p.getPlayer().getDisplayName()).replace("{playerfrom}", mcp.getPlayer().getDisplayName())) + messageFormat;
|
||||
}
|
||||
if(plugin.getConfig().getString("tellformatfrom").equalsIgnoreCase("Default")) {
|
||||
send = mcp.getPlayer().getDisplayName() + " messages you:" + ChatColor.valueOf(cc.tellColor.toUpperCase()) + messageFormat;
|
||||
}
|
||||
else {
|
||||
send = Format.FormatStringAll(plugin.getConfig().getString("tellformatfrom").replace("{playerto}", p.getPlayer().getDisplayName()).replace("{playerfrom}", mcp.getPlayer().getDisplayName())) + messageFormat;
|
||||
}
|
||||
if(plugin.getConfig().getString("tellformatspy").equalsIgnoreCase("Default")) {
|
||||
spy = p.getName() + " messages " + p.getName() + ":" + ChatColor.valueOf(cc.tellColor.toUpperCase()) + messageFormat;
|
||||
}
|
||||
else {
|
||||
spy = Format.FormatStringAll(plugin.getConfig().getString("tellformatspy").replace("{playerto}", p.getName()).replace("{playerfrom}", mcp.getName())) + messageFormat;
|
||||
}
|
||||
for(MineverseChatPlayer sp : MineverseChat.onlinePlayers) {
|
||||
if(sp.isSpy()) {
|
||||
sp.getPlayer().sendMessage(spy);
|
||||
}
|
||||
}
|
||||
p.getPlayer().sendMessage(send);
|
||||
mcp.getPlayer().sendMessage(echo);
|
||||
if(p.hasNotifications()) {
|
||||
if(VersionHandler.is1_8() || VersionHandler.is1_7_10() || VersionHandler.is1_7_2() || VersionHandler.is1_7_9()) {
|
||||
p.getPlayer().playSound(p.getPlayer().getLocation(), Sound.valueOf("LEVEL_UP"), 1, 0);
|
||||
}
|
||||
else {
|
||||
p.getPlayer().playSound(p.getPlayer().getLocation(), Sound.valueOf("ENTITY_PLAYER_LEVELUP"), 1, 0);
|
||||
}
|
||||
p.getPlayer().playSound(p.getPlayer().getLocation(), Sound.valueOf("ENTITY_PLAYER_LEVELUP"), 1, 0);
|
||||
}
|
||||
p.setReplyPlayer(mcp.getUUID());
|
||||
mcp.setReplyPlayer(p.getUUID());
|
||||
Bukkit.getConsoleSender().sendMessage(mcp.getName() + " messages " + p.getName() + ":" + ChatColor.valueOf(cc.tellColor.toUpperCase()) + messageFormat);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if(chat.startsWith("@" + p.getName() + " ")) {
|
||||
String messageFormat = chat.substring(p.getName().length() + 1);
|
||||
if(chat.length() <= p.getName().length() + 1) {
|
||||
mcp.getPlayer().sendMessage(ChatColor.RED + "You must include a message.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if(!mcp.getPlayer().canSee(p.getPlayer())) {
|
||||
break;
|
||||
}
|
||||
if(p.getIgnores().contains(mcp.getUUID())) {
|
||||
mcp.getPlayer().sendMessage(ChatColor.GOLD + p.getName() + " is currently ignoring your messages.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if(!p.getMessageToggle()) {
|
||||
mcp.getPlayer().sendMessage(ChatColor.GOLD + p.getName() + " is currently blocking messages.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
String echo = "";
|
||||
String send = "";
|
||||
String spy = "";
|
||||
if(p.isAFK()) {
|
||||
mcp.getPlayer().sendMessage(ChatColor.GOLD + p.getPlayer().getDisplayName() + " is currently afk and might be unable to chat at this time.");
|
||||
}
|
||||
if(mcp.hasFilter()) {
|
||||
messageFormat = cc.FilterChat(messageFormat);
|
||||
}
|
||||
if(mcp.getPlayer().hasPermission("venturechat.color")) {
|
||||
messageFormat = Format.FormatStringColor(messageFormat);
|
||||
}
|
||||
if(mcp.getPlayer().hasPermission("venturechat.format")) {
|
||||
messageFormat = Format.FormatString(messageFormat);
|
||||
}
|
||||
if(plugin.getConfig().getString("tellformatto").equalsIgnoreCase("Default")) {
|
||||
echo = "You message " + p.getNickname() + ":" + ChatColor.valueOf(cc.tellColor.toUpperCase()) + messageFormat;
|
||||
}
|
||||
else {
|
||||
echo = Format.FormatStringAll(plugin.getConfig().getString("tellformatto").replace("{playerto}", p.getPlayer().getDisplayName()).replace("{playerfrom}", mcp.getPlayer().getDisplayName())) + messageFormat;
|
||||
}
|
||||
if(plugin.getConfig().getString("tellformatfrom").equalsIgnoreCase("Default")) {
|
||||
send = mcp.getNickname() + " messages you:" + ChatColor.valueOf(cc.tellColor.toUpperCase()) + messageFormat;
|
||||
}
|
||||
else {
|
||||
send = Format.FormatStringAll(plugin.getConfig().getString("tellformatfrom").replace("{playerto}", p.getPlayer().getDisplayName()).replace("{playerfrom}", mcp.getPlayer().getDisplayName())) + messageFormat;
|
||||
}
|
||||
if(plugin.getConfig().getString("tellformatspy").equalsIgnoreCase("Default")) {
|
||||
spy = mcp.getName() + " messages " + p.getName() + ":" + ChatColor.valueOf(cc.tellColor.toUpperCase()) + messageFormat;
|
||||
}
|
||||
else {
|
||||
spy = Format.FormatStringAll(plugin.getConfig().getString("tellformatspy").replace("{playerto}", p.getName()).replace("{playerfrom}", mcp.getName())) + messageFormat;
|
||||
}
|
||||
for(MineverseChatPlayer sp : MineverseChat.onlinePlayers) {
|
||||
if(sp.isSpy()) {
|
||||
sp.getPlayer().sendMessage(spy);
|
||||
}
|
||||
}
|
||||
p.getPlayer().sendMessage(send);
|
||||
mcp.getPlayer().sendMessage(echo);
|
||||
if(p.hasNotifications()) {
|
||||
if(VersionHandler.is1_8()) {
|
||||
p.getPlayer().playSound(p.getPlayer().getLocation(), Sound.valueOf("LEVEL_UP"), 1, 0);
|
||||
}
|
||||
if(VersionHandler.is1_9()) {
|
||||
p.getPlayer().playSound(p.getPlayer().getLocation(), Sound.valueOf("ENTITY_PLAYER_LEVELUP"), 1, 0);
|
||||
}
|
||||
}
|
||||
p.setReplyPlayer(mcp.getUUID());
|
||||
mcp.setReplyPlayer(p.getUUID());
|
||||
Bukkit.getConsoleSender().sendMessage(mcp.getName() + " messages " + p.getName() + ":" + ChatColor.valueOf(cc.tellColor.toUpperCase()) + messageFormat);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Location locreceip;
|
||||
Location locsender = mcp.getPlayer().getLocation();
|
||||
Location diff;
|
||||
|
Loading…
x
Reference in New Issue
Block a user