Compare commits
33 Commits
2.3.3-STAB
...
2.3.5-STAB
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f343a5344 | ||
|
|
8665d92476 | ||
|
|
b89db7b082 | ||
|
|
00cb78fd9b | ||
|
|
aca075b5c7 | ||
|
|
03886aa84e | ||
|
|
22472f63f1 | ||
|
|
6d72e5d167 | ||
|
|
69765e472c | ||
|
|
4f55b10c7d | ||
|
|
0395280a9e | ||
|
|
d1252df3ba | ||
|
|
9707226762 | ||
|
|
cf075c270e | ||
|
|
f088b42bbe | ||
|
|
baee5d2158 | ||
|
|
f871787b0c | ||
|
|
749fca0690 | ||
|
|
319940d9b3 | ||
|
|
7ea81a6c10 | ||
|
|
6205bbca9f | ||
|
|
241a16bc2a | ||
|
|
3aa98121e5 | ||
|
|
144798b2dd | ||
|
|
dac07178e5 | ||
|
|
f8421c09cf | ||
|
|
932a5768b0 | ||
|
|
861f88a916 | ||
|
|
5b7f3b0f0e | ||
|
|
304662fa9b | ||
|
|
5a6c660f7f | ||
|
|
0fc736cdf5 | ||
|
|
ef7db546a3 |
@@ -1,6 +1,7 @@
|
||||
# SaberFactions
|
||||
|
||||
 [](https://www.codefactor.io/repository/github/driftay/saber-factions) [](https://github.com/SaberLLC/Saber-Factions/blob/1.6.x/LICENSE) 
|
||||
 [](https://www.codefactor.io/repository/github/driftay/saber-factions) [](https://github.com/SaberLLC/Saber-Factions/blob/1.6.x/LICENSE)  [](https://jitpack.io/#SaberLLC/Saber-Factions)
|
||||
|
||||
|
||||
SaberFactions is an exotic, performance optimized, and feature rich factions plugin that focuses on not only making the player experience as great as possibly but maintaining this aspect with the cost of NOTHING! We strive to continue development for SaberFactions as the factions community is strongly growing and seeking new players every day.
|
||||
|
||||
@@ -32,7 +33,7 @@ Some of our features include the following
|
||||
<dependency>
|
||||
<groupId>com.github.SaberLLC</groupId>
|
||||
<artifactId>Saber-Factions</artifactId>
|
||||
<version>2.2.7-STABLE</version>
|
||||
<version>2.3.3-STABLE</version>
|
||||
</dependency>
|
||||
```
|
||||
## Moving Forward
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.massivecraft</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<version>1.6.9.5-2.3.3-RC</version>
|
||||
<version>1.6.9.5-2.3.5-RC</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>SaberFactions</name>
|
||||
|
||||
@@ -98,6 +98,7 @@ public class Conf {
|
||||
public static double autoLeaveRoutineRunsEveryXMinutes = 5.0;
|
||||
public static int autoLeaveRoutineMaxMillisecondsPerTick = 5; // 1 server tick is roughly 50ms, so default max 10% of a tick
|
||||
public static boolean removePlayerDataWhenBanned = true;
|
||||
public static String removePlayerDataWhenBannedReason = "Banned by admin.";
|
||||
public static boolean autoLeaveDeleteFPlayerData = true; // Let them just remove player from Faction.
|
||||
public static boolean worldGuardChecking = false;
|
||||
public static boolean worldGuardBuildPriority = false;
|
||||
@@ -122,7 +123,7 @@ public class Conf {
|
||||
public static boolean useDisbandGUI = true;
|
||||
|
||||
//SEALTH
|
||||
public static boolean useSealthSystem = true;
|
||||
public static boolean useStealthSystem = true;
|
||||
|
||||
//STRIKES
|
||||
public static boolean useStrikeSystem = true;
|
||||
@@ -423,6 +424,8 @@ public class Conf {
|
||||
public static HashMap<String, DefaultPermissions> defaultFactionPermissions = new HashMap<>();
|
||||
public static HashSet<PermissableAction> lockedPermissions = new HashSet<>();
|
||||
|
||||
public static boolean wildLoadChunkBeforeTeleport = true;
|
||||
|
||||
private static transient Conf i = new Conf();
|
||||
|
||||
static {
|
||||
|
||||
@@ -82,7 +82,7 @@ public class FactionsPlugin extends MPlugin {
|
||||
public boolean mc114 = false;
|
||||
public boolean mc115 = false;
|
||||
public boolean useNonPacketParticles = false;
|
||||
public boolean factionsFlight = false;
|
||||
public static boolean factionsFlight = false;
|
||||
public List<String> itemList = getConfig().getStringList("fchest.Items-Not-Allowed");
|
||||
SkriptAddon skriptAddon;
|
||||
private FactionsPlayerListener factionsPlayerListener;
|
||||
@@ -184,8 +184,10 @@ public class FactionsPlugin extends MPlugin {
|
||||
Metrics metrics = new Metrics(this, pluginId);
|
||||
|
||||
|
||||
if (!preEnable()) return;
|
||||
this.loadSuccessful = false;
|
||||
if (!preEnable()) {
|
||||
this.loadSuccessful = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!new File(this.getDataFolder() + "/config.yml").exists()) {
|
||||
this.saveResource("config.yml", false);
|
||||
@@ -295,13 +297,16 @@ public class FactionsPlugin extends MPlugin {
|
||||
new MissionHandler(this),
|
||||
new FChestListener(),
|
||||
new MenuListener(),
|
||||
timerManager.graceTimer,
|
||||
new AntiChestListener()
|
||||
};
|
||||
|
||||
for (Listener eventListener : eventsListener)
|
||||
getServer().getPluginManager().registerEvents(eventListener, this);
|
||||
|
||||
if(Conf.useGraceSystem){
|
||||
getServer().getPluginManager().registerEvents(timerManager.graceTimer, this);
|
||||
}
|
||||
|
||||
this.getCommand(refCommand).setExecutor(cmdBase);
|
||||
|
||||
if (!CommodoreProvider.isSupported()) this.getCommand(refCommand).setTabCompleter(this);
|
||||
@@ -450,37 +455,32 @@ public class FactionsPlugin extends MPlugin {
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
super.onDisable();
|
||||
timerManager.saveTimerData();
|
||||
try {
|
||||
String path = Paths.get(getDataFolder().getAbsolutePath()).toAbsolutePath().toString() + File.separator + "reserves.json";
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
file.createNewFile();
|
||||
}
|
||||
Files.write(Paths.get(file.getPath()), getGsonBuilder().create().toJson(reserveObjects).getBytes());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// only save data if plugin actually completely loaded successfully
|
||||
if (this.loadSuccessful) Conf.saveSync();
|
||||
|
||||
|
||||
if (AutoLeaveTask != null) {
|
||||
this.getServer().getScheduler().cancelTask(AutoLeaveTask);
|
||||
AutoLeaveTask = null;
|
||||
}
|
||||
DiscordListener.saveGuilds();
|
||||
if (Discord.jda != null) {
|
||||
Discord.jda.shutdownNow();
|
||||
}
|
||||
try {
|
||||
fLogManager.saveLogs();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (this.loadSuccessful) {
|
||||
Conf.load();
|
||||
Conf.saveSync();
|
||||
timerManager.saveTimerData();
|
||||
DiscordListener.saveGuilds();
|
||||
if (Discord.jda != null) Discord.jda.shutdownNow();
|
||||
try {
|
||||
fLogManager.saveLogs();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
String path = Paths.get(getDataFolder().getAbsolutePath()).toAbsolutePath().toString() + File.separator + "reserves.json";
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
file.createNewFile();
|
||||
}
|
||||
Files.write(Paths.get(file.getPath()), getGsonBuilder().create().toJson(reserveObjects).getBytes());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
this.getServer().getScheduler().cancelTasks(this);
|
||||
super.onDisable();
|
||||
}
|
||||
|
||||
public void startAutoLeaveTask(boolean restartIfRunning) {
|
||||
|
||||
@@ -86,24 +86,20 @@ public class CmdAdmin extends FCommand {
|
||||
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,
|
||||
context.player == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fplayer, true),
|
||||
fyou.describeTo(fplayer), targetFaction.describeTo(fplayer));
|
||||
if(FactionsPlugin.instance.getConfig().getBoolean("faction-leader-broadcast")) {
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
fplayer.msg(TL.COMMAND_ADMIN_PROMOTED, context.player == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fplayer, true), fyou.describeTo(fplayer), targetFaction.describeTo(fplayer));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setRole(FPlayer fp, Role r) {
|
||||
FactionsPlugin.getInstance().getServer().getScheduler().runTask(FactionsPlugin.instance, () -> {
|
||||
fp.setRole(r);
|
||||
});
|
||||
FactionsPlugin.getInstance().getServer().getScheduler().runTask(FactionsPlugin.instance, () -> fp.setRole(r));
|
||||
}
|
||||
|
||||
private void promoteNewLeader(Faction f) {
|
||||
FactionsPlugin.getInstance().getServer().getScheduler().runTask(FactionsPlugin.instance, () -> {
|
||||
f.promoteNewLeader();
|
||||
});
|
||||
FactionsPlugin.getInstance().getServer().getScheduler().runTask(FactionsPlugin.instance, (Runnable) f::promoteNewLeader);
|
||||
}
|
||||
|
||||
public TL getUsageTranslation() {
|
||||
|
||||
@@ -25,36 +25,17 @@ public class CmdDeinvite extends FCommand {
|
||||
this.optionalArgs.put("player name", "name");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.DEINVITE)
|
||||
.withAction(PermissableAction.INVITE)
|
||||
.memberOnly()
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (context.args.size() == 0) {
|
||||
FancyMessage msg = new FancyMessage(TL.COMMAND_DEINVITE_CANDEINVITE.toString()).color(ChatColor.GOLD);
|
||||
for (String id : context.faction.getInvites()) {
|
||||
FPlayer fp = FPlayers.getInstance().getById(id);
|
||||
String name = fp != null ? fp.getName() : id;
|
||||
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_DEINVITE_CLICKTODEINVITE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
||||
}
|
||||
context.sendFancyMessage(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
FPlayer you = context.argAsBestFPlayerMatch(0);
|
||||
if (!context.fPlayer.isAdminBypassing()) {
|
||||
Access access = context.faction.getAccess(context.fPlayer, PermissableAction.INVITE);
|
||||
if (access != Access.ALLOW && context.fPlayer.getRole() != Role.LEADER) {
|
||||
context.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage invites");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (you == null) {
|
||||
FancyMessage msg = new FancyMessage(TL.COMMAND_DEINVITE_CANDEINVITE.toString()).color(ChatColor.GOLD);
|
||||
for (String id : context.faction.getInvites()) {
|
||||
if (context.faction.getInvites().isEmpty()) return;
|
||||
FPlayer fp = FPlayers.getInstance().getById(id);
|
||||
String name = fp != null ? fp.getName() : id;
|
||||
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_DEINVITE_CLICKTODEINVITE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
||||
@@ -65,15 +46,16 @@ public class CmdDeinvite extends FCommand {
|
||||
|
||||
if (you.getFaction() == context.faction) {
|
||||
context.msg(TL.COMMAND_DEINVITE_ALREADYMEMBER, you.getName(), context.faction.getTag());
|
||||
context.msg(TL.COMMAND_DEINVITE_MIGHTWANT, FactionsPlugin.getInstance().cmdBase.cmdKick.getUsageTemplate(context));
|
||||
context.msg(TL.COMMAND_DEINVITE_MIGHTWANT, FCmdRoot.instance.cmdKick.getUsageTemplate(context));
|
||||
return;
|
||||
}
|
||||
|
||||
context.faction.deinvite(you);
|
||||
|
||||
you.msg(TL.COMMAND_DEINVITE_REVOKED, context.fPlayer.describeTo(you), context.faction.describeTo(you));
|
||||
|
||||
context.faction.msg(TL.COMMAND_DEINVITE_REVOKES, context.fPlayer.describeTo(context.faction), you.describeTo(context.faction));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_DEINVITE_DESCRIPTION;
|
||||
|
||||
@@ -101,14 +101,14 @@ public class CmdDisband extends FCommand {
|
||||
String amountString = context.sender instanceof ConsoleCommandSender ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(follower);
|
||||
if (follower.getFaction() == faction) {
|
||||
follower.msg(TL.COMMAND_DISBAND_BROADCAST_YOURS, amountString);
|
||||
if (!follower.canFlyAtLocation() && FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
|
||||
if (!follower.canFlyAtLocation() && FactionsPlugin.factionsFlight) {
|
||||
follower.setFFlying(false, false);
|
||||
}
|
||||
} else {
|
||||
follower.msg(TL.COMMAND_DISBAND_BROADCAST_NOTYOURS, amountString, faction.getTag(follower));
|
||||
}
|
||||
}
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
|
||||
if (FactionsPlugin.factionsFlight) {
|
||||
faction.disband(context.player, PlayerDisbandReason.COMMAND);
|
||||
context.fPlayer.setFFlying(false, false);
|
||||
Cooldown.setCooldown(context.fPlayer.getPlayer(), "disbandCooldown", FactionsPlugin.getInstance().getConfig().getInt("fcooldowns.f-disband"));
|
||||
@@ -119,7 +119,7 @@ public class CmdDisband extends FCommand {
|
||||
}
|
||||
faction.disband(context.player, PlayerDisbandReason.COMMAND);
|
||||
Cooldown.setCooldown(context.fPlayer.getPlayer(), "disbandCooldown", FactionsPlugin.getInstance().getConfig().getInt("fcooldowns.f-disband"));
|
||||
if (!context.fPlayer.canFlyAtLocation() && FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
|
||||
if (!context.fPlayer.canFlyAtLocation() && FactionsPlugin.factionsFlight) {
|
||||
context.fPlayer.setFFlying(false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class CmdFly extends FCommand {
|
||||
}
|
||||
|
||||
public static boolean checkFly(FPlayer fme, Player me, Faction toFac) {
|
||||
if ((Conf.denyFlightIfInNoClaimingWorld && !Conf.worldsNoClaiming.isEmpty() && Conf.worldsNoClaiming.stream().anyMatch(me.getWorld().getName()::equalsIgnoreCase)) || me.hasPermission(Permission.FLY_FLY.node))
|
||||
if ((Conf.denyFlightIfInNoClaimingWorld && !Conf.worldsNoClaiming.isEmpty() && Conf.worldsNoClaiming.stream().anyMatch(me.getWorld().getName()::equalsIgnoreCase)) || !me.hasPermission(Permission.FLY_FLY.node))
|
||||
return false;
|
||||
if (toFac.getAccess(fme, PermissableAction.FLY) == Access.ALLOW) return true;
|
||||
if (fme.getFaction().isWilderness()) return false;
|
||||
|
||||
@@ -2,10 +2,10 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.ItemBuilder;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class CmdGetVault extends FCommand {
|
||||
@@ -30,9 +30,13 @@ public class CmdGetVault extends FCommand {
|
||||
context.fPlayer.msg(TL.GENERIC_DISABLED, "Faction Vaults");
|
||||
return;
|
||||
}
|
||||
Location vaultLocation = context.faction.getVault();
|
||||
ItemStack vault = FactionsPlugin.getInstance().createItem(Material.CHEST, 1, (short) 0, FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fvault.Item.Name")), FactionsPlugin.getInstance().colorList(FactionsPlugin.getInstance().getConfig().getStringList("fvault.Item.Lore")));
|
||||
|
||||
Location vaultLocation = context.faction.getVault();
|
||||
ItemStack vault = new ItemBuilder(Material.CHEST)
|
||||
.amount(1)
|
||||
.name(FactionsPlugin.getInstance().getConfig().getString("fvault.Item.Name"))
|
||||
.lore(FactionsPlugin.getInstance().getConfig().getStringList("fvault.Item.Lore"))
|
||||
.build();
|
||||
|
||||
//check if vault is set
|
||||
if (vaultLocation != null) {
|
||||
@@ -40,36 +44,19 @@ public class CmdGetVault extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//has enough money?
|
||||
int amount = FactionsPlugin.getInstance().getConfig().getInt("fvault.Price");
|
||||
if (!context.fPlayer.hasMoney(amount)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!context.fPlayer.takeMoney(amount)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//success :)
|
||||
context.fPlayer.takeMoney(amount);
|
||||
context.player.getInventory().addItem(vault);
|
||||
context.fPlayer.msg(TL.COMMAND_GETVAULT_RECEIVE);
|
||||
|
||||
}
|
||||
|
||||
public boolean inventoryContains(Inventory inventory, ItemStack item) {
|
||||
int count = 0;
|
||||
ItemStack[] items = inventory.getContents();
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
if (items[i] != null && items[i].getType() == item.getType() && items[i].getDurability() == item.getDurability()) {
|
||||
count += items[i].getAmount();
|
||||
}
|
||||
if (count >= item.getAmount()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
|
||||
@@ -60,14 +60,11 @@ public class CmdInvite extends FCommand {
|
||||
// Send the invitation to the target player when online, otherwise just ignore
|
||||
if (target.isOnline()) {
|
||||
// Tooltips, colors, and commands only apply to the string immediately before it.
|
||||
FancyMessage message = new FancyMessage(context.fPlayer.describeTo(target, true))
|
||||
FancyMessage message = new FancyMessage(TL.COMMAND_INVITE_INVITEDYOU.toString()
|
||||
.replace("%1$s", context.fPlayer.describeTo(target, true))
|
||||
.replace("%2$s", context.faction.getTag())
|
||||
.replaceAll("&", "§"))
|
||||
.tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
|
||||
.command("/" + Conf.baseCommandAliases.get(0) + " join " + context.faction.getTag())
|
||||
.then(TL.COMMAND_INVITE_INVITEDYOU.toString())
|
||||
.color(ChatColor.YELLOW)
|
||||
.tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
|
||||
.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());
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CmdReload extends FCommand {
|
||||
|
||||
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
FactionsPlugin.getInstance().factionsFlight = true;
|
||||
FactionsPlugin.factionsFlight = true;
|
||||
}
|
||||
|
||||
if (!FactionsPlugin.getInstance().mc17) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdShowClaims extends FCommand {
|
||||
@@ -16,6 +17,7 @@ public class CmdShowClaims extends FCommand {
|
||||
this.aliases.addAll(Aliases.show_claims);
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SHOWCLAIMS)
|
||||
.withAction(PermissableAction.TERRITORY)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.build();
|
||||
|
||||
@@ -33,6 +33,7 @@ public class CmdShowInvites extends FCommand {
|
||||
String name = fp != null ? fp.getName() : id;
|
||||
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_SHOWINVITES_CLICKTOREVOKE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
||||
}
|
||||
context.sendFancyMessage(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CmdStealth extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!Conf.useSealthSystem) {
|
||||
if (!Conf.useStealthSystem) {
|
||||
context.msg(TL.GENERIC_DISABLED, "Factions Stealth");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Material;
|
||||
|
||||
public class CmdUnban extends FCommand {
|
||||
|
||||
@@ -48,7 +49,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, context.faction.getTag(target));
|
||||
target.msg(TL.COMMAND_UNBAN_TARGETUNBANNED, context.faction.getTag(target));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.massivecraft.factions.cmd.wild;
|
||||
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.cmd.Aliases;
|
||||
import com.massivecraft.factions.cmd.CommandContext;
|
||||
import com.massivecraft.factions.cmd.CommandRequirements;
|
||||
@@ -14,6 +11,7 @@ import com.massivecraft.factions.util.wait.WaitedTask;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
@@ -24,10 +22,14 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author DroppingAnvil
|
||||
*/
|
||||
public class CmdWild extends FCommand implements WaitedTask {
|
||||
public static HashMap<Player, String> teleportRange;
|
||||
public static HashSet<Player> teleporting;
|
||||
public static CmdWild instance;
|
||||
public static final String tpWorld = FactionsPlugin.getInstance().getConfig().getString("Wild.World", "World");
|
||||
|
||||
public CmdWild() {
|
||||
super();
|
||||
@@ -59,12 +61,13 @@ public class CmdWild extends FCommand implements WaitedTask {
|
||||
int z = new Random().nextInt((c.getInt("Range.MaxZ") - c.getInt("Range.MinZ")) + 1) + c.getInt("Range.MinZ");
|
||||
if (Board.getInstance().getFactionAt(new FLocation(p.getWorld().getName(), x, z)).isWilderness()) {
|
||||
success = true;
|
||||
FLocation loc = new FLocation(p.getWorld().getName(), x, z);
|
||||
FLocation loc = new FLocation(tpWorld, x, z);
|
||||
teleportRange.remove(p);
|
||||
if (!FPlayers.getInstance().getByPlayer(p).takeMoney(c.getInt("Cost"))) {
|
||||
p.sendMessage(TL.GENERIC_NOTENOUGHMONEY.toString());
|
||||
return;
|
||||
}
|
||||
if (Conf.wildLoadChunkBeforeTeleport && !loc.getChunk().isLoaded()) loc.getChunk().load();
|
||||
teleportPlayer(p, loc);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author DroppingAnvil
|
||||
*/
|
||||
public class WildGUI implements FactionGUI {
|
||||
Player player;
|
||||
FPlayer fplayer;
|
||||
@@ -37,7 +40,7 @@ public class WildGUI implements FactionGUI {
|
||||
if (map.containsKey(slot)) {
|
||||
String zone = map.get(slot);
|
||||
if (fplayer.hasMoney(FactionsPlugin.getInstance().getConfig().getInt("Wild.Zones." + zone + ".Cost"))) {
|
||||
WaitExecutor.taskMap.put(player, new WaitTask(FactionsPlugin.getInstance().getConfig().getInt("Wild.Wait"), TL.COMMAND_WILD_INPROGRESS, player, CmdWild.instance));
|
||||
WaitExecutor.taskMap.put(player, new WaitTask(FactionsPlugin.getInstance().getConfig().getInt("Wild.Wait"), TL.COMMAND_WILD_WAIT, player, CmdWild.instance));
|
||||
CmdWild.teleportRange.put(player, zone);
|
||||
fplayer.msg(TL.COMMAND_WILD_WAIT, FactionsPlugin.getInstance().getConfig().getInt("Wild.Wait") + " Seconds");
|
||||
player.closeInventory();
|
||||
|
||||
@@ -140,7 +140,6 @@ public class Econ {
|
||||
|
||||
public static boolean transferMoney(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount, boolean notify) {
|
||||
if (!shouldBeUsed()) {
|
||||
invoker.msg(TL.ECON_OFF);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,12 +180,18 @@ public class FactionsBlockListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void onBlockFromTo(BlockFromToEvent event) {
|
||||
if (!Conf.handleExploitLiquidFlow) return;
|
||||
|
||||
if (event.getBlock().isLiquid()) {
|
||||
if (event.getToBlock().isEmpty()) {
|
||||
Faction from = Board.getInstance().getFactionAt(new FLocation(event.getBlock()));
|
||||
Faction to = Board.getInstance().getFactionAt(new FLocation(event.getToBlock()));
|
||||
if (from == to) return;
|
||||
// from faction != to faction
|
||||
if(to.isSystemFaction()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (to.isNormal()) {
|
||||
if (from.isNormal() && from.getRelationTo(to).isAlly()) {
|
||||
return;
|
||||
|
||||
@@ -36,6 +36,8 @@ import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -385,6 +387,10 @@ public class FactionsPlayerListener implements Listener {
|
||||
case CHEST_MINECART:
|
||||
|
||||
case BARREL:
|
||||
case COMPOSTER:
|
||||
case LOOM:
|
||||
case CARTOGRAPHY_TABLE:
|
||||
case GRINDSTONE:
|
||||
|
||||
case SHULKER_BOX:
|
||||
case BLACK_SHULKER_BOX:
|
||||
@@ -453,7 +459,6 @@ public class FactionsPlayerListener implements Listener {
|
||||
case CHIPPED_ANVIL:
|
||||
case DAMAGED_ANVIL:
|
||||
case BREWING_STAND:
|
||||
|
||||
return PermissableAction.CONTAINER;
|
||||
default:
|
||||
return null;
|
||||
@@ -572,7 +577,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
}
|
||||
@Deprecated
|
||||
public void checkCanFly(FPlayer me) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight") || !FactionsPlugin.instance.getConfig().getBoolean("ffly.AutoEnable"))
|
||||
if (!FactionsPlugin.factionsFlight || !FactionsPlugin.instance.getConfig().getBoolean("ffly.AutoEnable"))
|
||||
return;
|
||||
if (me.isFlying()) return;
|
||||
if (me.getPlayer().hasPermission(Permission.FLY_FLY.node)) {
|
||||
@@ -841,15 +846,12 @@ public class FactionsPlayerListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onInventorySee(InventoryClickEvent e) {
|
||||
if (e.getCurrentItem() == null)
|
||||
return;
|
||||
|
||||
if (!e.getView().getTitle().endsWith("'s Inventory"))
|
||||
return;
|
||||
|
||||
if (e.getCurrentItem() == null) return;
|
||||
if (!e.getView().getTitle().endsWith("'s Inventory")) return;
|
||||
e.setCancelled(true);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerBoneMeal(PlayerInteractEvent event) {
|
||||
Block block = event.getClickedBlock();
|
||||
@@ -969,7 +971,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
if (badGuy == null) return;
|
||||
|
||||
// if player was banned (not just kicked), get rid of their stored info
|
||||
if (Conf.removePlayerDataWhenBanned && event.getReason().equals("Banned by admin.")) {
|
||||
if (Conf.removePlayerDataWhenBanned && event.getReason().equals(Conf.removePlayerDataWhenBannedReason)) {
|
||||
if (badGuy.getRole() == Role.LEADER) badGuy.getFaction().promoteNewLeader();
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ public class FInfoSidebar extends FSidebarProvider {
|
||||
|
||||
ListIterator<String> it = lines.listIterator();
|
||||
while (it.hasNext()) {
|
||||
it.set(replaceTags(faction, fplayer, it.next()));
|
||||
String next = it.next();
|
||||
if (next == null) {
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
String replaced = replaceTags(faction, fplayer, next);
|
||||
if (replaced == null) {
|
||||
it.remove();
|
||||
} else {
|
||||
it.set(replaced);
|
||||
}
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
@@ -210,8 +210,12 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
|
||||
return String.valueOf(faction.getMaxVaults());
|
||||
case "faction_relation_color":
|
||||
return fPlayer.getColorTo(faction).toString();
|
||||
case "faction_grace_time":
|
||||
return String.valueOf(TimerManager.getRemaining(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining(), true));
|
||||
case "grace_time":
|
||||
if(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining() >= 0) {
|
||||
return String.valueOf(TimerManager.getRemaining(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining(), true));
|
||||
} else {
|
||||
return TL.GRACE_DISABLED_PLACEHOLDER.toString();
|
||||
}
|
||||
case "faction_name_at_location":
|
||||
Faction factionAtLocation = Board.getInstance().getFactionAt(new FLocation(player.getLocation()));
|
||||
return factionAtLocation != null ? factionAtLocation.getTag() : Factions.getInstance().getWilderness().getTag();
|
||||
|
||||
@@ -85,6 +85,7 @@ public class MiscUtil {
|
||||
for (char c : str.toCharArray()) {
|
||||
if (!substanceChars.contains(String.valueOf(c))) {
|
||||
errors.add(FactionsPlugin.getInstance().txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class UtilFly {
|
||||
*/
|
||||
@Deprecated
|
||||
public static void run() {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight"))
|
||||
if (!FactionsPlugin.factionsFlight)
|
||||
return;
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(FactionsPlugin.getInstance(), () -> {
|
||||
@@ -28,7 +28,7 @@ public class UtilFly {
|
||||
|
||||
@Deprecated
|
||||
public static void setFly(FPlayer fp, boolean fly, boolean silent, boolean damage) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight"))
|
||||
if (!FactionsPlugin.factionsFlight)
|
||||
return;
|
||||
|
||||
fp.getPlayer().setAllowFlight(fly);
|
||||
|
||||
@@ -8,9 +8,7 @@ import org.bukkit.entity.Player;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* Factions - Developed by Driftay.
|
||||
* All rights reserved 2020.
|
||||
* Creation Date: 4/4/2020
|
||||
* @author DroppingAnvil
|
||||
*/
|
||||
public class WaitExecutor {
|
||||
public static ConcurrentHashMap<Player, WaitTask> taskMap = new ConcurrentHashMap<>();
|
||||
|
||||
@@ -178,7 +178,6 @@ public abstract class MPlugin extends JavaPlugin {
|
||||
}
|
||||
|
||||
public void onDisable() {
|
||||
try {
|
||||
if (saveTask != null) {
|
||||
this.getServer().getScheduler().cancelTask(saveTask);
|
||||
saveTask = null;
|
||||
@@ -190,8 +189,6 @@ public abstract class MPlugin extends JavaPlugin {
|
||||
Board.getInstance().forceSave();
|
||||
}
|
||||
log("Disabled");
|
||||
} catch (IllegalPluginAccessException e) {
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FDisbandFrame {
|
||||
private Gui gui;
|
||||
|
||||
public FDisbandFrame(Faction faction) {
|
||||
this.gui = new Gui(FactionsPlugin.getInstance(), 1, "Confirm Disband");
|
||||
this.gui = new Gui(FactionsPlugin.getInstance(), 1, ChatColor.translateAlternateColorCodes('&', Objects.requireNonNull(FactionsPlugin.getInstance().getConfig().getString("f-disband-gui.title"))));
|
||||
}
|
||||
|
||||
public void buildGUI(FPlayer fPlayer) {
|
||||
|
||||
@@ -40,7 +40,8 @@ public class FactionWarpsFrame {
|
||||
int count = 0;
|
||||
for (int x = 0; x <= gui.getRows() * 9 - 1; ++x)
|
||||
GUIItems.add(new GuiItem(buildDummyItem(), e -> e.setCancelled(true)));
|
||||
slots.forEach(slot -> GUIItems.set(slot, new GuiItem(XMaterial.AIR.parseItem())));
|
||||
//We comment this out for now so it does not interfere with item placement when no warps are set
|
||||
//slots.forEach(slot -> GUIItems.set(slot, new GuiItem(XMaterial.AIR.parseItem())));
|
||||
for (final Map.Entry<String, LazyLocation> warp : fplayer.getFaction().getWarps().entrySet()) {
|
||||
if (slots.size() < fplayer.getFaction().getWarps().entrySet().size()) {
|
||||
slots.add(slots.get(slots.size() - 1) + 1);
|
||||
|
||||
@@ -728,12 +728,13 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
|
||||
public void sendFactionHereMessage(Faction from) {
|
||||
Faction toShow = Board.getInstance().getFactionAt(getLastStoodAt());
|
||||
boolean showChat = true;
|
||||
|
||||
if(Conf.worldsNoClaiming.contains(getLastStoodAt().getWorldName())) return;
|
||||
|
||||
if (showInfoBoard(toShow)) {
|
||||
FScoreboard.get(this).setTemporarySidebar(new FInfoSidebar(toShow));
|
||||
showChat = FactionsPlugin.getInstance().getConfig().getBoolean("scoreboard.also-send-chat", true);
|
||||
}
|
||||
if (showChat)
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("scoreboard.also-send-chat", true))
|
||||
this.sendMessage(FactionsPlugin.getInstance().txt.parse(TL.FACTION_LEAVE.format(from.getTag(this), toShow.getTag(this))));
|
||||
}
|
||||
|
||||
@@ -842,71 +843,72 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
}
|
||||
|
||||
public boolean canClaimForFactionAtLocation(Faction forFaction, FLocation flocation, boolean notifyFailure) {
|
||||
FactionsPlugin plugin = FactionsPlugin.getInstance();
|
||||
String error = null;
|
||||
Faction myFaction = getFaction();
|
||||
Faction currentFaction = Board.getInstance().getFactionAt(flocation);
|
||||
int ownedLand = forFaction.getLandRounded();
|
||||
int factionBuffer = FactionsPlugin.getInstance().getConfig().getInt("hcf.buffer-zone", 0);
|
||||
int worldBuffer = FactionsPlugin.getInstance().getConfig().getInt("world-border.buffer", 0) - 1;
|
||||
int factionBuffer = plugin.getConfig().getInt("hcf.buffer-zone", 0);
|
||||
int worldBuffer = plugin.getConfig().getInt("world-border.buffer", 0) - 1;
|
||||
|
||||
if (Conf.worldGuardChecking && Worldguard.getInstance().checkForRegionsInChunk(flocation) && !this.isAdminBypassing()) {
|
||||
if (Conf.worldGuardChecking && Worldguard.getInstance().checkForRegionsInChunk(flocation)) {
|
||||
// Checks for WorldGuard regions in the chunk attempting to be claimed
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_PROTECTED.toString());
|
||||
} else if (flocation.isOutsideWorldBorder(FactionsPlugin.getInstance().getConfig().getInt("world-border.buffer", 0) - 1)) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_PROTECTED.toString());
|
||||
} else if (flocation.isOutsideWorldBorder(plugin.getConfig().getInt("world-border.buffer", 0) - 1)) {
|
||||
error = plugin.txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
|
||||
} else if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_DISABLED.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_DISABLED.toString());
|
||||
} else if (this.isAdminBypassing()) {
|
||||
return true;
|
||||
} else if (forFaction.isSafeZone() && Permission.MANAGE_SAFE_ZONE.has(getPlayer())) {
|
||||
return true;
|
||||
} else if (forFaction.isWarZone() && Permission.MANAGE_WAR_ZONE.has(getPlayer())) {
|
||||
return true;
|
||||
} else if (currentFaction.getAccess(this, PermissableAction.TERRITORY) == Access.ALLOW) {
|
||||
} else if (currentFaction.getAccess(this, PermissableAction.TERRITORY) == Access.ALLOW && forFaction != currentFaction ) {
|
||||
return true;
|
||||
} else if (myFaction != forFaction) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_CANTCLAIM.toString(), forFaction.describeTo(this));
|
||||
error = plugin.txt.parse(TL.CLAIM_CANTCLAIM.toString(), forFaction.describeTo(this));
|
||||
} else if (forFaction == currentFaction) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_ALREADYOWN.toString(), forFaction.describeTo(this, true));
|
||||
error = plugin.txt.parse(TL.CLAIM_ALREADYOWN.toString(), forFaction.describeTo(this, true));
|
||||
} else if (forFaction.getFPlayers().size() < Conf.claimsRequireMinFactionMembers) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_MEMBERS.toString(), Conf.claimsRequireMinFactionMembers);
|
||||
error = plugin.txt.parse(TL.CLAIM_MEMBERS.toString(), Conf.claimsRequireMinFactionMembers);
|
||||
} else if (currentFaction.isSafeZone()) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_SAFEZONE.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_SAFEZONE.toString());
|
||||
} else if (currentFaction.isWarZone()) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_WARZONE.toString());
|
||||
} else if (FactionsPlugin.getInstance().getConfig().getBoolean("hcf.allow-overclaim", true) && ownedLand >= forFaction.getPowerRounded()) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_POWER.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_WARZONE.toString());
|
||||
} else if (plugin.getConfig().getBoolean("hcf.allow-overclaim", true) && ownedLand >= forFaction.getPowerRounded()) {
|
||||
error = plugin.txt.parse(TL.CLAIM_POWER.toString());
|
||||
} else if (Conf.claimedLandsMax != 0 && ownedLand >= Conf.claimedLandsMax && forFaction.isNormal()) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_LIMIT.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_LIMIT.toString());
|
||||
} else if (currentFaction.getRelationTo(forFaction) == Relation.ALLY) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_ALLY.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_ALLY.toString());
|
||||
} else if (Conf.claimsMustBeConnected && !this.isAdminBypassing() && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.getInstance().isConnectedLocation(flocation, myFaction) && (!Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction || !currentFaction.isNormal())) {
|
||||
if (Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_CONTIGIOUS.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_CONTIGIOUS.toString());
|
||||
} else {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_FACTIONCONTIGUOUS.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_FACTIONCONTIGUOUS.toString());
|
||||
}
|
||||
} else if (factionBuffer > 0 && Board.getInstance().hasFactionWithin(flocation, myFaction, factionBuffer)) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_TOOCLOSETOOTHERFACTION.format(factionBuffer));
|
||||
error = plugin.txt.parse(TL.CLAIM_TOOCLOSETOOTHERFACTION.format(factionBuffer));
|
||||
} else if (flocation.isOutsideWorldBorder(worldBuffer)) {
|
||||
if (worldBuffer > 0) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_OUTSIDEBORDERBUFFER.format(worldBuffer));
|
||||
error = plugin.txt.parse(TL.CLAIM_OUTSIDEBORDERBUFFER.format(worldBuffer));
|
||||
} else {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
|
||||
}
|
||||
} else if (currentFaction.isNormal()) {
|
||||
if (myFaction.isPeaceful()) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_PEACEFUL.toString(), currentFaction.getTag(this));
|
||||
error = plugin.txt.parse(TL.CLAIM_PEACEFUL.toString(), currentFaction.getTag(this));
|
||||
} else if (currentFaction.isPeaceful()) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_PEACEFULTARGET.toString(), currentFaction.getTag(this));
|
||||
error = plugin.txt.parse(TL.CLAIM_PEACEFULTARGET.toString(), currentFaction.getTag(this));
|
||||
} else if (!currentFaction.hasLandInflation()) {
|
||||
// TODO more messages WARN current faction most importantly
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_THISISSPARTA.toString(), currentFaction.getTag(this));
|
||||
} else if (currentFaction.hasLandInflation() && !FactionsPlugin.getInstance().getConfig().getBoolean("hcf.allow-overclaim", true)) {
|
||||
error = plugin.txt.parse(TL.CLAIM_THISISSPARTA.toString(), currentFaction.getTag(this));
|
||||
} else if (currentFaction.hasLandInflation() && !plugin.getConfig().getBoolean("hcf.allow-overclaim", true)) {
|
||||
// deny over claim when it normally would be allowed.
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_OVERCLAIM_DISABLED.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_OVERCLAIM_DISABLED.toString());
|
||||
} else if (!Board.getInstance().isBorderLocation(flocation)) {
|
||||
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_BORDER.toString());
|
||||
error = plugin.txt.parse(TL.CLAIM_BORDER.toString());
|
||||
}
|
||||
}
|
||||
// TODO: Add more else if statements.
|
||||
@@ -961,7 +963,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
}
|
||||
|
||||
public void setFFlying(boolean fly, boolean damage) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight"))
|
||||
if (!FactionsPlugin.factionsFlight)
|
||||
return;
|
||||
|
||||
Player player = getPlayer();
|
||||
|
||||
@@ -470,7 +470,7 @@ public enum TL {
|
||||
COMMAND_INVITE_TOINVITE("to invite someone"),
|
||||
COMMAND_INVITE_FORINVITE("for inviting someone"),
|
||||
COMMAND_INVITE_CLICKTOJOIN("Click to join!"),
|
||||
COMMAND_INVITE_INVITEDYOU(" &chas invited you to join "),
|
||||
COMMAND_INVITE_INVITEDYOU("&l[!]&7 &c%1$s&7 has invited you to join &c%2$s&7"),
|
||||
COMMAND_INVITE_INVITED("&c&l[!]&7 &c%1$s&7 invited &c%2$s&7 to your faction."),
|
||||
COMMAND_ALTINVITE_INVITED_ALT("&c&l[!]&7 &c%1$s&7 invited &c%2$s&7 to your faction as an alt."),
|
||||
|
||||
@@ -972,7 +972,7 @@ public enum TL {
|
||||
COMMAND_UNBAN_NOTBANNED("&7%s &cisn't banned. Not doing anything."),
|
||||
COMMAND_UNBAN_TARGET_IN_OTHER_FACTION("&c%1$s is not in your faction!"),
|
||||
COMMAND_UNBAN_UNBANNED("&e%1$s &cunbanned &7%2$s"),
|
||||
COMMAND_UNBAN_TARGET("&aYou were unbanned from &r%s"),
|
||||
COMMAND_UNBAN_TARGETUNBANNED("&aYou were unbanned from &r%s"),
|
||||
|
||||
COMMAND_UNCLAIM_SAFEZONE_SUCCESS("Safe zone was unclaimed."),
|
||||
COMMAND_UNCLAIM_SAFEZONE_NOPERM("This is a safe zone. You lack permissions to unclaim."),
|
||||
@@ -1121,6 +1121,7 @@ public enum TL {
|
||||
GENERIC_YOUMUSTBE("&cYour must be atleast %1$s to do this!"),
|
||||
GENERIC_MEMBERONLY("&cYou must be in a faction to do this!"),
|
||||
GENERIC_WORLDGUARD("&cThis area is worldguard protected."),
|
||||
GRACE_DISABLED_PLACEHOLDER("Disabled"),
|
||||
|
||||
// MISSION_CREATED_COOLDOWN("&c&l[!] &7Due to your immediate faction creation, you may not start missions for &b%1$s minutes&7!"),
|
||||
MISSION_MISSION_STARTED("&f%1$s &dstarted the %2$s &fmission"),
|
||||
|
||||
@@ -362,7 +362,9 @@ help:
|
||||
- '&c/f banlist &8- &7List banned players from your faction.'
|
||||
- '&c/f lowpower &8- &7List player with power under max from your faction.'
|
||||
- '&c/f coords &8- &7Broadcast your location to your faction.'
|
||||
#THIS IS AFFILIATED WITH F PERMS PERMISSION (TERRITORY) LOL
|
||||
- '&c/f showclaims &8- &7List all claims from your faction.'
|
||||
#THIS IS AFFILIATED WITH F PERMS PERMISSION (TERRITORY) LOL
|
||||
- '&7&m--------------------&r &e/f help 2 &7&m-----------------------'
|
||||
'2':
|
||||
- '&7&m----------------------------------------------------'
|
||||
@@ -600,6 +602,7 @@ fwarp-gui:
|
||||
faction-creation-broadcast: true #Disabling this will not make faction creation broadcasts appear in chat.
|
||||
faction-disband-broadcast: true #Disabling this will not make faction disband broadcasts appear in chat.
|
||||
faction-open-broadcast: true #Disabling this will not make faction open broadcasts appear in chat.
|
||||
faction-leader-broadcast: true #Disabling this will not make leader changes appear in chat.
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
@@ -753,6 +756,7 @@ Falling-Block-Fix:
|
||||
# +------------------------------------------------------+ #
|
||||
############################################################
|
||||
f-disband-gui:
|
||||
title: '&7Confirm Disband'
|
||||
confirm-item:
|
||||
Type: LIME_STAINED_GLASS_PANE
|
||||
Name: '&a&lConfirm'
|
||||
@@ -1434,6 +1438,8 @@ Wild:
|
||||
Enabled: true
|
||||
# Time to wait in seconds #
|
||||
Wait: 5
|
||||
# World players will be teleported to #
|
||||
World: 'World'
|
||||
# General GUI Settings #
|
||||
GUI:
|
||||
Name: 'Teleporter'
|
||||
|
||||
Reference in New Issue
Block a user