From b951493ea1a4dd0492214cfa476d6b08836b9a64 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Sun, 5 Jan 2014 11:55:45 +0100 Subject: [PATCH] MCore change and disable name change broadcasting per default --- src/com/massivecraft/factions/Factions.java | 6 +++--- src/com/massivecraft/factions/cmd/CmdFactionsName.java | 3 +++ src/com/massivecraft/factions/entity/UConf.java | 6 ++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index 7941291a..ce01cc1b 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -144,9 +144,9 @@ public class Factions extends MPlugin ); // Schedule recurring non-tps-dependent tasks - TaskPlayerPowerUpdate.get().schedule(this); - TaskPlayerDataRemove.get().schedule(this); - TaskEconLandReward.get().schedule(this); + TaskPlayerPowerUpdate.get().activate(this); + TaskPlayerDataRemove.get().activate(this); + TaskEconLandReward.get().activate(this); // Register built in chat modifiers ChatModifierLc.get().register(); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsName.java b/src/com/massivecraft/factions/cmd/CmdFactionsName.java index 55dee0d1..f0708a8f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsName.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsName.java @@ -10,6 +10,7 @@ import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.FactionColls; +import com.massivecraft.factions.entity.UConf; import com.massivecraft.factions.event.FactionsEventNameChange; import com.massivecraft.factions.util.MiscUtil; import com.massivecraft.mcore.cmd.req.ReqHasPerm; @@ -74,6 +75,8 @@ public class CmdFactionsName extends FCommand // Inform usenderFaction.msg("%s changed your faction name to %s", usender.describeTo(usenderFaction, true), usenderFaction.getName(usenderFaction)); + + if (!UConf.get(usender).broadcastNameChange) return; for (Faction faction : FactionColls.get().get(usenderFaction).getAll()) { if (faction == usenderFaction) diff --git a/src/com/massivecraft/factions/entity/UConf.java b/src/com/massivecraft/factions/entity/UConf.java index de9dfa07..37119e41 100644 --- a/src/com/massivecraft/factions/entity/UConf.java +++ b/src/com/massivecraft/factions/entity/UConf.java @@ -83,6 +83,12 @@ public class UConf extends Entity public Map defaultFactionFlags = FFlag.getDefaultDefaults(); public Map> defaultFactionPerms = FPerm.getDefaultDefaults(); + // -------------------------------------------- // + // MESSAGES + // -------------------------------------------- // + + public boolean broadcastNameChange = false; + // -------------------------------------------- // // POWER // -------------------------------------------- //