Silence the create and disband actions. The general public need not know. It will just be spammy.

This commit is contained in:
Olof Larsson 2014-09-18 14:37:30 +02:00
parent b65d76f4e9
commit 9503baff6e
2 changed files with 12 additions and 19 deletions

View File

@ -6,11 +6,9 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm; import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqHasntFaction; import com.massivecraft.factions.cmd.req.ReqHasntFaction;
import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPlayerColl;
import com.massivecraft.factions.event.EventFactionsCreate; import com.massivecraft.factions.event.EventFactionsCreate;
import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
@ -80,13 +78,10 @@ public class CmdFactionsCreate extends FactionsCommand
// NOTE: join event cannot be cancelled or you'll have an empty faction // NOTE: join event cannot be cancelled or you'll have an empty faction
// Inform // Inform
for (MPlayer follower : MPlayerColl.get().getAllOnline()) msg("<i>You created the faction %s", faction.getName(msender));
{
follower.msg("%s<i> created a new faction %s", msender.describeTo(follower, true), faction.getName(follower));
}
msg("<i>You should now: %s", Factions.get().getOuterCmdFactions().cmdFactionsDescription.getUseageTemplate()); msg("<i>You should now: %s", Factions.get().getOuterCmdFactions().cmdFactionsDescription.getUseageTemplate());
// Log
if (MConf.get().logFactionCreate) if (MConf.get().logFactionCreate)
{ {
Factions.get().log(msender.getName()+" created a new faction: "+newName); Factions.get().log(msender.getName()+" created a new faction: "+newName);

View File

@ -5,7 +5,6 @@ import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPlayerColl;
import com.massivecraft.factions.event.EventFactionsDisband; import com.massivecraft.factions.event.EventFactionsDisband;
import com.massivecraft.factions.event.EventFactionsMembershipChange; import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
@ -70,25 +69,24 @@ public class CmdFactionsDisband extends FactionsCommand
membershipChangeEvent.run(); membershipChangeEvent.run();
} }
// Inform all players // Inform
for (MPlayer mplayer : MPlayerColl.get().getAllOnline()) for (MPlayer mplayer : faction.getMPlayersWhereOnline(true))
{ {
String who = msender.describeTo(mplayer); mplayer.msg("<h>%s<i> disbanded your faction.", msender.describeTo(mplayer));
if (mplayer.getFaction() == faction)
{
mplayer.msg("<h>%s<i> disbanded your faction.", who);
}
else
{
mplayer.msg("<h>%s<i> disbanded the faction %s.", who, faction.getName(mplayer));
}
} }
if (msenderFaction != faction)
{
msender.msg("<i>You disbanded <h>%s<i>." , faction.describeTo(msender));
}
// Log
if (MConf.get().logFactionDisband) if (MConf.get().logFactionDisband)
{ {
Factions.get().log(Txt.parse("<i>The faction <h>%s <i>(<h>%s<i>) was disbanded by <h>%s<i>.", faction.getName(), faction.getId(), msender.getDisplayName(IdUtil.getConsole()))); Factions.get().log(Txt.parse("<i>The faction <h>%s <i>(<h>%s<i>) was disbanded by <h>%s<i>.", faction.getName(), faction.getId(), msender.getDisplayName(IdUtil.getConsole())));
} }
// Apply
faction.detach(); faction.detach();
} }