adding new stuff
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import com.massivecraft.factions.zcore.util.TagReplacer;
|
||||
import com.massivecraft.factions.zcore.util.TagUtil;
|
||||
import mkremins.fanciful.FancyMessage;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -19,6 +19,7 @@ public class CmdShow extends FCommand {
|
||||
public CmdShow() {
|
||||
this.aliases.add("show");
|
||||
this.aliases.add("who");
|
||||
this.aliases.add("f");
|
||||
|
||||
// add defaults to /f show in case config doesnt have it
|
||||
defaults.add("{header}");
|
||||
@@ -47,6 +48,7 @@ public class CmdShow extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
Faction faction = myFaction;
|
||||
|
||||
if (this.argIsSet(0)) {
|
||||
faction = this.argAsFaction(0);
|
||||
}
|
||||
@@ -54,6 +56,11 @@ public class CmdShow extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fme.hasFaction() && fme.getFaction() == faction){
|
||||
fme.msg(TL.COMMAND_SHOW_NEEDFACTION);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fme != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")
|
||||
&& P.p.getConfig().getStringList("show-exempt").contains(faction.getTag())) {
|
||||
msg(TL.COMMAND_SHOW_EXEMPT);
|
||||
@@ -69,6 +76,65 @@ public class CmdShow extends FCommand {
|
||||
if (show == null || show.isEmpty()) {
|
||||
show = defaults;
|
||||
}
|
||||
/* for (int i = 0; i <= show.size()-1; i ++){
|
||||
if (show.get(i).contains("{description}")){
|
||||
show.set(i,show.get(i).replace("{description}",faction.getDescription()));
|
||||
}
|
||||
if (show.get(i).contains("{online-list}")){
|
||||
String message = "";
|
||||
StringBuilder string = new StringBuilder(message);
|
||||
for (FPlayer fPlayer : faction.getFPlayers()){
|
||||
Bukkit.broadcastMessage(fPlayer.getTag());
|
||||
if (fPlayer.getPlayer().isOnline()){
|
||||
String prefix = "";
|
||||
if (fPlayer.getRole() == Role.ADMIN){
|
||||
prefix = Conf.prefixAdmin;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.COLEADER){
|
||||
prefix = Conf.prefixCoLeader;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.MODERATOR){
|
||||
prefix = Conf.prefixMod;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.NORMAL){
|
||||
prefix = Conf.prefixNormal;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.RECRUIT){
|
||||
prefix = Conf.prefixRecruit;
|
||||
}
|
||||
string.append(prefix + fPlayer.getName() + ",");
|
||||
}
|
||||
if (string.toString().equals("")) { continue; }
|
||||
show.set(i,show.get(i).replace("{online-list}",string.toString()));
|
||||
}
|
||||
}
|
||||
if (show.get(i).contains("{offline-list}")){
|
||||
String message = "";
|
||||
StringBuilder string = new StringBuilder(message);
|
||||
for (FPlayer fPlayer : faction.getFPlayers()){
|
||||
if (!fPlayer.getPlayer().isOnline()){
|
||||
String prefix = "";
|
||||
if (fPlayer.getRole() == Role.ADMIN){
|
||||
prefix = Conf.prefixAdmin;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.COLEADER){
|
||||
prefix = Conf.prefixCoLeader;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.MODERATOR){
|
||||
prefix = Conf.prefixMod;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.NORMAL){
|
||||
prefix = Conf.prefixNormal;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.RECRUIT){
|
||||
prefix = Conf.prefixRecruit;
|
||||
}
|
||||
string.append(prefix + fPlayer.getName() + ",");
|
||||
}
|
||||
show.set(i,show.get(i).replace("{offline-list}",string.toString()));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (!faction.isNormal()) {
|
||||
String tag = faction.getTag(fme);
|
||||
@@ -88,11 +154,9 @@ public class CmdShow extends FCommand {
|
||||
continue; // Due to minimal f show.
|
||||
}
|
||||
|
||||
if (fme != null) {
|
||||
parsed = TagUtil.parsePlaceholders(fme.getPlayer(), parsed);
|
||||
}
|
||||
parsed = TagUtil.parsePlaceholders(fme.getPlayer(), parsed);
|
||||
|
||||
if (fme != null && TagUtil.hasFancy(parsed)) {
|
||||
if (TagUtil.hasFancy(parsed)) {
|
||||
List<FancyMessage> fancy = TagUtil.parseFancy(faction, fme, parsed);
|
||||
if (fancy != null) {
|
||||
sendFancyMessage(fancy);
|
||||
|
||||
Reference in New Issue
Block a user