mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-23 18:55:25 +01:00
add API to ignore alliance chat
This commit is contained in:
parent
d88332c06a
commit
4484eae5b8
@ -66,6 +66,10 @@ public interface FPlayer extends EconomyParticipator {
|
|||||||
|
|
||||||
public ChatMode getChatMode();
|
public ChatMode getChatMode();
|
||||||
|
|
||||||
|
public void setIgnoreAllianceChat(boolean ignore);
|
||||||
|
|
||||||
|
public boolean isIgnoreAllianceChat();
|
||||||
|
|
||||||
public void setSpyingChat(boolean chatSpying);
|
public void setSpyingChat(boolean chatSpying);
|
||||||
|
|
||||||
public boolean isSpyingChat();
|
public boolean isSpyingChat();
|
||||||
|
@ -58,7 +58,7 @@ public class FactionsChatListener implements Listener {
|
|||||||
|
|
||||||
//Send to all our allies
|
//Send to all our allies
|
||||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||||
if (myFaction.getRelationTo(fplayer) == Relation.ALLY) {
|
if (myFaction.getRelationTo(fplayer) == Relation.ALLY && !fplayer.isIgnoreAllianceChat()) {
|
||||||
fplayer.sendMessage(message);
|
fplayer.sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,9 @@ public abstract class MemoryFPlayer implements FPlayer {
|
|||||||
// FIELD: chatMode
|
// FIELD: chatMode
|
||||||
protected ChatMode chatMode;
|
protected ChatMode chatMode;
|
||||||
|
|
||||||
|
// FIELD: ignoreAllianceChat
|
||||||
|
protected boolean ignoreAllianceChat = false;
|
||||||
|
|
||||||
protected String id;
|
protected String id;
|
||||||
protected String name;
|
protected String name;
|
||||||
|
|
||||||
@ -199,6 +202,14 @@ public abstract class MemoryFPlayer implements FPlayer {
|
|||||||
return chatMode;
|
return chatMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setIgnoreAllianceChat(boolean ignore) {
|
||||||
|
this.ignoreAllianceChat = ignore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isIgnoreAllianceChat() {
|
||||||
|
return ignoreAllianceChat;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSpyingChat(boolean chatSpying) {
|
public void setSpyingChat(boolean chatSpying) {
|
||||||
this.spyingChat = chatSpying;
|
this.spyingChat = chatSpying;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user