Compare commits
29 Commits
2.2.2-BETA
...
2.2.4-STAB
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3545253844 | ||
|
|
ad69019ba6 | ||
|
|
b8f6a05538 | ||
|
|
98b40d325a | ||
|
|
8f2e58733d | ||
|
|
ae17f3d788 | ||
|
|
a71bbd5b14 | ||
|
|
05e1a7297c | ||
|
|
1f9965b13a | ||
|
|
fb32d2155b | ||
|
|
4c90bae87c | ||
|
|
05cfd5d8b0 | ||
|
|
b2fdcd5649 | ||
|
|
f4bfa83e24 | ||
|
|
4222dd9689 | ||
|
|
ccb2dae890 | ||
|
|
f7297c96c4 | ||
|
|
87f0810914 | ||
|
|
016c82fa85 | ||
|
|
fad866cf33 | ||
|
|
c3319ce109 | ||
|
|
ca5d7663f9 | ||
|
|
cee9c1f4d7 | ||
|
|
fb03d78234 | ||
|
|
e0134d680e | ||
|
|
8e855bc9bb | ||
|
|
2772d85603 | ||
|
|
acf06c78ed | ||
|
|
cda1610a58 |
@@ -36,8 +36,8 @@ Moving forward we plan to take all suggestions into consideration, as they come
|
||||
We Plan on Releasing the latest and greatest factions/skyblock/prison plugins minecraft has to offer and wont settle for anything less
|
||||
|
||||
## Support
|
||||
Our Discord is Currently In Progress of a Massive Overhaul, but we still encourage our community to join and express any concerns/questions/suggestions they may have!
|
||||
https://discord.gg/37JvmM
|
||||
Our Discord is Currently In Progress of a Massive Overhaul, but we still encourage our community to join and express any concerns/questions/suggestions they may have
|
||||
https://Discord.Saber.pw
|
||||
|
||||
Look forward to a bright future and a journey with all of you!
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.massivecraft</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<version>1.6.9.5-U0.2.1-2.2.2-BETA</version>
|
||||
<version>1.6.9.5-2.2.4-RC</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>SaberFactions</name>
|
||||
|
||||
@@ -100,6 +100,10 @@ public class Conf {
|
||||
public static boolean worldGuardChecking = false;
|
||||
public static boolean worldGuardBuildPriority = false;
|
||||
public static boolean factionsDrainEnabled = false;
|
||||
//RESERVE
|
||||
public static boolean useReserveSystem = true;
|
||||
//AUDIT
|
||||
public static boolean useAuditSystem = true;
|
||||
|
||||
//DISCORD
|
||||
public static boolean useDiscordSystem = false;
|
||||
@@ -239,6 +243,7 @@ public class Conf {
|
||||
public static boolean ownedMessageInsideTerritory = true;
|
||||
public static boolean ownedMessageByChunk = false;
|
||||
public static boolean pistonProtectionThroughDenyBuild = true;
|
||||
public static Set<Material> loggableMaterials = EnumSet.noneOf(Material.class);
|
||||
public static Set<Material> territoryProtectedMaterials = EnumSet.noneOf(Material.class);
|
||||
public static Set<Material> territoryDenyUsageMaterials = EnumSet.noneOf(Material.class);
|
||||
public static Set<Material> territoryProtectedMaterialsWhenOffline = EnumSet.noneOf(Material.class);
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.util.Set;
|
||||
public class FLocation implements Serializable {
|
||||
private static final long serialVersionUID = -8292915234027387983L;
|
||||
private static final boolean worldBorderSupport;
|
||||
|
||||
static {
|
||||
boolean worldBorderClassPresent = false;
|
||||
try {
|
||||
@@ -22,7 +21,6 @@ public class FLocation implements Serializable {
|
||||
worldBorderClassPresent = true;
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
|
||||
worldBorderSupport = worldBorderClassPresent;
|
||||
}
|
||||
|
||||
@@ -45,7 +43,7 @@ public class FLocation implements Serializable {
|
||||
}
|
||||
|
||||
public FLocation(Location location) {
|
||||
this(location.getWorld().getName(), blockToChunk(location.getBlockX()), blockToChunk(location.getBlockZ()));
|
||||
this(Objects.requireNonNull(location.getWorld()).getName(), blockToChunk(location.getBlockX()), blockToChunk(location.getBlockZ()));
|
||||
}
|
||||
|
||||
public FLocation(Player player) {
|
||||
@@ -152,6 +150,8 @@ public class FLocation implements Serializable {
|
||||
return "" + x + "," + z;
|
||||
}
|
||||
|
||||
public String formatXAndZ(String splitter) { return chunkToBlock(this.x) + "x" + splitter + " " + chunkToBlock(this.z) + "z"; }
|
||||
|
||||
//----------------------------------------------//
|
||||
// Misc Geometry
|
||||
//----------------------------------------------//
|
||||
@@ -178,9 +178,9 @@ public class FLocation implements Serializable {
|
||||
}
|
||||
|
||||
public boolean isInChunk(Location loc) {
|
||||
if (loc == null) {
|
||||
return false;
|
||||
}
|
||||
if(loc == null) return false;
|
||||
if(loc.getWorld() == null) return false;
|
||||
|
||||
Chunk chunk = loc.getChunk();
|
||||
return loc.getWorld().getName().equalsIgnoreCase(getWorldName()) && chunk.getX() == x && chunk.getZ() == z;
|
||||
}
|
||||
@@ -192,18 +192,23 @@ public class FLocation implements Serializable {
|
||||
* @return whether this location is outside of the border
|
||||
*/
|
||||
public boolean isOutsideWorldBorder(int buffer) {
|
||||
if (!worldBorderSupport) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!worldBorderSupport) return false;
|
||||
WorldBorder border = getWorld().getWorldBorder();
|
||||
Chunk chunk = border.getCenter().getChunk();
|
||||
Location center = border.getCenter();
|
||||
double size = border.getSize();
|
||||
|
||||
int lim = FLocation.chunkToRegion((int) border.getSize()) - buffer;
|
||||
int diffX = chunk.getX() - x;
|
||||
int diffZ = chunk.getZ() - z;
|
||||
int bufferBlocks = buffer << 4;
|
||||
|
||||
return (diffX > lim || diffZ > lim) || (-diffX >= lim || -diffZ >= lim);
|
||||
double borderMinX = (center.getX() - size / 2.0D) + bufferBlocks;
|
||||
double borderMinZ = (center.getZ() - size / 2.0D) + bufferBlocks;
|
||||
double borderMaxX = (center.getX() + size / 2.0D) - bufferBlocks;
|
||||
double borderMaxZ = (center.getZ() + size / 2.0D) - bufferBlocks;
|
||||
|
||||
int chunkMinX = this.x << 4;
|
||||
int chunkMaxX = chunkMinX | 15;
|
||||
int chunkMinZ = this.z << 4;
|
||||
int chunkMaxZ = chunkMinZ | 15;
|
||||
return (chunkMinX >= borderMaxX) || (chunkMinZ >= borderMaxZ) || (chunkMaxX <= borderMinX) || (chunkMaxZ <= borderMinZ);
|
||||
}
|
||||
|
||||
//----------------------------------------------//
|
||||
@@ -213,10 +218,7 @@ public class FLocation implements Serializable {
|
||||
double radiusSquared = radius * radius;
|
||||
|
||||
Set<FLocation> ret = new LinkedHashSet<>();
|
||||
if (radius <= 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (radius <= 0) return ret;
|
||||
int xfrom = (int) Math.floor(this.x - radius);
|
||||
int xto = (int) Math.ceil(this.x + radius);
|
||||
int zfrom = (int) Math.floor(this.z - radius);
|
||||
@@ -230,7 +232,6 @@ public class FLocation implements Serializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -246,13 +247,8 @@ public class FLocation implements Serializable {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof FLocation)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (obj == this) return true;
|
||||
if (!(obj instanceof FLocation)) return false;
|
||||
FLocation that = (FLocation) obj;
|
||||
return this.x == that.x && this.z == that.z && (Objects.equals(this.worldName, that.worldName));
|
||||
}
|
||||
|
||||
@@ -4,13 +4,15 @@ import ch.njol.skript.Skript;
|
||||
import ch.njol.skript.SkriptAddon;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.massivecraft.factions.cmd.CmdAutoHelp;
|
||||
import com.massivecraft.factions.cmd.CommandContext;
|
||||
import com.massivecraft.factions.cmd.FCmdRoot;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.cmd.*;
|
||||
import com.massivecraft.factions.cmd.audit.FChestListener;
|
||||
import com.massivecraft.factions.cmd.audit.FLogManager;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.cmd.check.CheckTask;
|
||||
import com.massivecraft.factions.cmd.check.WeeWooTask;
|
||||
import com.massivecraft.factions.cmd.chest.AntiChestListener;
|
||||
import com.massivecraft.factions.cmd.reserve.ListParameterizedType;
|
||||
import com.massivecraft.factions.cmd.reserve.ReserveObject;
|
||||
import com.massivecraft.factions.discord.Discord;
|
||||
import com.massivecraft.factions.discord.DiscordListener;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@@ -29,7 +31,8 @@ import com.massivecraft.factions.zcore.MPlugin;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.Permissable;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.fupgrades.*;
|
||||
import com.massivecraft.factions.zcore.fupgrades.FUpgradesGUI;
|
||||
import com.massivecraft.factions.zcore.fupgrades.UpgradesListener;
|
||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||
import me.lucko.commodore.CommodoreProvider;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
@@ -37,8 +40,6 @@ import net.milkbowl.vault.permission.Permission;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
@@ -51,6 +52,8 @@ import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.logging.Level;
|
||||
@@ -90,6 +93,8 @@ public class FactionsPlugin extends MPlugin {
|
||||
private Listener[] eventsListener;
|
||||
public List<String> itemList = getConfig().getStringList("fchest.Items-Not-Allowed");
|
||||
private Worldguard wg;
|
||||
private FLogManager fLogManager;
|
||||
private List<ReserveObject> reserveObjects;
|
||||
|
||||
|
||||
public FactionsPlugin() {
|
||||
@@ -137,7 +142,7 @@ public class FactionsPlugin extends MPlugin {
|
||||
}
|
||||
|
||||
public void playSound(Player p, String sound) {
|
||||
float pitch = Float.valueOf(sound.split(":")[1]);
|
||||
float pitch = Float.parseFloat(sound.split(":")[1]);
|
||||
sound = sound.split(":")[0];
|
||||
p.playSound(p.getLocation(), Sound.valueOf(sound), pitch, 5.0F);
|
||||
}
|
||||
@@ -184,6 +189,7 @@ public class FactionsPlugin extends MPlugin {
|
||||
PermissionList.generateFile();
|
||||
// Load Conf from disk
|
||||
Conf.load();
|
||||
fLogManager = new FLogManager();
|
||||
//Dependency checks
|
||||
if (Conf.dependencyCheck && (!Bukkit.getPluginManager().isPluginEnabled("Vault") && !Bukkit.getPluginManager().isPluginEnabled("Essentials"))) {
|
||||
divider();
|
||||
@@ -223,7 +229,8 @@ public class FactionsPlugin extends MPlugin {
|
||||
|
||||
Board.getInstance().load();
|
||||
Board.getInstance().clean();
|
||||
|
||||
//Load command aliases
|
||||
Aliases.load();
|
||||
// Add Base Commands
|
||||
this.cmdBase = new FCmdRoot();
|
||||
this.cmdAutoHelp = new CmdAutoHelp();
|
||||
@@ -259,11 +266,11 @@ public class FactionsPlugin extends MPlugin {
|
||||
}
|
||||
if (Conf.useCheckSystem) {
|
||||
int minute = 1200;
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 3), 0L, (long) (minute * 3));
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 5), 0L, (long) (minute * 5));
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 10), 0L, (long) (minute * 10));
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 15), 0L, (long) (minute * 15));
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 30), 0L, (long) (minute * 30));
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 3), 0L, minute * 3);
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 5), 0L, minute * 5);
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 10), 0L, minute * 10);
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 15), 0L, minute * 15);
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 30), 0L, minute * 30);
|
||||
this.getServer().getScheduler().runTaskTimer(this, CheckTask::cleanupTask, 0L, 1200L);
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new WeeWooTask(this), 600L, 600L);
|
||||
}
|
||||
@@ -271,6 +278,7 @@ public class FactionsPlugin extends MPlugin {
|
||||
new Discord(this);
|
||||
|
||||
ShopConfig.setup();
|
||||
fLogManager.loadLogs(this);
|
||||
|
||||
getServer().getPluginManager().registerEvents(factionsPlayerListener = new FactionsPlayerListener(), this);
|
||||
|
||||
@@ -283,6 +291,8 @@ public class FactionsPlugin extends MPlugin {
|
||||
new FUpgradesGUI(),
|
||||
new UpgradesListener(),
|
||||
new MissionHandler(this),
|
||||
new FChestListener(),
|
||||
new MenuListener(),
|
||||
new AntiChestListener()
|
||||
};
|
||||
|
||||
@@ -292,6 +302,28 @@ public class FactionsPlugin extends MPlugin {
|
||||
this.getCommand(refCommand).setExecutor(cmdBase);
|
||||
|
||||
if (!CommodoreProvider.isSupported()) this.getCommand(refCommand).setTabCompleter(this);
|
||||
reserveObjects = new ArrayList<>();
|
||||
String path = Paths.get(this.getDataFolder().getAbsolutePath()).toAbsolutePath().toString() + File.separator + "reserves.json";
|
||||
File file = new File(path);
|
||||
try {
|
||||
String json;
|
||||
if (!file.exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
file.createNewFile();
|
||||
}
|
||||
json = String.join("", Files.readAllLines(Paths.get(file.getPath()))).replace("\n", "").replace("\r", "");
|
||||
if (json.equalsIgnoreCase("")) {
|
||||
Files.write(Paths.get(path), "[]".getBytes());
|
||||
json = "[]";
|
||||
}
|
||||
reserveObjects = this.getGsonBuilder().create().fromJson(json, new ListParameterizedType(ReserveObject.class));
|
||||
if (reserveObjects == null) {
|
||||
reserveObjects = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (getDescription().getFullName().contains("BETA")) {
|
||||
divider();
|
||||
@@ -431,6 +463,11 @@ public class FactionsPlugin extends MPlugin {
|
||||
}
|
||||
DiscordListener.saveGuilds();
|
||||
super.onDisable();
|
||||
try {
|
||||
fLogManager.saveLogs();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void startAutoLeaveTask(boolean restartIfRunning) {
|
||||
@@ -556,22 +593,6 @@ public class FactionsPlugin extends MPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public void createTimedHologram(final Location location, String text, Long timeout) {
|
||||
ArmorStand as = (ArmorStand) location.add(0.5, 1, 0.5).getWorld().spawnEntity(location, EntityType.ARMOR_STAND); //Spawn the ArmorStand
|
||||
as.setVisible(false); //Makes the ArmorStand invisible
|
||||
as.setGravity(false); //Make sure it doesn't fall
|
||||
as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it
|
||||
as.setCustomName(FactionsPlugin.instance.color(text)); //Set this to the text you want
|
||||
as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not
|
||||
final ArmorStand armorStand = as;
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(FactionsPlugin.instance, () -> {
|
||||
armorStand.remove();
|
||||
getLogger().info("Removing Hologram.");
|
||||
}
|
||||
, timeout * 20);
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------- //
|
||||
// Functions for other plugins to hook into
|
||||
@@ -651,6 +672,15 @@ public class FactionsPlugin extends MPlugin {
|
||||
return tag;
|
||||
}
|
||||
|
||||
|
||||
public FLogManager getFlogManager() {
|
||||
return fLogManager;
|
||||
}
|
||||
|
||||
public void logFactionEvent(Faction faction, FLogType type, String... arguments) {
|
||||
this.fLogManager.log(faction, type, arguments);
|
||||
}
|
||||
|
||||
// Get a player's title within their faction, mainly for usage by chat plugins for local/channel chat
|
||||
public String getPlayerTitle(Player player) {
|
||||
if (player == null) {
|
||||
@@ -683,6 +713,10 @@ public class FactionsPlugin extends MPlugin {
|
||||
return Factions.getInstance().getFactionTags();
|
||||
}
|
||||
|
||||
public List<ReserveObject> getFactionReserves() {
|
||||
return this.reserveObjects;
|
||||
}
|
||||
|
||||
// Get a list of all players in the specified faction
|
||||
public Set<String> getPlayersInFaction(String factionTag) {
|
||||
Set<String> players = new HashSet<>();
|
||||
|
||||
149
src/main/java/com/massivecraft/factions/cmd/Aliases.java
Normal file
149
src/main/java/com/massivecraft/factions/cmd/Aliases.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
public class Aliases {
|
||||
/**
|
||||
* @author DroppingAnvil
|
||||
*/
|
||||
public static ArrayList<String> alts_alts = new ArrayList<>(Arrays.asList("alts", "alt"));
|
||||
public static ArrayList<String> alts_list = new ArrayList<>(Arrays.asList("list", "l"));
|
||||
public static ArrayList<String> alts_invite = new ArrayList<>(Collections.singletonList("invite"));
|
||||
public static ArrayList<String> alts_kick = new ArrayList<>(Collections.singletonList("kick"));
|
||||
public static ArrayList<String> audit = new ArrayList<>(Arrays.asList("audit", "log", "logs"));
|
||||
public static ArrayList<String> check = new ArrayList<>(Arrays.asList("check"));
|
||||
public static ArrayList<String> weewoo = new ArrayList<>(Collections.singletonList("weewoo"));
|
||||
public static ArrayList<String> chest = new ArrayList<>(Arrays.asList("chest", "pv"));
|
||||
public static ArrayList<String> claim_auto = new ArrayList<>(Collections.singletonList("autoclaim"));
|
||||
public static ArrayList<String> claim_claim = new ArrayList<>(Collections.singletonList("claim"));
|
||||
public static ArrayList<String> claim_at = new ArrayList<>(Collections.singletonList("claimat"));
|
||||
public static ArrayList<String> claim_line = new ArrayList<>(Arrays.asList("claimline", "cl"));
|
||||
public static ArrayList<String> claim_corner = new ArrayList<>(Arrays.asList("corner"));
|
||||
public static ArrayList<String> unclaim_all_safe = new ArrayList<>(Arrays.asList("safeunclaimall", "safedeclaimall"));
|
||||
public static ArrayList<String> unclaim_unclaim = new ArrayList<>(Arrays.asList("unclaim", "declaim"));
|
||||
public static ArrayList<String> unclaim_all_unsafe = new ArrayList<>(Arrays.asList("unclaimall", "declaimall"));
|
||||
public static ArrayList<String> unclaim_all_war = new ArrayList<>(Arrays.asList("warunclaimall", "wardeclaimall"));
|
||||
public static ArrayList<String> money_money = new ArrayList<>(Arrays.asList("money", "bank"));
|
||||
public static ArrayList<String> money_balance = new ArrayList<>(Arrays.asList("b", "balance"));
|
||||
public static ArrayList<String> money_deposit = new ArrayList<>(Arrays.asList("d", "deposit"));
|
||||
public static ArrayList<String> money_transfer_Ff = new ArrayList<>(Collections.singletonList("ff"));
|
||||
public static ArrayList<String> money_transfer_Fp = new ArrayList<>(Collections.singletonList("fp"));
|
||||
public static ArrayList<String> money_transfer_Pf = new ArrayList<>(Collections.singletonList("pf"));
|
||||
public static ArrayList<String> money_withdraw = new ArrayList<>(Arrays.asList("w", "withdraw"));
|
||||
public static ArrayList<String> grace = new ArrayList<>(Collections.singletonList("grace"));
|
||||
public static ArrayList<String> logout = new ArrayList<>(Collections.singletonList("logout"));
|
||||
public static ArrayList<String> points_points = new ArrayList<>(Collections.singletonList("points"));
|
||||
public static ArrayList<String> points_add = new ArrayList<>(Collections.singletonList("add"));
|
||||
public static ArrayList<String> points_remove = new ArrayList<>(Collections.singletonList("remove"));
|
||||
public static ArrayList<String> points_set = new ArrayList<>(Collections.singletonList("set"));
|
||||
public static ArrayList<String> relation_ally = new ArrayList<>(Collections.singletonList("ally"));
|
||||
public static ArrayList<String> relation_enemy = new ArrayList<>(Collections.singletonList("enemy"));
|
||||
public static ArrayList<String> relation_neutral = new ArrayList<>(Collections.singletonList("neutral"));
|
||||
public static ArrayList<String> relation_truce = new ArrayList<>(Collections.singletonList("truce"));
|
||||
public static ArrayList<String> reserve = new ArrayList<>(Collections.singletonList("reserve"));
|
||||
public static ArrayList<String> roles_demote = new ArrayList<>(Collections.singletonList("demote"));
|
||||
public static ArrayList<String> roles_promote = new ArrayList<>(Collections.singletonList("ally"));
|
||||
public static ArrayList<String> tnt_tnt = new ArrayList<>(Collections.singletonList("tnt"));
|
||||
public static ArrayList<String> tnt_tntfill = new ArrayList<>(Collections.singletonList("tntfill"));
|
||||
public static ArrayList<String> wild = new ArrayList<>(Collections.singletonList("wild"));
|
||||
public static ArrayList<String> admin = new ArrayList<>(Arrays.asList("admin", "setadmin", "leader", "setleader"));
|
||||
public static ArrayList<String> ahome = new ArrayList<>(Collections.singletonList("ahome"));
|
||||
public static ArrayList<String> announce = new ArrayList<>(Arrays.asList("ann", "announce"));
|
||||
public static ArrayList<String> help = new ArrayList<>(Arrays.asList("help", "h", "?"));
|
||||
public static ArrayList<String> ban_ban = new ArrayList<>(Collections.singletonList("ban"));
|
||||
public static ArrayList<String> ban_banlist = new ArrayList<>(Arrays.asList("banlist", "bans", "banl"));
|
||||
public static ArrayList<String> banner = new ArrayList<>(Collections.singletonList("banner"));
|
||||
public static ArrayList<String> boom = new ArrayList<>(Arrays.asList("noboom", "explosions", "toggleexplosions"));
|
||||
public static ArrayList<String> bypass = new ArrayList<>(Collections.singletonList("bypass"));
|
||||
public static ArrayList<String> chat = new ArrayList<>(Arrays.asList("chat", "c"));
|
||||
public static ArrayList<String> chatspy = new ArrayList<>(Collections.singletonList("chatspy"));
|
||||
public static ArrayList<String> checkpoint = new ArrayList<>(Arrays.asList("checkp", "checkpoint", "cpoint"));
|
||||
public static ArrayList<String> coleader = new ArrayList<>(Arrays.asList("coleader", "setcoleader", "co", "setco"));
|
||||
public static ArrayList<String> config = new ArrayList<>(Collections.singletonList("config"));
|
||||
public static ArrayList<String> convert = new ArrayList<>(Collections.singletonList("convert"));
|
||||
public static ArrayList<String> coords = new ArrayList<>(Arrays.asList("coords", "coord"));
|
||||
public static ArrayList<String> create = new ArrayList<>(Collections.singletonList("create"));
|
||||
public static ArrayList<String> debug = new ArrayList<>(Collections.singletonList("debug"));
|
||||
public static ArrayList<String> deinvite = new ArrayList<>(Arrays.asList("deinvite", "deinv"));
|
||||
public static ArrayList<String> deletefwarp = new ArrayList<>(Arrays.asList("delwarp", "dw", "deletewarp"));
|
||||
public static ArrayList<String> description = new ArrayList<>(Arrays.asList("desc", "description"));
|
||||
public static ArrayList<String> disband = new ArrayList<>(Collections.singletonList("disband"));
|
||||
public static ArrayList<String> discord_discord = new ArrayList<>(Collections.singletonList("discord"));
|
||||
public static ArrayList<String> drain = new ArrayList<>(Collections.singletonList("drain"));
|
||||
public static ArrayList<String> global = new ArrayList<>(Arrays.asList("gchat", "global", "globalchat"));
|
||||
public static ArrayList<String> fly = new ArrayList<>(Collections.singletonList("fly"));
|
||||
public static ArrayList<String> focus = new ArrayList<>(Collections.singletonList("focus"));
|
||||
public static ArrayList<String> warp = new ArrayList<>(Arrays.asList("warp", "warps"));
|
||||
public static ArrayList<String> getvault = new ArrayList<>(Collections.singletonList("getvault"));
|
||||
public static ArrayList<String> home = new ArrayList<>(Collections.singletonList("home"));
|
||||
public static ArrayList<String> inspect = new ArrayList<>(Arrays.asList("inspect", "ins"));
|
||||
public static ArrayList<String> invsee = new ArrayList<>(Arrays.asList("invsee", "inventorysee"));
|
||||
public static ArrayList<String> invite = new ArrayList<>(Arrays.asList("invite", "inv"));
|
||||
public static ArrayList<String> join = new ArrayList<>(Collections.singletonList("join"));
|
||||
public static ArrayList<String> kick = new ArrayList<>(Collections.singletonList("kick"));
|
||||
public static ArrayList<String> killholograms = new ArrayList<>(Collections.singletonList("killholos"));
|
||||
public static ArrayList<String> leave = new ArrayList<>(Collections.singletonList("leave"));
|
||||
public static ArrayList<String> list = new ArrayList<>(Arrays.asList("list", "ls"));
|
||||
public static ArrayList<String> lock = new ArrayList<>(Collections.singletonList("lock"));
|
||||
public static ArrayList<String> logins = new ArrayList<>(Arrays.asList("logins", "login", "logouts"));
|
||||
public static ArrayList<String> lookup = new ArrayList<>(Collections.singletonList("lookup"));
|
||||
public static ArrayList<String> lowPower = new ArrayList<>(Collections.singletonList("lowpower"));
|
||||
public static ArrayList<String> map_map = new ArrayList<>(Collections.singletonList("map"));
|
||||
public static ArrayList<String> map_height = new ArrayList<>(Arrays.asList("mapheight", "mh"));
|
||||
public static ArrayList<String> mod = new ArrayList<>(Arrays.asList("mod", "setmod", "officer", "setofficer"));
|
||||
public static ArrayList<String> modifyPower = new ArrayList<>(Arrays.asList("mp", "pm", "modpower", "modifypower"));
|
||||
public static ArrayList<String> near = new ArrayList<>(Arrays.asList("near", "nearby"));
|
||||
public static ArrayList<String> open = new ArrayList<>(Collections.singletonList("open"));
|
||||
public static ArrayList<String> owner_owner = new ArrayList<>(Collections.singletonList("owner"));
|
||||
public static ArrayList<String> owner_list = new ArrayList<>(Collections.singletonList("ownerlist"));
|
||||
public static ArrayList<String> paypal_see = new ArrayList<>(Arrays.asList("paypal", "seepaypal"));
|
||||
public static ArrayList<String> paypal_set = new ArrayList<>(Collections.singletonList("setpaypal"));
|
||||
public static ArrayList<String> peaceful = new ArrayList<>(Collections.singletonList("peaceful"));
|
||||
public static ArrayList<String> perm = new ArrayList<>(Arrays.asList("perm", "perms", "permission", "permissions"));
|
||||
public static ArrayList<String> permanent_faction = new ArrayList<>(Collections.singletonList("permanent"));
|
||||
public static ArrayList<String> permanent_power = new ArrayList<>(Collections.singletonList("permanentpower"));
|
||||
public static ArrayList<String> titles = new ArrayList<>(Collections.singletonList("titles"));
|
||||
public static ArrayList<String> power_power = new ArrayList<>(Arrays.asList("pow", "power"));
|
||||
public static ArrayList<String> power_boost = new ArrayList<>(Collections.singletonList("powerboost"));
|
||||
public static ArrayList<String> reload = new ArrayList<>(Collections.singletonList("reload"));
|
||||
public static ArrayList<String> rules = new ArrayList<>(Arrays.asList("r", "rule", "rules"));
|
||||
public static ArrayList<String> saveAll = new ArrayList<>(Arrays.asList("save", "saveall"));
|
||||
public static ArrayList<String> scoreboard = new ArrayList<>(Arrays.asList("sb", "scoreboard"));
|
||||
public static ArrayList<String> seeChunk = new ArrayList<>(Arrays.asList("sc", "seechunk"));
|
||||
public static ArrayList<String> discord_see = new ArrayList<>(Collections.singletonList("seediscord"));
|
||||
public static ArrayList<String> discord_set = new ArrayList<>(Collections.singletonList("setdiscord"));
|
||||
public static ArrayList<String> setBanner = new ArrayList<>(Collections.singletonList("setbanner"));
|
||||
public static ArrayList<String> setDefaultRole = new ArrayList<>(Arrays.asList("defaultrole", "def", "default", "defaultrank"));
|
||||
public static ArrayList<String> setWarp = new ArrayList<>(Arrays.asList("sw", "setwarp"));
|
||||
public static ArrayList<String> setHome = new ArrayList<>(Collections.singletonList("sethome"));
|
||||
public static ArrayList<String> setMaxVaults = new ArrayList<>(Arrays.asList("smv", "setmaxvaults"));
|
||||
public static ArrayList<String> show_show = new ArrayList<>(Arrays.asList("show", "who"));
|
||||
public static ArrayList<String> show_claims = new ArrayList<>(Arrays.asList("showclaim", "showclaims"));
|
||||
public static ArrayList<String> show_invites = new ArrayList<>(Collections.singletonList("showinvites"));
|
||||
public static ArrayList<String> spawnerlock = new ArrayList<>(Arrays.asList("lockspawners", "spawnerlock"));
|
||||
public static ArrayList<String> status = new ArrayList<>(Arrays.asList("s", "status"));
|
||||
public static ArrayList<String> stealth = new ArrayList<>(Arrays.asList("stealth", "ninja"));
|
||||
public static ArrayList<String> strikes_strikes = new ArrayList<>(Collections.singletonList("strikes"));
|
||||
public static ArrayList<String> strikes_give = new ArrayList<>(Collections.singletonList("give"));
|
||||
public static ArrayList<String> strikes_info = new ArrayList<>(Collections.singletonList("info"));
|
||||
public static ArrayList<String> strikes_set = new ArrayList<>(Collections.singletonList("set"));
|
||||
public static ArrayList<String> strikes_take = new ArrayList<>(Collections.singletonList("take"));
|
||||
public static ArrayList<String> stuck = new ArrayList<>(Arrays.asList("stuck", "halp!"));
|
||||
public static ArrayList<String> tag = new ArrayList<>(Arrays.asList("tag", "rename"));
|
||||
public static ArrayList<String> title = new ArrayList<>(Collections.singletonList("title"));
|
||||
public static ArrayList<String> toggleAllianceChat = new ArrayList<>(Arrays.asList("tac", "ac", "togglealliancechat"));
|
||||
public static ArrayList<String> top = new ArrayList<>(Arrays.asList("t", "top"));
|
||||
public static ArrayList<String> tpBanner = new ArrayList<>(Collections.singletonList("tpbanner"));
|
||||
public static ArrayList<String> unban = new ArrayList<>(Collections.singletonList("unban"));
|
||||
public static ArrayList<String> upgrades = new ArrayList<>(Arrays.asList("upgrades", "upgrade"));
|
||||
public static ArrayList<String> vault = new ArrayList<>(Collections.singletonList("vault"));
|
||||
public static ArrayList<String> viewChest = new ArrayList<>(Arrays.asList("viewchest", "viewpv"));
|
||||
private static transient Aliases i = new Aliases();
|
||||
public static void load() {
|
||||
FactionsPlugin.getInstance().persist.loadOrSaveDefault(i, Aliases.class, "aliases");
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class CmdAHome extends FCommand {
|
||||
|
||||
public CmdAHome() {
|
||||
super();
|
||||
this.aliases.add("ahome");
|
||||
this.aliases.addAll(Aliases.ahome);
|
||||
|
||||
this.requiredArgs.add("player");
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
public class CmdAdmin extends FCommand {
|
||||
|
||||
@@ -18,10 +20,7 @@ public class CmdAdmin extends FCommand {
|
||||
|
||||
public CmdAdmin() {
|
||||
super();
|
||||
this.aliases.add("admin");
|
||||
this.aliases.add("setadmin");
|
||||
this.aliases.add("leader");
|
||||
this.aliases.add("setleader");
|
||||
this.aliases.addAll(Aliases.admin);
|
||||
|
||||
this.requiredArgs.add("player");
|
||||
|
||||
@@ -84,6 +83,8 @@ public class CmdAdmin extends FCommand {
|
||||
fyou.setRole(Role.LEADER);
|
||||
context.msg(TL.COMMAND_ADMIN_PROMOTES, fyou.describeTo(context.fPlayer, true));
|
||||
|
||||
FactionsPlugin.instance.getFlogManager().log(targetFaction, FLogType.RANK_EDIT, context.fPlayer.getName(), fyou.getName(), ChatColor.RED + "Admin");
|
||||
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
fplayer.msg(TL.COMMAND_ADMIN_PROMOTED,
|
||||
|
||||
@@ -18,8 +18,7 @@ public class CmdAnnounce extends FCommand {
|
||||
|
||||
public CmdAnnounce() {
|
||||
super();
|
||||
this.aliases.add("ann");
|
||||
this.aliases.add("announce");
|
||||
this.aliases.addAll(Aliases.announce);
|
||||
|
||||
this.requiredArgs.add("message");
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ public class CmdAutoHelp extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdAutoHelp() {
|
||||
this.aliases.add("?");
|
||||
this.aliases.add("h");
|
||||
this.aliases.add("help");
|
||||
this.aliases.addAll(Aliases.help);
|
||||
|
||||
this.setHelpShort("");
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
||||
import com.massivecraft.factions.struct.BanInfo;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.CC;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -19,7 +21,7 @@ public class CmdBan extends FCommand {
|
||||
|
||||
public CmdBan() {
|
||||
super();
|
||||
this.aliases.add("ban");
|
||||
this.aliases.addAll(Aliases.ban_ban);
|
||||
|
||||
this.requiredArgs.add("target");
|
||||
|
||||
@@ -79,6 +81,7 @@ public class CmdBan extends FCommand {
|
||||
|
||||
// Lets inform the people!
|
||||
target.msg(TL.COMMAND_BAN_TARGET, context.faction.getTag(target.getFaction()));
|
||||
FactionsPlugin.instance.logFactionEvent(context.faction, FLogType.BANS, context.fPlayer.getName(), CC.Green + "banned", target.getName());
|
||||
context.faction.msg(TL.COMMAND_BAN_BANNED, context.fPlayer.getName(), target.getName());
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,7 @@ public class CmdBanlist extends FCommand {
|
||||
|
||||
public CmdBanlist() {
|
||||
super();
|
||||
this.aliases.add("banlist");
|
||||
this.aliases.add("bans");
|
||||
this.aliases.add("banl");
|
||||
this.aliases.addAll(Aliases.ban_banlist);
|
||||
|
||||
this.optionalArgs.put("faction", "faction");
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@ public class CmdBanner extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdBanner() {
|
||||
this.aliases.add("banner");
|
||||
this.aliases.add("warbanner");
|
||||
this.aliases.addAll(Aliases.banner);
|
||||
this.requirements = new CommandRequirements.Builder(Permission.BANNER).playerOnly().memberOnly().build();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ public class CmdBoom extends FCommand {
|
||||
|
||||
public CmdBoom() {
|
||||
super();
|
||||
this.aliases.add("noboom");
|
||||
this.aliases.add("explosions");
|
||||
this.aliases.add("toggleexplosions");
|
||||
this.aliases.addAll(Aliases.boom);
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CmdBypass extends FCommand {
|
||||
|
||||
public CmdBypass() {
|
||||
super();
|
||||
this.aliases.add("bypass");
|
||||
this.aliases.addAll(Aliases.bypass);
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
@@ -16,8 +16,7 @@ public class CmdChat extends FCommand {
|
||||
|
||||
public CmdChat() {
|
||||
super();
|
||||
this.aliases.add("c");
|
||||
this.aliases.add("chat");
|
||||
this.aliases.addAll(Aliases.chat);
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("mode", "next");
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CmdChatSpy extends FCommand {
|
||||
|
||||
public CmdChatSpy() {
|
||||
super();
|
||||
this.aliases.add("chatspy");
|
||||
this.aliases.addAll(Aliases.chatspy);
|
||||
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ public class CmdCheckpoint extends FCommand {
|
||||
|
||||
public CmdCheckpoint() {
|
||||
super();
|
||||
this.aliases.add("checkp");
|
||||
this.aliases.add("checkpoint");
|
||||
this.aliases.add("cpoint");
|
||||
this.aliases.addAll(Aliases.checkpoint);
|
||||
|
||||
this.optionalArgs.put("set", "");
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -17,10 +19,7 @@ public class CmdColeader extends FCommand {
|
||||
|
||||
public CmdColeader() {
|
||||
super();
|
||||
this.aliases.add("co");
|
||||
this.aliases.add("setcoleader");
|
||||
this.aliases.add("coleader");
|
||||
this.aliases.add("setco");
|
||||
this.aliases.addAll(Aliases.coleader);
|
||||
|
||||
this.optionalArgs.put("player name", "name");
|
||||
|
||||
@@ -81,6 +80,7 @@ public class CmdColeader extends FCommand {
|
||||
you.setRole(Role.COLEADER);
|
||||
targetFaction.msg(TL.COMMAND_COLEADER_PROMOTED, you.describeTo(targetFaction, true));
|
||||
context.msg(TL.COMMAND_COLEADER_PROMOTES, you.describeTo(context.fPlayer, true));
|
||||
FactionsPlugin.instance.getFlogManager().log(targetFaction, FLogType.RANK_EDIT, context.fPlayer.getName(), you.getName(), ChatColor.RED + "Co-Leader");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CmdConfig extends FCommand {
|
||||
|
||||
public CmdConfig() {
|
||||
super();
|
||||
this.aliases.add("config");
|
||||
this.aliases.addAll(Aliases.config);
|
||||
|
||||
this.requiredArgs.add("setting");
|
||||
this.requiredArgs.add("value");
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CmdConvert extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdConvert() {
|
||||
this.aliases.add("convert");
|
||||
this.aliases.addAll(Aliases.convert);
|
||||
this.requiredArgs.add("[MYSQL|JSON]");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.CONVERT)
|
||||
|
||||
@@ -13,8 +13,7 @@ public class CmdCoords extends FCommand {
|
||||
|
||||
public CmdCoords() {
|
||||
super();
|
||||
this.aliases.add("coords");
|
||||
this.aliases.add("coord");
|
||||
this.aliases.addAll(Aliases.coords);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.COORD)
|
||||
.playerOnly()
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CmdCreate extends FCommand {
|
||||
|
||||
public CmdCreate() {
|
||||
super();
|
||||
this.aliases.add("create");
|
||||
this.aliases.addAll(Aliases.create);
|
||||
|
||||
this.requiredArgs.add("faction tag");
|
||||
|
||||
|
||||
@@ -20,8 +20,7 @@ public class CmdDeinvite extends FCommand {
|
||||
|
||||
public CmdDeinvite() {
|
||||
super();
|
||||
this.aliases.add("deinvite");
|
||||
this.aliases.add("deinv");
|
||||
this.aliases.addAll(Aliases.deinvite);
|
||||
|
||||
this.optionalArgs.put("player name", "name");
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ public class CmdDelFWarp extends FCommand {
|
||||
|
||||
public CmdDelFWarp() {
|
||||
super();
|
||||
this.aliases.add("delwarp");
|
||||
this.aliases.add("dw");
|
||||
this.aliases.add("deletewarp");
|
||||
this.aliases.addAll(Aliases.deletefwarp);
|
||||
this.requiredArgs.add("warp name");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETWARP)
|
||||
|
||||
@@ -4,9 +4,11 @@ import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class CmdDescription extends FCommand {
|
||||
|
||||
@@ -16,8 +18,7 @@ public class CmdDescription extends FCommand {
|
||||
|
||||
public CmdDescription() {
|
||||
super();
|
||||
this.aliases.add("desc");
|
||||
this.aliases.add("description");
|
||||
this.aliases.addAll(Aliases.description);
|
||||
|
||||
this.requiredArgs.add("desc");
|
||||
|
||||
@@ -38,8 +39,9 @@ public class CmdDescription extends FCommand {
|
||||
|
||||
// since "&" color tags seem to work even through plain old FPlayer.sendMessage() for some reason, we need to break those up
|
||||
// And replace all the % because it messes with string formatting and this is easy way around that.
|
||||
context.faction.setDescription(TextUtil.implode(context.args, " ").replaceAll("%", "").replaceAll("(&([a-f0-9klmnor]))", "& $2"));
|
||||
|
||||
String desc = TextUtil.implode(context.args, " ").replaceAll("%", "").replaceAll("(&([a-f0-9klmnor]))", "& $2");
|
||||
context.faction.setDescription(desc);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(FactionsPlugin.instance, () -> FactionsPlugin.instance.logFactionEvent(context.faction, FLogType.FDESC_EDIT, context.fPlayer.getName(), desc));
|
||||
if (!Conf.broadcastDescriptionChanges) {
|
||||
context.msg(TL.COMMAND_DESCRIPTION_CHANGED, context.faction.describeTo(context.fPlayer));
|
||||
context.sendMessage(context.faction.getDescription());
|
||||
|
||||
@@ -20,19 +20,17 @@ public class CmdDisband extends FCommand {
|
||||
* @author FactionsUUID Team
|
||||
*/
|
||||
|
||||
//TODO: Add Disband Confirmation GUI
|
||||
|
||||
private static HashMap<String, String> disbandMap = new HashMap<>();
|
||||
|
||||
|
||||
public CmdDisband() {
|
||||
super();
|
||||
this.aliases.add("disband");
|
||||
|
||||
this.aliases.addAll(Aliases.disband);
|
||||
this.optionalArgs.put("faction tag", "yours");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.DISBAND)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Random;
|
||||
public class CmdDiscord extends FCommand {
|
||||
public CmdDiscord() {
|
||||
super();
|
||||
this.aliases.add("discord");
|
||||
this.aliases.addAll(Aliases.discord_discord);
|
||||
this.requirements = new CommandRequirements.Builder(Permission.DISCORD)
|
||||
.playerOnly()
|
||||
.build();
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.text.DecimalFormat;
|
||||
*/
|
||||
public class CmdDrain extends FCommand{
|
||||
public CmdDrain(){
|
||||
this.aliases.add("drain");
|
||||
this.aliases.addAll(Aliases.drain);
|
||||
this.requirements = new CommandRequirements.Builder(Permission.DRAIN)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
|
||||
@@ -17,9 +17,7 @@ public class CmdFGlobal extends FCommand {
|
||||
|
||||
public CmdFGlobal() {
|
||||
super();
|
||||
this.aliases.add("gchat");
|
||||
this.aliases.add("global");
|
||||
this.aliases.add("globalchat");
|
||||
this.aliases.addAll(Aliases.global);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.GLOBALCHAT)
|
||||
.playerOnly()
|
||||
|
||||
@@ -20,8 +20,7 @@ public class CmdFWarp extends FCommand {
|
||||
|
||||
public CmdFWarp() {
|
||||
super();
|
||||
this.aliases.add("warp");
|
||||
this.aliases.add("warps");
|
||||
this.aliases.addAll(Aliases.warp);
|
||||
this.optionalArgs.put("warpname", "warpname");
|
||||
this.optionalArgs.put("password", "password");
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CmdFly extends FCommand {
|
||||
|
||||
public CmdFly() {
|
||||
super();
|
||||
this.aliases.add("fly");
|
||||
this.aliases.addAll(Aliases.fly);
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.FLY)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CmdFocus extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdFocus() {
|
||||
aliases.add("focus");
|
||||
aliases.addAll(Aliases.focus);
|
||||
|
||||
requiredArgs.add("player");
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CmdGetVault extends FCommand {
|
||||
|
||||
public CmdGetVault() {
|
||||
super();
|
||||
this.aliases.add("getvault");
|
||||
this.aliases.addAll(Aliases.getvault);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.GETVAULT)
|
||||
.playerOnly()
|
||||
|
||||
@@ -18,12 +18,10 @@ public class CmdHelp extends FCommand {
|
||||
*/
|
||||
|
||||
public ArrayList<ArrayList<String>> helpPages;
|
||||
|
||||
//TODO: Add Help GUI
|
||||
public CmdHelp() {
|
||||
super();
|
||||
this.aliases.add("help");
|
||||
this.aliases.add("h");
|
||||
this.aliases.add("?");
|
||||
this.aliases.addAll(Aliases.help);
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("page", "1");
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CmdHome extends FCommand {
|
||||
|
||||
public CmdHome() {
|
||||
super();
|
||||
this.aliases.add("home");
|
||||
this.aliases.addAll(Aliases.home);
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.HOME)
|
||||
|
||||
@@ -11,9 +11,7 @@ public class CmdInspect extends FCommand {
|
||||
|
||||
public CmdInspect() {
|
||||
super();
|
||||
this.aliases.add("inspect");
|
||||
this.aliases.add("ins");
|
||||
|
||||
this.aliases.addAll(Aliases.inspect);
|
||||
this.requirements = new CommandRequirements.Builder(Permission.INSPECT)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
|
||||
@@ -23,8 +23,7 @@ public class CmdInventorySee extends FCommand {
|
||||
public CmdInventorySee() {
|
||||
super();
|
||||
|
||||
this.aliases.add("invsee");
|
||||
this.aliases.add("inventorysee");
|
||||
this.aliases.addAll(Aliases.invsee);
|
||||
|
||||
this.requiredArgs.add("member name");
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.CC;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import mkremins.fanciful.FancyMessage;
|
||||
@@ -17,8 +19,7 @@ public class CmdInvite extends FCommand {
|
||||
|
||||
public CmdInvite() {
|
||||
super();
|
||||
this.aliases.add("invite");
|
||||
this.aliases.add("inv");
|
||||
this.aliases.addAll(Aliases.invite);
|
||||
|
||||
this.requiredArgs.add("player name");
|
||||
|
||||
@@ -68,11 +69,10 @@ public class CmdInvite extends FCommand {
|
||||
.command("/" + Conf.baseCommandAliases.get(0) + " join " + context.faction.getTag())
|
||||
.then(context.faction.describeTo(target)).tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
|
||||
.command("/" + Conf.baseCommandAliases.get(0) + " join " + context.faction.getTag());
|
||||
|
||||
message.send(target.getPlayer());
|
||||
}
|
||||
|
||||
context.faction.msg(TL.COMMAND_INVITE_INVITED, context.fPlayer.describeTo(context.faction, true), target.describeTo(context.faction));
|
||||
FactionsPlugin.instance.logFactionEvent(context.faction, FLogType.INVITES, context.fPlayer.getName(), CC.Green + "invited", target.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.discord.Discord;
|
||||
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.CC;
|
||||
import com.massivecraft.factions.zcore.fupgrades.UpgradeType;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.exceptions.HierarchyException;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class CmdJoin extends FCommand {
|
||||
|
||||
/**
|
||||
@@ -18,7 +22,7 @@ public class CmdJoin extends FCommand {
|
||||
|
||||
public CmdJoin() {
|
||||
super();
|
||||
this.aliases.add("join");
|
||||
this.aliases.addAll(Aliases.join);
|
||||
this.requiredArgs.add("faction name");
|
||||
this.optionalArgs.put("player", "you");
|
||||
|
||||
@@ -125,10 +129,11 @@ public class CmdJoin extends FCommand {
|
||||
faction.deinvite(fplayer);
|
||||
try {
|
||||
context.fPlayer.setRole(faction.getDefaultRole());
|
||||
FactionsPlugin.instance.logFactionEvent(faction, FLogType.INVITES, context.fPlayer.getName(), CC.Green + "joined", "the faction");
|
||||
if (Discord.useDiscord && context.fPlayer.discordSetup() && Discord.isInMainGuild(context.fPlayer.discordUser()) && Discord.mainGuild != null) {
|
||||
Member m = Discord.mainGuild.getMember(context.fPlayer.discordUser());
|
||||
if (Conf.factionRoles) {
|
||||
Discord.mainGuild.getController().addSingleRoleToMember(m, Discord.createFactionRole(faction.getTag())).queue();
|
||||
Discord.mainGuild.getController().addSingleRoleToMember(m, Objects.requireNonNull(Discord.createFactionRole(faction.getTag()))).queue();
|
||||
}
|
||||
if (Conf.factionDiscordTags) {
|
||||
Discord.mainGuild.getController().setNickname(m, Discord.getNicknameString(context.fPlayer)).queue();
|
||||
|
||||
@@ -4,9 +4,11 @@ import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.util.CC;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import mkremins.fanciful.FancyMessage;
|
||||
@@ -22,7 +24,7 @@ public class CmdKick extends FCommand {
|
||||
|
||||
public CmdKick() {
|
||||
super();
|
||||
this.aliases.add("kick");
|
||||
this.aliases.addAll(Aliases.kick);
|
||||
this.optionalArgs.put("player name", "player name");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.KICK)
|
||||
@@ -122,6 +124,7 @@ public class CmdKick extends FCommand {
|
||||
if (toKick.getRole() == Role.LEADER) {
|
||||
toKickFaction.promoteNewLeader();
|
||||
}
|
||||
FactionsPlugin.instance.logFactionEvent(toKickFaction, FLogType.INVITES, context.fPlayer.getName(), CC.Red + "kicked", toKick.getName());
|
||||
toKickFaction.deinvite(toKick);
|
||||
toKick.resetFactionData();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class CmdKillHolograms extends FCommand {
|
||||
|
||||
public CmdKillHolograms() {
|
||||
super();
|
||||
this.aliases.add("killholos");
|
||||
this.aliases.addAll(Aliases.killholograms);
|
||||
this.requiredArgs.add("radius");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.KILLHOLOS)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CmdLeave extends FCommand {
|
||||
|
||||
public CmdLeave() {
|
||||
super();
|
||||
this.aliases.add("leave");
|
||||
this.aliases.addAll(Aliases.leave);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.LEAVE)
|
||||
.playerOnly()
|
||||
|
||||
@@ -22,8 +22,7 @@ public class CmdList extends FCommand {
|
||||
|
||||
public CmdList() {
|
||||
super();
|
||||
this.aliases.add("list");
|
||||
this.aliases.add("ls");
|
||||
this.aliases.addAll(Aliases.list);
|
||||
|
||||
// default values in case user has old config
|
||||
defaults[0] = "&e&m----------&r&e[ &2Faction List &9{pagenumber}&e/&9{pagecount} &e]&m----------";
|
||||
|
||||
@@ -19,7 +19,7 @@ public class CmdLock extends FCommand {
|
||||
|
||||
public CmdLock() {
|
||||
super();
|
||||
this.aliases.add("lock");
|
||||
this.aliases.addAll(Aliases.lock);
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.LOCK)
|
||||
|
||||
@@ -11,10 +11,7 @@ public class CmdLogins extends FCommand {
|
||||
|
||||
public CmdLogins() {
|
||||
super();
|
||||
this.aliases.add("login");
|
||||
this.aliases.add("logins");
|
||||
this.aliases.add("logout");
|
||||
this.aliases.add("logouts");
|
||||
this.aliases.addAll(Aliases.logins);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MONITOR_LOGINS)
|
||||
.playerOnly()
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CmdLookup extends FCommand {
|
||||
|
||||
public CmdLookup() {
|
||||
super();
|
||||
this.aliases.add("lookup");
|
||||
this.aliases.addAll(Aliases.lookup);
|
||||
this.requiredArgs.add("faction name");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.LOOKUP)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CmdLowPower extends FCommand {
|
||||
|
||||
public CmdLowPower() {
|
||||
super();
|
||||
this.aliases.add("lowpower");
|
||||
this.aliases.addAll(Aliases.lowPower);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.POWER_ANY)
|
||||
.playerOnly()
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CmdMap extends FCommand {
|
||||
|
||||
public CmdMap() {
|
||||
super();
|
||||
this.aliases.add("map");
|
||||
this.aliases.addAll(Aliases.map_map);
|
||||
this.optionalArgs.put("on/off", "once");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MAP)
|
||||
|
||||
@@ -12,8 +12,7 @@ public class CmdMapHeight extends FCommand {
|
||||
public CmdMapHeight() {
|
||||
super();
|
||||
|
||||
this.aliases.add("mapheight");
|
||||
this.aliases.add("mh");
|
||||
this.aliases.addAll(Aliases.map_height);
|
||||
this.optionalArgs.put("height", "height");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MAPHEIGHT)
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -18,10 +19,7 @@ public class CmdMod extends FCommand {
|
||||
|
||||
public CmdMod() {
|
||||
super();
|
||||
this.aliases.add("mod");
|
||||
this.aliases.add("setmod");
|
||||
this.aliases.add("officer");
|
||||
this.aliases.add("setofficer");
|
||||
this.aliases.addAll(Aliases.mod);
|
||||
|
||||
this.optionalArgs.put("player name", "name");
|
||||
|
||||
@@ -77,6 +75,8 @@ public class CmdMod extends FCommand {
|
||||
you.setRole(Role.MODERATOR);
|
||||
targetFaction.msg(TL.COMMAND_MOD_PROMOTED, you.describeTo(targetFaction, true));
|
||||
context.msg(TL.COMMAND_MOD_PROMOTES, you.describeTo(context.fPlayer, true));
|
||||
FactionsPlugin.instance.getFlogManager().log(targetFaction, FLogType.RANK_EDIT, context.fPlayer.getName(), you.getName(), ChatColor.LIGHT_PURPLE + "Mod");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,7 @@ public class CmdModifyPower extends FCommand {
|
||||
public CmdModifyPower() {
|
||||
super();
|
||||
|
||||
this.aliases.add("pm");
|
||||
this.aliases.add("mp");
|
||||
this.aliases.add("modifypower");
|
||||
this.aliases.add("modpower");
|
||||
this.aliases.addAll(Aliases.modifyPower);
|
||||
|
||||
this.requiredArgs.add("name");
|
||||
this.requiredArgs.add("power");
|
||||
|
||||
@@ -16,8 +16,7 @@ public class CmdNear extends FCommand {
|
||||
|
||||
public CmdNear() {
|
||||
super();
|
||||
this.aliases.add("near");
|
||||
this.aliases.add("nearby");
|
||||
this.aliases.addAll(Aliases.near);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.NEAR)
|
||||
.playerOnly()
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CmdOpen extends FCommand {
|
||||
|
||||
public CmdOpen() {
|
||||
super();
|
||||
this.aliases.add("open");
|
||||
this.aliases.addAll(Aliases.open);
|
||||
this.optionalArgs.put("yes/no", "flip");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.OPEN)
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CmdOwner extends FCommand {
|
||||
|
||||
public CmdOwner() {
|
||||
super();
|
||||
this.aliases.add("owner");
|
||||
this.aliases.addAll(Aliases.owner_owner);
|
||||
this.optionalArgs.put("player name", "you");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.OWNER)
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CmdOwnerList extends FCommand {
|
||||
|
||||
public CmdOwnerList() {
|
||||
super();
|
||||
this.aliases.add("ownerlist");
|
||||
this.aliases.addAll(Aliases.owner_list);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.OWNERLIST)
|
||||
.playerOnly()
|
||||
|
||||
@@ -12,8 +12,7 @@ public class CmdPaypalSee extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdPaypalSee() {
|
||||
this.aliases.add("seepaypal");
|
||||
this.aliases.add("paypal");
|
||||
this.aliases.addAll(Aliases.paypal_see);
|
||||
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CmdPaypalSet extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdPaypalSet() {
|
||||
this.aliases.add("setpaypal");
|
||||
this.aliases.addAll(Aliases.paypal_set);
|
||||
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CmdPeaceful extends FCommand {
|
||||
|
||||
public CmdPeaceful() {
|
||||
super();
|
||||
this.aliases.add("peaceful");
|
||||
this.aliases.addAll(Aliases.peaceful);
|
||||
this.requiredArgs.add("faction tag");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SET_PEACEFUL)
|
||||
|
||||
@@ -23,10 +23,7 @@ public class CmdPerm extends FCommand {
|
||||
|
||||
public CmdPerm() {
|
||||
super();
|
||||
this.aliases.add("perm");
|
||||
this.aliases.add("perms");
|
||||
this.aliases.add("permission");
|
||||
this.aliases.add("permissions");
|
||||
this.aliases.addAll(Aliases.perm);
|
||||
|
||||
this.optionalArgs.put("relation", "relation");
|
||||
this.optionalArgs.put("action", "action");
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CmdPermanent extends FCommand {
|
||||
|
||||
public CmdPermanent() {
|
||||
super();
|
||||
this.aliases.add("permanent");
|
||||
this.aliases.addAll(Aliases.permanent_faction);
|
||||
this.requiredArgs.add("faction tag");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SET_PERMANENT)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CmdPermanentPower extends FCommand {
|
||||
|
||||
public CmdPermanentPower() {
|
||||
super();
|
||||
this.aliases.add("permanentpower");
|
||||
this.aliases.addAll(Aliases.permanent_power);
|
||||
this.requiredArgs.add("faction");
|
||||
this.requiredArgs.add("power");
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
public class CmdPlayerTitleToggle extends FCommand {
|
||||
public CmdPlayerTitleToggle() {
|
||||
super();
|
||||
this.aliases.add("titles");
|
||||
this.aliases.addAll(Aliases.titles);
|
||||
this.requirements = new CommandRequirements.Builder(Permission.TOGGLE_TITLES)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@ public class CmdPower extends FCommand {
|
||||
|
||||
public CmdPower() {
|
||||
super();
|
||||
this.aliases.add("power");
|
||||
this.aliases.add("pow");
|
||||
this.aliases.addAll(Aliases.power_power);
|
||||
this.optionalArgs.put("player name", "you");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.POWER)
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CmdPowerBoost extends FCommand {
|
||||
|
||||
public CmdPowerBoost() {
|
||||
super();
|
||||
this.aliases.add("powerboost");
|
||||
this.aliases.addAll(Aliases.power_boost);
|
||||
this.requiredArgs.add("plugin|f|player|faction");
|
||||
this.requiredArgs.add("name");
|
||||
this.requiredArgs.add("# or reset");
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CmdReload extends FCommand {
|
||||
|
||||
public CmdReload() {
|
||||
super();
|
||||
this.aliases.add("reload");
|
||||
this.aliases.addAll(Aliases.reload);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.RELOAD).build();
|
||||
}
|
||||
|
||||
@@ -15,9 +15,7 @@ public class CmdRules extends FCommand {
|
||||
|
||||
public CmdRules() {
|
||||
super();
|
||||
aliases.add("r");
|
||||
aliases.add("rule");
|
||||
aliases.add("rules");
|
||||
aliases.addAll(Aliases.rules);
|
||||
|
||||
this.optionalArgs.put("add/remove/set/clear", "");
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@ public class CmdSB extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdSB() {
|
||||
this.aliases.add("sb");
|
||||
this.aliases.add("scoreboard");
|
||||
this.aliases.addAll(Aliases.scoreboard);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SCOREBOARD)
|
||||
.playerOnly()
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.shop.ShopConfig;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -16,8 +13,7 @@ public class CmdSaveAll extends FCommand {
|
||||
|
||||
public CmdSaveAll() {
|
||||
super();
|
||||
this.aliases.add("saveall");
|
||||
this.aliases.add("save");
|
||||
this.aliases.addAll(Aliases.saveAll);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SAVE)
|
||||
.build();
|
||||
@@ -29,6 +25,11 @@ public class CmdSaveAll extends FCommand {
|
||||
Factions.getInstance().forceSave(false);
|
||||
Board.getInstance().forceSave(false);
|
||||
Conf.save();
|
||||
try {
|
||||
FactionsPlugin.instance.getFlogManager().saveLogs();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ShopConfig.saveShop();
|
||||
context.msg(TL.COMMAND_SAVEALL_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -32,8 +32,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
|
||||
public CmdSeeChunk() {
|
||||
super();
|
||||
aliases.add("seechunk");
|
||||
aliases.add("sc");
|
||||
aliases.addAll(Aliases.seeChunk);
|
||||
|
||||
this.useParticles = FactionsPlugin.getInstance().getConfig().getBoolean("see-chunk.particles", true);
|
||||
interval = FactionsPlugin.getInstance().getConfig().getLong("see-chunk.interval", 10L);
|
||||
|
||||
@@ -12,8 +12,7 @@ public class CmdSeeDiscord extends FCommand{
|
||||
*/
|
||||
|
||||
public CmdSeeDiscord() {
|
||||
this.aliases.add("seediscord");
|
||||
this.aliases.add("discord");
|
||||
this.aliases.addAll(Aliases.discord_see);
|
||||
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public class CmdSetBanner extends FCommand {
|
||||
|
||||
public CmdSetBanner() {
|
||||
super();
|
||||
aliases.add("setbanner");
|
||||
aliases.addAll(Aliases.setBanner);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.BANNER)
|
||||
.playerOnly()
|
||||
|
||||
@@ -13,10 +13,7 @@ public class CmdSetDefaultRole extends FCommand {
|
||||
public CmdSetDefaultRole() {
|
||||
super();
|
||||
|
||||
this.aliases.add("defaultrole");
|
||||
this.aliases.add("defaultrank");
|
||||
this.aliases.add("default");
|
||||
this.aliases.add("def");
|
||||
this.aliases.addAll(Aliases.setDefaultRole);
|
||||
this.requiredArgs.add("role");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.DEFAULTRANK)
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CmdSetDiscord extends FCommand {
|
||||
|
||||
public CmdSetDiscord(){
|
||||
super();
|
||||
this.aliases.add("setdiscord");
|
||||
this.aliases.addAll(Aliases.discord_set);
|
||||
|
||||
this.optionalArgs.put("faction", "yours");
|
||||
|
||||
|
||||
@@ -15,8 +15,7 @@ public class CmdSetFWarp extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdSetFWarp() {
|
||||
this.aliases.add("setwarp");
|
||||
this.aliases.add("sw");
|
||||
this.aliases.addAll(Aliases.setWarp);
|
||||
this.requiredArgs.add("warp name");
|
||||
this.optionalArgs.put("password", "password");
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETWARP).playerOnly().memberOnly().withAction(PermissableAction.SETWARP).build();
|
||||
|
||||
@@ -12,8 +12,7 @@ public class CmdSetMaxVaults extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdSetMaxVaults() {
|
||||
this.aliases.add("setmaxvaults");
|
||||
this.aliases.add("smv");
|
||||
this.aliases.addAll(Aliases.setMaxVaults);
|
||||
this.requiredArgs.add("faction");
|
||||
this.requiredArgs.add("number");
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CmdSethome extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdSethome() {
|
||||
this.aliases.add("sethome");
|
||||
this.aliases.addAll(Aliases.setHome);
|
||||
this.optionalArgs.put("faction tag", "mine");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETHOME)
|
||||
|
||||
@@ -21,8 +21,7 @@ public class CmdShow extends FCommand {
|
||||
List<String> defaults = new ArrayList<>();
|
||||
|
||||
public CmdShow() {
|
||||
this.aliases.add("show");
|
||||
this.aliases.add("who");
|
||||
this.aliases.addAll(Aliases.show_show);
|
||||
|
||||
// add defaults to /f show in case config doesnt have it
|
||||
defaults.add("{header}");
|
||||
|
||||
@@ -13,8 +13,7 @@ public class CmdShowClaims extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdShowClaims() {
|
||||
this.aliases.add("showclaims");
|
||||
this.aliases.add("showclaim");
|
||||
this.aliases.addAll(Aliases.show_claims);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SHOWCLAIMS)
|
||||
.playerOnly()
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CmdShowInvites extends FCommand {
|
||||
|
||||
public CmdShowInvites() {
|
||||
super();
|
||||
aliases.add("showinvites");
|
||||
aliases.addAll(Aliases.show_invites);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SHOW_INVITES)
|
||||
.playerOnly()
|
||||
|
||||
@@ -13,8 +13,7 @@ public class CmdSpawnerLock extends FCommand {
|
||||
|
||||
public CmdSpawnerLock(){
|
||||
super();
|
||||
this.aliases.add("lockspawners");
|
||||
this.aliases.add("spawnerlock");
|
||||
this.aliases.addAll(Aliases.spawnerlock);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.LOCKSPAWNERS)
|
||||
.build();
|
||||
|
||||
@@ -16,8 +16,7 @@ public class CmdStatus extends FCommand {
|
||||
|
||||
public CmdStatus() {
|
||||
super();
|
||||
this.aliases.add("status");
|
||||
this.aliases.add("s");
|
||||
this.aliases.addAll(Aliases.status);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.STATUS)
|
||||
.playerOnly()
|
||||
|
||||
@@ -10,8 +10,7 @@ public class CmdStealth extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdStealth() {
|
||||
this.aliases.add("ninja");
|
||||
this.aliases.add("stealth");
|
||||
this.aliases.addAll(Aliases.stealth);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.STEALTH)
|
||||
.playerOnly()
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CmdStrikes extends FCommand {
|
||||
public CmdStrikes() {
|
||||
super();
|
||||
|
||||
this.aliases.add("strikes");
|
||||
this.aliases.addAll(Aliases.strikes_strikes);
|
||||
|
||||
this.addSubCommand(cmdStrikesGive);
|
||||
this.addSubCommand(cmdStrikesInfo);
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CmdStrikesGive extends FCommand {
|
||||
|
||||
public CmdStrikesGive() {
|
||||
super();
|
||||
this.aliases.add("give");
|
||||
this.aliases.addAll(Aliases.strikes_give);
|
||||
this.requiredArgs.add(0, "faction");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETSTRIKES)
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CmdStrikesInfo extends FCommand {
|
||||
|
||||
public CmdStrikesInfo() {
|
||||
super();
|
||||
this.aliases.add("info");
|
||||
this.aliases.addAll(Aliases.strikes_info);
|
||||
this.optionalArgs.put("target", "faction");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETSTRIKES)
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CmdStrikesSet extends FCommand {
|
||||
|
||||
public CmdStrikesSet() {
|
||||
super();
|
||||
this.aliases.add("set");
|
||||
this.aliases.addAll(Aliases.strikes_set);
|
||||
this.requiredArgs.add(0, "faction");
|
||||
this.requiredArgs.add(1, "amount");
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CmdStrikesTake extends FCommand {
|
||||
|
||||
public CmdStrikesTake() {
|
||||
super();
|
||||
this.aliases.add("take");
|
||||
this.aliases.addAll(Aliases.strikes_take);
|
||||
this.requiredArgs.add(0, "faction");
|
||||
this.requiredArgs.add(1, "number of strikes");
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@ public class CmdStuck extends FCommand {
|
||||
|
||||
public CmdStuck() {
|
||||
super();
|
||||
this.aliases.add("stuck");
|
||||
this.aliases.add("halp!"); // halp!c:
|
||||
this.aliases.addAll(Aliases.stuck);
|
||||
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.STUCK)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.discord.Discord;
|
||||
import com.massivecraft.factions.event.FactionRenameEvent;
|
||||
import com.massivecraft.factions.scoreboards.FTeamWrapper;
|
||||
@@ -19,8 +20,7 @@ public class CmdTag extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdTag() {
|
||||
this.aliases.add("tag");
|
||||
this.aliases.add("rename");
|
||||
this.aliases.addAll(Aliases.tag);
|
||||
|
||||
this.requiredArgs.add("faction tag");
|
||||
|
||||
@@ -33,7 +33,6 @@ public class CmdTag extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||
|
||||
String tag = context.argAsString(0);
|
||||
|
||||
@@ -69,6 +68,8 @@ public class CmdTag extends FCommand {
|
||||
String oldtag = context.faction.getTag();
|
||||
context.faction.setTag(tag);
|
||||
Discord.changeFactionTag(context.faction, oldtag);
|
||||
FactionsPlugin.instance.logFactionEvent(context.faction, FLogType.FTAG_EDIT, context.fPlayer.getName(), tag);
|
||||
|
||||
|
||||
// Inform
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
@@ -76,16 +77,13 @@ public class CmdTag extends FCommand {
|
||||
fplayer.msg(TL.COMMAND_TAG_FACTION, context.fPlayer.describeTo(context.faction, true), context.faction.getTag(context.faction));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Broadcast the tag change (if applicable)
|
||||
if (Conf.broadcastTagChanges) {
|
||||
Faction faction = fplayer.getFaction();
|
||||
fplayer.msg(TL.COMMAND_TAG_CHANGED, context.fPlayer.getColorTo(faction) + oldtag, context.faction.getTag(faction));
|
||||
}
|
||||
}
|
||||
|
||||
FTeamWrapper.updatePrefixes(context.faction);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CmdTitle extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdTitle() {
|
||||
this.aliases.add("title");
|
||||
this.aliases.addAll(Aliases.title);
|
||||
this.requiredArgs.add("player name");
|
||||
this.optionalArgs.put("title", "");
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ public class CmdToggleAllianceChat extends FCommand {
|
||||
|
||||
public CmdToggleAllianceChat() {
|
||||
super();
|
||||
this.aliases.add("tac");
|
||||
this.aliases.add("togglealliancechat");
|
||||
this.aliases.add("ac");
|
||||
this.aliases.addAll(Aliases.toggleAllianceChat);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.TOGGLE_ALLIANCE_CHAT)
|
||||
.playerOnly()
|
||||
|
||||
@@ -18,8 +18,7 @@ public class CmdTop extends FCommand {
|
||||
|
||||
public CmdTop() {
|
||||
super();
|
||||
this.aliases.add("top");
|
||||
this.aliases.add("t");
|
||||
this.aliases.addAll(Aliases.top);
|
||||
this.requiredArgs.add("criteria");
|
||||
this.optionalArgs.put("page", "1");
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CmdTpBanner extends FCommand {
|
||||
|
||||
public CmdTpBanner() {
|
||||
super();
|
||||
this.aliases.add("tpbanner");
|
||||
this.aliases.addAll(Aliases.tpBanner);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.TPBANNER)
|
||||
.playerOnly()
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CmdUnban extends FCommand {
|
||||
|
||||
public CmdUnban() {
|
||||
super();
|
||||
this.aliases.add("unban");
|
||||
this.aliases.addAll(Aliases.unban);
|
||||
this.requiredArgs.add("target");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.BAN)
|
||||
@@ -48,7 +48,7 @@ public class CmdUnban extends FCommand {
|
||||
context.faction.unban(target);
|
||||
|
||||
context.msg(TL.COMMAND_UNBAN_UNBANNED, context.fPlayer.getName(), target.getName());
|
||||
target.msg(TL.COMMAND_UNBAN_TARGET.toString(), context.faction.getTag(target));
|
||||
target.msg(TL.COMMAND_UNBAN_TARGET, context.faction.getTag(target));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,8 +13,7 @@ public class CmdUpgrades extends FCommand {
|
||||
|
||||
public CmdUpgrades() {
|
||||
super();
|
||||
this.aliases.add("upgrades");
|
||||
this.aliases.add("upgrade");
|
||||
this.aliases.addAll(Aliases.upgrades);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.UPGRADES)
|
||||
.playerOnly()
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CmdVault extends FCommand {
|
||||
*/
|
||||
|
||||
public CmdVault() {
|
||||
this.aliases.add("vault");
|
||||
this.aliases.addAll(Aliases.vault);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.VAULT)
|
||||
.playerOnly()
|
||||
|
||||
@@ -13,8 +13,7 @@ public class CmdViewChest extends FCommand {
|
||||
|
||||
public CmdViewChest() {
|
||||
super();
|
||||
this.aliases.add("viewchest");
|
||||
this.aliases.add("viewpv");
|
||||
this.aliases.addAll(Aliases.viewChest);
|
||||
|
||||
this.requiredArgs.add("faction name");
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.alts.CmdAlts;
|
||||
import com.massivecraft.factions.cmd.audit.CmdAudit;
|
||||
import com.massivecraft.factions.cmd.check.CmdCheck;
|
||||
import com.massivecraft.factions.cmd.check.CmdWeeWoo;
|
||||
import com.massivecraft.factions.cmd.chest.CmdChest;
|
||||
@@ -16,6 +17,7 @@ import com.massivecraft.factions.cmd.relational.CmdRelationAlly;
|
||||
import com.massivecraft.factions.cmd.relational.CmdRelationEnemy;
|
||||
import com.massivecraft.factions.cmd.relational.CmdRelationNeutral;
|
||||
import com.massivecraft.factions.cmd.relational.CmdRelationTruce;
|
||||
import com.massivecraft.factions.cmd.reserve.CmdReserve;
|
||||
import com.massivecraft.factions.cmd.roles.CmdDemote;
|
||||
import com.massivecraft.factions.cmd.roles.CmdPromote;
|
||||
import com.massivecraft.factions.cmd.tnt.CmdTnt;
|
||||
@@ -164,6 +166,8 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
||||
public CmdDebug cmdDebug = new CmdDebug();
|
||||
public CmdDrain cmdDrain = new CmdDrain();
|
||||
public CmdLookup cmdLookup = new CmdLookup();
|
||||
public CmdAudit cmdAudit = new CmdAudit();
|
||||
public CmdReserve cmdReserve = new CmdReserve();
|
||||
//Variables to know if we already setup certain sub commands
|
||||
public Boolean discordEnabled = false;
|
||||
public Boolean checkEnabled = false;
|
||||
@@ -179,6 +183,7 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
||||
public Boolean coreProtectEnabled = false;
|
||||
public Boolean internalFTOPEnabled = false;
|
||||
public Boolean fWildEnabled = false;
|
||||
public Boolean fAuditEnabled = false;
|
||||
|
||||
public FCmdRoot() {
|
||||
super();
|
||||
@@ -312,6 +317,11 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
||||
this.addSubCommand(this.cmdDiscord);
|
||||
discordEnabled = true;
|
||||
}
|
||||
//Reserve
|
||||
if(Conf.useReserveSystem){
|
||||
this.addSubCommand(this.cmdReserve);
|
||||
}
|
||||
|
||||
//PayPal
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("fpaypal.Enabled", false) && !fPayPalEnabled) {
|
||||
this.addSubCommand(this.cmdPaypalSet);
|
||||
@@ -340,6 +350,12 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
||||
this.addSubCommand(this.cmdTop);
|
||||
internalFTOPEnabled = true;
|
||||
}
|
||||
|
||||
if(Conf.useAuditSystem){
|
||||
this.addSubCommand(cmdAudit);
|
||||
fAuditEnabled = true;
|
||||
}
|
||||
|
||||
//Other
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("Wild.Enabled", false) && !fWildEnabled) {
|
||||
this.addSubCommand(this.cmdWild);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.alts;
|
||||
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.Aliases;
|
||||
import com.massivecraft.factions.cmd.CommandContext;
|
||||
import com.massivecraft.factions.cmd.CommandRequirements;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
@@ -20,10 +21,7 @@ public class CmdAlts extends FCommand {
|
||||
|
||||
public CmdAlts() {
|
||||
super();
|
||||
|
||||
this.aliases.add("alts");
|
||||
this.aliases.add("alt");
|
||||
|
||||
this.aliases.addAll(Aliases.alts_alts);
|
||||
this.addSubCommand(this.cmdInviteAlt);
|
||||
this.addSubCommand(this.cmdAltsList);
|
||||
this.addSubCommand(this.cmdKickAlt);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user