Fix parties mute bypass

This commit is contained in:
samczsun 2017-01-19 21:51:50 -05:00
parent 1ff05eb3ff
commit 66af3cc450

View File

@ -24,6 +24,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.menu.Menu; import mineplex.core.menu.Menu;
import mineplex.core.message.MessageManager;
import mineplex.core.party.command.PartyCommand; import mineplex.core.party.command.PartyCommand;
import mineplex.core.party.constants.PartyRemoveReason; import mineplex.core.party.constants.PartyRemoveReason;
import mineplex.core.party.manager.PartyInviteManager; import mineplex.core.party.manager.PartyInviteManager;
@ -60,6 +61,8 @@ public class PartyManager extends MiniPlugin
private final PartyInviteManager _inviteManager; private final PartyInviteManager _inviteManager;
private final PartyJoinManager _joinManager; private final PartyJoinManager _joinManager;
private final MessageManager _messageManager;
/** /**
* This local instance's name * This local instance's name
*/ */
@ -92,6 +95,7 @@ public class PartyManager extends MiniPlugin
_region = !new File("eu.dat").exists() ? Region.US : Region.EU; _region = !new File("eu.dat").exists() ? Region.US : Region.EU;
_messageManager = require(MessageManager.class);
} }
@Deprecated @Deprecated
@ -315,16 +319,19 @@ public class PartyManager extends MiniPlugin
if (!party.getOwnerName().equalsIgnoreCase(caller.getName())) if (!party.getOwnerName().equalsIgnoreCase(caller.getName()))
{ {
party.sendMessage(F.main("Party", F.elem(caller.getName()) + " has suggested " + F.elem(target) + " be invited")); if (!_messageManager.isMuted(caller))
party.getOwnerAsPlayer().ifPresent(owner ->
{ {
ChildJsonMessage message = new ChildJsonMessage("").extra(F.main("Party", "Click ")); party.sendMessage(F.main("Party", F.elem(caller.getName()) + " has suggested " + F.elem(target) + " be invited"));
message.add(F.link("Invite " + target)) party.getOwnerAsPlayer().ifPresent(owner ->
.hover(HoverEvent.SHOW_TEXT, C.cGreen + "Clicking this will invite " + C.cYellow + target + C.cGreen + " to the party") {
.click(ClickEvent.RUN_COMMAND, "/party gui invite " + target); ChildJsonMessage message = new ChildJsonMessage("").extra(F.main("Party", "Click "));
message.add(C.mBody + " to invite them"); message.add(F.link("Invite " + target))
message.sendToPlayer(owner); .hover(HoverEvent.SHOW_TEXT, C.cGreen + "Clicking this will invite " + C.cYellow + target + C.cGreen + " to the party")
}); .click(ClickEvent.RUN_COMMAND, "/party gui invite " + target);
message.add(C.mBody + " to invite them");
message.sendToPlayer(owner);
});
}
return; return;
} }
if (party.getMembers().size() >= party.getSize()) if (party.getMembers().size() >= party.getSize())