Add missing return statements.

This commit is contained in:
drtshock 2014-11-17 14:30:41 -06:00
parent 356842ab41
commit edfe465ad5
4 changed files with 46 additions and 48 deletions

View File

@ -36,6 +36,7 @@ public class CmdDeinvite extends FCommand {
msg.then(name + " ").color(ChatColor.WHITE).tooltip("Click to revoke invite for " + name).command("f deinvite " + name); msg.then(name + " ").color(ChatColor.WHITE).tooltip("Click to revoke invite for " + name).command("f deinvite " + name);
} }
sendFancyMessage(msg); sendFancyMessage(msg);
return;
} }
if (you.getFaction() == myFaction) { if (you.getFaction() == myFaction) {

View File

@ -47,6 +47,7 @@ public class CmdKick extends FCommand {
} }
sendFancyMessage(msg); sendFancyMessage(msg);
return;
} }
if (fme == toKick) { if (fme == toKick) {

View File

@ -7,12 +7,10 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import mkremins.fanciful.FancyMessage; import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
public class CmdShow extends FCommand { public class CmdShow extends FCommand {
@ -47,10 +45,6 @@ public class CmdShow extends FCommand {
return; return;
} }
Collection<FPlayer> admins = faction.getFPlayersWhereRole(Role.ADMIN);
Collection<FPlayer> mods = faction.getFPlayersWhereRole(Role.MODERATOR);
Collection<FPlayer> normals = faction.getFPlayersWhereRole(Role.NORMAL);
msg(p.txt.titleize(faction.getTag(fme))); msg(p.txt.titleize(faction.getTag(fme)));
msg("<a>Description: <i>%s", faction.getDescription()); msg("<a>Description: <i>%s", faction.getDescription());
if (!faction.isNormal()) { if (!faction.isNormal()) {
@ -88,46 +82,48 @@ public class CmdShow extends FCommand {
} }
} }
ArrayList<FancyMessage> allies = new ArrayList<FancyMessage>(); ArrayList<FancyMessage> allies = new ArrayList<FancyMessage>();
ArrayList<FancyMessage> enemies = new ArrayList<FancyMessage>(); ArrayList<FancyMessage> enemies = new ArrayList<FancyMessage>();
FancyMessage currentAllies = new FancyMessage("Allies: ").color(ChatColor.GOLD); FancyMessage currentAllies = new FancyMessage("Allies: ").color(ChatColor.GOLD);
FancyMessage currentEnemies = new FancyMessage("Enemies: ").color(ChatColor.GOLD); FancyMessage currentEnemies = new FancyMessage("Enemies: ").color(ChatColor.GOLD);
boolean firstAlly = true; boolean firstAlly = true;
boolean firstEnemy = true; boolean firstEnemy = true;
for (Faction otherFaction : Factions.getInstance().getAllFactions()) { for (Faction otherFaction : Factions.getInstance().getAllFactions()) {
if (otherFaction == faction) { if (otherFaction == faction) {
continue; continue;
} }
Relation rel = otherFaction.getRelationTo(faction); Relation rel = otherFaction.getRelationTo(faction);
String s = otherFaction.getTag(fme); String s = otherFaction.getTag(fme);
if (rel.isAlly()) { if (rel.isAlly()) {
if (firstAlly) if (firstAlly) {
currentAllies.then(s).tooltip(getToolTips(otherFaction)); currentAllies.then(s).tooltip(getToolTips(otherFaction));
else } else {
currentAllies.then(", " + s).tooltip(getToolTips(otherFaction)); currentAllies.then(", " + s).tooltip(getToolTips(otherFaction));
firstAlly = false; }
firstAlly = false;
if (currentAllies.toJSONString().length() >= 32700) { // Client gets kicked at 32767, some leniency if (currentAllies.toJSONString().length() >= 32700) { // Client gets kicked at 32767, some leniency
allies.add(currentAllies); allies.add(currentAllies);
currentAllies = new FancyMessage(); currentAllies = new FancyMessage();
} }
} else if (rel.isEnemy()) { } else if (rel.isEnemy()) {
if (firstEnemy) if (firstEnemy) {
currentEnemies.then(s).tooltip(getToolTips(otherFaction)); currentEnemies.then(s).tooltip(getToolTips(otherFaction));
else } else {
currentEnemies.then(", " + s).tooltip(getToolTips(otherFaction)); currentEnemies.then(", " + s).tooltip(getToolTips(otherFaction));
firstEnemy = false; }
firstEnemy = false;
if (currentEnemies.toJSONString().length() >= 32700) { // Client gets kicked at 32767, some leniency if (currentEnemies.toJSONString().length() >= 32700) { // Client gets kicked at 32767, some leniency
enemies.add(currentEnemies); enemies.add(currentEnemies);
currentEnemies = new FancyMessage(); currentEnemies = new FancyMessage();
} }
} }
} }
allies.add(currentAllies); allies.add(currentAllies);
enemies.add(currentEnemies); enemies.add(currentEnemies);
FancyMessage online = new FancyMessage("Members online: ").color(ChatColor.GOLD); FancyMessage online = new FancyMessage("Members online: ").color(ChatColor.GOLD);
FancyMessage offline = new FancyMessage("Members offline: ").color(ChatColor.GOLD); FancyMessage offline = new FancyMessage("Members offline: ").color(ChatColor.GOLD);
@ -136,16 +132,18 @@ public class CmdShow extends FCommand {
for (FPlayer p : faction.getFPlayers()) { for (FPlayer p : faction.getFPlayers()) {
String name = p.getNameAndTitle(); String name = p.getNameAndTitle();
if (p.isOnline()) { if (p.isOnline()) {
if (firstOnline) if (firstOnline) {
online.then(name).tooltip(getToolTips(p)); online.then(name).tooltip(getToolTips(p));
else } else {
online.then(", " + name).tooltip(getToolTips(p)); online.then(", " + name).tooltip(getToolTips(p));
}
firstOnline = false; firstOnline = false;
} else { } else {
if (firstOffline) if (firstOffline) {
offline.then(name).tooltip(getToolTips(p)); offline.then(name).tooltip(getToolTips(p));
else } else {
offline.then(", " + name).tooltip(getToolTips(p)); offline.then(", " + name).tooltip(getToolTips(p));
}
firstOffline = false; firstOffline = false;
} }
} }

View File

@ -27,8 +27,6 @@ public class CmdShowInvites extends FCommand {
} }
sendFancyMessage(msg); sendFancyMessage(msg);
} }