Added Spout features, with Spout client required for all: relation-colored faction tags over players' heads via option "spoutFactionTagsOverNames", player's faction title over their head via option "spoutFactionTitlesOverNames", and relation-colored capes shown on faction admins and/or moderators via "spoutFactionAdminCapes" and "spoutFactionModeratorCapes" (all new settings default to true)
When a faction is disbanded or has peaceful status added or removed, all online players are now notified Added further debug output if an UnknownFormatConversionException is triggered during relational chat messages, to help track down cause
This commit is contained in:
@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.SpoutFeatures;
|
||||
|
||||
public class FCommandConfig extends FBaseCommand {
|
||||
|
||||
@ -226,6 +227,9 @@ public class FCommandConfig extends FBaseCommand {
|
||||
}
|
||||
// save change to disk
|
||||
Conf.save();
|
||||
|
||||
// in case some Spout related setting was changed
|
||||
SpoutFeatures.updateAppearances();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,8 +2,11 @@ package com.massivecraft.factions.commands;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SpoutFeatures;
|
||||
|
||||
public class FCommandDisband extends FBaseCommand {
|
||||
|
||||
@ -27,12 +30,21 @@ public class FCommandDisband extends FBaseCommand {
|
||||
if( parameters.size() > 0) {
|
||||
Faction faction = Faction.findByTag(parameters.get(0));
|
||||
|
||||
if( faction != null && faction.getId() > 0 ) {
|
||||
sendMessage("Faction " + faction.getTag() + " got disbanded");
|
||||
Faction.delete( faction.getId() );
|
||||
} else {
|
||||
if( faction == null || !faction.isNormal()) {
|
||||
sendMessage("Faction " + parameters.get(0) + "not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayer.getAllOnline()) {
|
||||
if (fplayer.getFaction() == faction) {
|
||||
fplayer.sendMessage(me.getNameAndRelevant(fplayer)+Conf.colorSystem+" disbanded your faction.");
|
||||
} else {
|
||||
fplayer.sendMessage(me.getNameAndRelevant(fplayer)+Conf.colorSystem+" disbanded the faction "+faction.getTag(fplayer)+".");
|
||||
}
|
||||
}
|
||||
Faction.delete( faction.getId() );
|
||||
SpoutFeatures.updateAppearances();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,11 @@ package com.massivecraft.factions.commands;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.SpoutFeatures;
|
||||
|
||||
public class FCommandPeaceful extends FBaseCommand {
|
||||
|
||||
@ -32,13 +35,24 @@ public class FCommandPeaceful extends FBaseCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if( faction != null && faction.isPeaceful() ) {
|
||||
sendMessage("Faction \"" + parameters.get(0) + "\" peaceful designation removed");
|
||||
String change;
|
||||
if(faction.isPeaceful()) {
|
||||
change = "removed peaceful status from";
|
||||
faction.setPeaceful(false);
|
||||
} else {
|
||||
sendMessage("Faction \"" + faction.getTag() + "\" has been designated as peaceful");
|
||||
change = "granted peaceful status to";
|
||||
faction.setPeaceful(true);
|
||||
}
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayer.getAllOnline()) {
|
||||
if (fplayer.getFaction() == faction) {
|
||||
fplayer.sendMessage(me.getNameAndRelevant(fplayer)+Conf.colorSystem+" has "+change+" your faction.");
|
||||
} else {
|
||||
fplayer.sendMessage(me.getNameAndRelevant(fplayer)+Conf.colorSystem+" has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
|
||||
}
|
||||
}
|
||||
|
||||
SpoutFeatures.updateAppearances(faction);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SpoutFeatures;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.util.TextUtil;
|
||||
|
||||
@ -66,6 +67,10 @@ public class FCommandTag extends FBaseCommand {
|
||||
}
|
||||
faction.sendMessage(Conf.colorSystem+"The faction "+me.getRelationColor(faction)+oldtag+Conf.colorSystem+" changed their name to "+myFaction.getTag(faction));
|
||||
}
|
||||
|
||||
if (Conf.spoutFactionTagsOverNames) {
|
||||
SpoutFeatures.updateAppearances(myFaction);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.massivecraft.factions.commands;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SpoutFeatures;
|
||||
import com.massivecraft.factions.util.TextUtil;
|
||||
|
||||
public class FCommandTitle extends FBaseCommand {
|
||||
@ -51,6 +52,10 @@ public class FCommandTitle extends FBaseCommand {
|
||||
// Inform
|
||||
Faction myFaction = me.getFaction();
|
||||
myFaction.sendMessage(me.getNameAndRelevant(myFaction)+Conf.colorSystem+" changed a title: "+you.getNameAndRelevant(myFaction));
|
||||
|
||||
if (Conf.spoutFactionTitlesOverNames) {
|
||||
SpoutFeatures.updateAppearances(player);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.ChatColor;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.SpoutFeatures;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
|
||||
@ -72,5 +73,7 @@ public class FRelationCommand extends FBaseCommand {
|
||||
otherFaction.sendMessage(Conf.colorSystem+"This will have no effect while their faction is peaceful.");
|
||||
myFaction.sendMessage(Conf.colorSystem+"This will have no effect while your faction is peaceful.");
|
||||
}
|
||||
|
||||
SpoutFeatures.updateAppearances(myFaction, otherFaction);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user