This commit is contained in:
Aust1n46 2018-01-19 21:01:47 -05:00
parent db901ffd6f
commit 7487cb0aad
7 changed files with 29 additions and 7 deletions

View File

@ -1,4 +1,4 @@
name: VentureChat
main: mineverse.Aust1n46.chat.bungee.MineverseChatBungee
version: 2.12.2
version: 2.12.3
author: Aust1n46

View File

@ -51,6 +51,7 @@ import mineverse.Aust1n46.chat.channel.ChatChannelInfo;
import mineverse.Aust1n46.chat.command.MineverseCommand;
import mineverse.Aust1n46.chat.command.MineverseCommandExecutor;
import mineverse.Aust1n46.chat.command.chat.Broadcast;
import mineverse.Aust1n46.chat.command.chat.BungeeToggle;
import mineverse.Aust1n46.chat.command.chat.Buttons;
import mineverse.Aust1n46.chat.command.chat.Channel;
import mineverse.Aust1n46.chat.command.chat.Channelinfo;
@ -276,7 +277,8 @@ public class MineverseChat extends JavaPlugin implements PluginMessageListener {
boolean rangedSpy = PlayerData.getPlayerData().getConfigurationSection("players." + uuidString).getBoolean("rangedspy", false);
boolean buttons = PlayerData.getPlayerData().getConfigurationSection("players." + uuidString).getBoolean("buttons", true);
boolean messageToggle = PlayerData.getPlayerData().getConfigurationSection("players." + uuidString).getBoolean("messagetoggle", true);
players.add(new MineverseChatPlayer(uuid, name, currentChannel, ignores, listening, mutes, blockedCommands, mail, host, party, filter, notifications, nickname, jsonFormat, spy, commandSpy, rangedSpy, buttons, messageToggle));
boolean bungeeToggle = PlayerData.getPlayerData().getConfigurationSection("players." + uuidString).getBoolean("bungeetoggle", true);
players.add(new MineverseChatPlayer(uuid, name, currentChannel, ignores, listening, mutes, blockedCommands, mail, host, party, filter, notifications, nickname, jsonFormat, spy, commandSpy, rangedSpy, buttons, messageToggle, bungeeToggle));
}
}
else {
@ -382,6 +384,7 @@ public class MineverseChat extends JavaPlugin implements PluginMessageListener {
commands.put("unmuteall", new Unmuteall("unmuteall"));
commands.put("venturechatgui", new VentureChatGui("venturechatgui"));
commands.put("messagetoggle", new MessageToggle("messagetoggle"));
commands.put("bungeetoggle", new BungeeToggle("bungeetoggle"));
commandExecutor = new MineverseCommandExecutor(commands);
for(String command : commands.keySet()) {
this.getCommand(command).setExecutor(commandExecutor);
@ -797,6 +800,9 @@ public class MineverseChat extends JavaPlugin implements PluginMessageListener {
for(MineverseChatPlayer p : MineverseChat.onlinePlayers) {
//System.out.println(p.getName() + " received chat message");
if(p.isOnline() && p.getListening().contains(ccInfo.getChannelInfo(chatchannel).getName())) {
if(!p.getBungeeToggle() && MineverseChatAPI.getOnlineMineverseChatPlayer(playerName) == null) {
continue;
}
if(plugin.getConfig().getBoolean("ignorechat", false)) {
// System.out.println(p.getIgnores());
if(sender == null) {
@ -1002,7 +1008,7 @@ public class MineverseChat extends JavaPlugin implements PluginMessageListener {
Set<String> blockedCommands = new HashSet<String>();
List<String> mail = new ArrayList<String>();
String jsonFormat = "Default";
s = new MineverseChatPlayer(uuid, name, current, ignores, listening, mutes, blockedCommands, mail, false, null, true, true, name, jsonFormat, false, false, false, true, true);
s = new MineverseChatPlayer(uuid, name, current, ignores, listening, mutes, blockedCommands, mail, false, null, true, true, name, jsonFormat, false, false, false, true, true, true);
MineverseChat.players.add(s);
}
p.getPlayer().sendMessage(msg.replace("{playerfrom}", sName).replace("{playerto}", Format.FormatStringAll(p.getNickname())));

View File

@ -50,8 +50,9 @@ public class MineverseChatPlayer {
private boolean rangedSpy;
private boolean buttons;
private boolean messageToggle;
private boolean bungeeToggle;
public MineverseChatPlayer(UUID uuid, String name, ChatChannel currentChannel, Set<UUID> ignores, Set<String> listening, HashMap<String, Integer> mutes, Set<String> blockedCommands, List<String> mail, boolean host, UUID party, boolean filter, boolean notifications, String nickname, String jsonFormat, boolean spy, boolean commandSpy, boolean rangedSpy, boolean buttons, boolean messageToggle) {
public MineverseChatPlayer(UUID uuid, String name, ChatChannel currentChannel, Set<UUID> ignores, Set<String> listening, HashMap<String, Integer> mutes, Set<String> blockedCommands, List<String> mail, boolean host, UUID party, boolean filter, boolean notifications, String nickname, String jsonFormat, boolean spy, boolean commandSpy, boolean rangedSpy, boolean buttons, boolean messageToggle, boolean bungeeToggle) {
this.uuid = uuid;
this.name = name;
this.currentChannel = currentChannel;
@ -84,6 +85,15 @@ public class MineverseChatPlayer {
this.cooldowns = new HashMap<ChatChannel, Integer>();
this.spam = new HashMap<ChatChannel, List<Integer>>();
this.messageToggle = messageToggle;
this.bungeeToggle = bungeeToggle;
}
public boolean getBungeeToggle() {
return this.bungeeToggle;
}
public void setBungeeToggle(boolean bungeeToggle) {
this.bungeeToggle = bungeeToggle;
}
public boolean getMessageToggle() {

View File

@ -66,7 +66,7 @@ public class VentureChatGui extends MineverseCommand {
Set<String> blockedCommands = new HashSet<String>();
List<String> mail = new ArrayList<String>();
String jsonFormat = "Default";
target = new MineverseChatPlayer(uuid, name, current, ignores, listening, mutes, blockedCommands, mail, false, null, true, true, name, jsonFormat, false, false, false, true, true);
target = new MineverseChatPlayer(uuid, name, current, ignores, listening, mutes, blockedCommands, mail, false, null, true, true, name, jsonFormat, false, false, false, true, true, true);
MineverseChat.players.add(target);
}
if(MineverseChat.ccInfo.isChannel(args[1])) {

View File

@ -109,6 +109,7 @@ public class PlayerData {
cs.set("rangedspy", p.getRangedSpy());
cs.set("buttons", p.getButtons());
cs.set("messagetoggle", p.getMessageToggle());
cs.set("bungeetoggle", p.getBungeeToggle());
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MMM/dd HH:mm:ss");
String dateNow = formatter.format(currentDate.getTime());

View File

@ -77,7 +77,7 @@ public class LoginListener implements Listener {
Set<String> blockedCommands = new HashSet<String>();
List<String> mail = new ArrayList<String>();
String jsonFormat = "Default";
mcp = new MineverseChatPlayer(uuid, name, current, ignores, listening, mutes, blockedCommands, mail, false, null, true, true, name, jsonFormat, false, false, false, true, true);
mcp = new MineverseChatPlayer(uuid, name, current, ignores, listening, mutes, blockedCommands, mail, false, null, true, true, name, jsonFormat, false, false, false, true, true, true);
MineverseChat.players.add(mcp);
}
mcp.setOnline(true);

View File

@ -1,5 +1,5 @@
name: VentureChat
version: 2.12.2
version: 2.12.3
main: mineverse.Aust1n46.chat.MineverseChat
depend: [Vault, ProtocolLib, PlaceholderAPI]
softdepend: [Towny, Factions, Heroes]
@ -224,4 +224,9 @@ commands:
usage: /<command>
aliases: [mtoggle,vmessagetoggle]
description: Toggle receiving messages
permission-message: You don't have <permission>
bungeetoggle:
usage: /<command>
aliases: [btoggle,vbungeetoggle]
description: Toggle receiving BungeeCord chat
permission-message: You don't have <permission>