Saber Factions Initiated

This commit is contained in:
Driftay
2019-06-28 21:49:46 -04:00
parent 1fd3220e5e
commit 2c5a501d0e
120 changed files with 676 additions and 743 deletions

View File

@@ -2,7 +2,6 @@ package com.massivecraft.factions;
import com.google.common.collect.ImmutableMap;
import com.massivecraft.factions.integration.dynmap.DynmapStyle;
import com.massivecraft.factions.util.MultiversionMaterials;
import com.massivecraft.factions.zcore.fperms.DefaultPermissions;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@@ -372,24 +371,24 @@ public class Conf {
// Config is not loading if value is empty ???
territoryBypasssProtectedMaterials.add(Material.COOKIE);
territoryDenyUseageMaterials.add(SavageFactions.plugin.FIREBALL);
territoryDenyUseageMaterials.add(SaberFactions.plugin.FIREBALL);
territoryDenyUseageMaterials.add(Material.FLINT_AND_STEEL);
territoryDenyUseageMaterials.add(Material.BUCKET);
territoryDenyUseageMaterials.add(Material.WATER_BUCKET);
territoryDenyUseageMaterials.add(Material.LAVA_BUCKET);
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
territoryDenyUseageMaterials.add(Material.ARMOR_STAND);
}
territoryProtectedMaterialsWhenOffline.add(Material.BEACON);
territoryDenyUseageMaterialsWhenOffline.add(SavageFactions.plugin.FIREBALL);
territoryDenyUseageMaterialsWhenOffline.add(SaberFactions.plugin.FIREBALL);
territoryDenyUseageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL);
territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET);
territoryDenyUseageMaterialsWhenOffline.add(Material.WATER_BUCKET);
territoryDenyUseageMaterialsWhenOffline.add(Material.LAVA_BUCKET);
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
territoryDenyUseageMaterialsWhenOffline.add(Material.ARMOR_STAND);
}
safeZoneNerfedCreatureTypes.add(EntityType.BLAZE);
@@ -416,11 +415,11 @@ public class Conf {
}
public static void load() {
SavageFactions.plugin.persist.loadOrSaveDefault(i, Conf.class, "conf");
SaberFactions.plugin.persist.loadOrSaveDefault(i, Conf.class, "conf");
}
public static void save() {
SavageFactions.plugin.persist.save(i);
SaberFactions.plugin.persist.save(i);
}
public enum Backend {

View File

@@ -47,11 +47,11 @@ import java.util.logging.Level;
import java.util.stream.Collectors;
public class SavageFactions extends MPlugin {
public class SaberFactions extends MPlugin {
// Our single plugin instance.
// Single 4 life.
public static SavageFactions plugin;
public static SaberFactions plugin;
public static Permission perms = null;
// This plugin sets the boolean true when fully enabled.
// Plugins can check this boolean while hooking in have
@@ -86,7 +86,7 @@ public class SavageFactions extends MPlugin {
private Listener[] eventsListener;
public static Economy econ = null;
public SavageFactions() {
public SaberFactions() {
plugin = this;
}
@@ -147,20 +147,20 @@ public class SavageFactions extends MPlugin {
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
switch (version) {
case 7:
SavageFactions.plugin.log("Minecraft Version 1.7 found, disabling banners, itemflags inside GUIs, and Titles.");
SaberFactions.plugin.log("Minecraft Version 1.7 found, disabling banners, itemflags inside GUIs, and Titles.");
mc17 = true;
break;
case 8:
SavageFactions.plugin.log("Minecraft Version 1.8 found, Title Fadeouttime etc will not be configurable.");
SaberFactions.plugin.log("Minecraft Version 1.8 found, Title Fadeouttime etc will not be configurable.");
mc18 = true;
break;
case 13:
SavageFactions.plugin.log("Minecraft Version 1.13 found, New Items will be used.");
SaberFactions.plugin.log("Minecraft Version 1.13 found, New Items will be used.");
mc113 = true;
changeItemIDSInConfig();
break;
case 14:
SavageFactions.plugin.log("Minecraft Version 1.14 found.");
SaberFactions.plugin.log("Minecraft Version 1.14 found.");
mc114 = true;
changeItemIDSInConfig();
break;
@@ -229,7 +229,7 @@ public class SavageFactions extends MPlugin {
}
if (getServer().getPluginManager().getPlugin("Skript") != null) {
log("Skript was found! Registering SavageFactions Addon...");
log("Skript was found! Registering SaberFactions Addon...");
skriptAddon = Skript.registerAddon(this);
try {
skriptAddon.loadClasses("com.massivecraft.factions.skript", "expressions");
@@ -262,14 +262,14 @@ public class SavageFactions extends MPlugin {
getCommand(this.refCommand).setTabCompleter(this);
RegisteredServiceProvider<Economy> rsp = SavageFactions.this.getServer().getServicesManager().getRegistration(Economy.class);
SavageFactions.econ = rsp.getProvider();
RegisteredServiceProvider<Economy> rsp = SaberFactions.this.getServer().getServicesManager().getRegistration(Economy.class);
SaberFactions.econ = rsp.getProvider();
if (getDescription().getFullName().contains("BETA")) {
divider();
System.out.println("You are using a BETA version of the plugin!");
System.out.println("This comes with risks of small bugs in newer features!");
System.out.println("For support head to: https://github.com/ProSavage/SavageFactions/issues");
System.out.println("For support head to: https://github.com/ProSavage/SaberFactions/issues");
divider();
}
@@ -277,7 +277,7 @@ public class SavageFactions extends MPlugin {
this.postEnable();
this.loadSuccessful = true;
// Set startup finished to true. to give plugins hooking in a greenlight
SavageFactions.startupFinished = true;
SaberFactions.startupFinished = true;
}
public SkriptAddon getSkriptAddon() {
@@ -417,7 +417,7 @@ public class SavageFactions extends MPlugin {
public void replaceStringInConfig(String path, String stringToReplace, String replacementString) {
if (getConfig().getString(path).equals(stringToReplace)) {
// SavageFactions.plugin.log("Replacing legacy material '" + stringToReplace + "' with '" + replacementString + "' for config node '" + path + "'.");
// SaberFactions.plugin.log("Replacing legacy material '" + stringToReplace + "' with '" + replacementString + "' for config node '" + path + "'.");
// log("Replacing legacy material '" + stringToReplace + "' with '" + replacementString + "' for config node '" + path + "'.");
getConfig().set(path, replacementString);
@@ -522,14 +522,14 @@ public class SavageFactions extends MPlugin {
public ItemStack createLazyItem(Material material, int amount, short datavalue, String name, String lore) {
ItemStack item = new ItemStack(material, amount, datavalue);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(color(SavageFactions.plugin.getConfig().getString(name)));
meta.setLore(colorList(SavageFactions.plugin.getConfig().getStringList(lore)));
meta.setDisplayName(color(SaberFactions.plugin.getConfig().getString(name)));
meta.setLore(colorList(SaberFactions.plugin.getConfig().getStringList(lore)));
item.setItemMeta(meta);
return item;
}
public Economy getEcon() {
RegisteredServiceProvider<Economy> rsp = SavageFactions.plugin.getServer().getServicesManager().getRegistration(Economy.class);
RegisteredServiceProvider<Economy> rsp = SaberFactions.plugin.getServer().getServicesManager().getRegistration(Economy.class);
Economy econ = rsp.getProvider();
return econ;
}
@@ -614,11 +614,11 @@ public class SavageFactions extends MPlugin {
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(SavageFactions.plugin.color(text)); //Set this to the text you want
as.setCustomName(SaberFactions.plugin.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(SavageFactions.plugin, () -> {
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> {
armorStand.remove();
getLogger().info("Removing Hologram.");
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -35,13 +35,13 @@ public class CmdAlts extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("f-alts.Enabled", false)) {
if (!SaberFactions.plugin.getConfig().getBoolean("f-alts.Enabled", false)) {
fme.msg(TL.GENERIC_DISABLED);
return;
}
this.commandChain.add(this);
SavageFactions.plugin.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
SaberFactions.plugin.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
}
@Override

View File

@@ -1,16 +1,16 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.zcore.CommandVisibility;
import com.massivecraft.factions.zcore.MCommand;
import com.massivecraft.factions.zcore.util.TL;
import java.util.ArrayList;
public class CmdAutoHelp extends MCommand<SavageFactions> {
public class CmdAutoHelp extends MCommand<SaberFactions> {
public CmdAutoHelp() {
super(SavageFactions.plugin);
super(SaberFactions.plugin);
this.aliases.add("?");
this.aliases.add("h");
this.aliases.add("help");

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.event.FPlayerLeaveEvent;
import com.massivecraft.factions.struct.BanInfo;
import com.massivecraft.factions.struct.Permission;
@@ -81,7 +81,7 @@ public class CmdBan extends FCommand {
if (event.isCancelled()) {
// if someone cancels a ban, we'll get people complaining here. So lets log it.
SavageFactions.plugin.log(Level.WARNING, "Attempted to ban {0} but someone cancelled the kick event. This isn't good.", target.getName());
SaberFactions.plugin.log(Level.WARNING, "Attempted to ban {0} but someone cancelled the kick event. This isn't good.", target.getName());
return;
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import net.milkbowl.vault.economy.Economy;
@@ -32,30 +32,30 @@ public class CmdBanner extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
msg(TL.COMMAND_BANNER_DISABLED);
return;
}
if (!fme.hasMoney(SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
if (!fme.hasMoney(SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
msg(TL.COMMAND_BANNER_NOTENOUGHMONEY);
return;
}
takeMoney(fme, SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000));
takeMoney(fme, SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000));
//ItemStack warBanner = SavageFactions.plugin.createItem(Material.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
//ItemStack warBanner = SaberFactions.plugin.createItem(Material.BANNER, 1, (short) 1, SaberFactions.plugin.getConfig().getString("fbanners.Item.Name"), SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
//BannerMeta bannerMeta = (BannerMeta) warBanner.getItemMeta();
ItemStack warBanner = fme.getFaction().getBanner();
if (warBanner != null) {
ItemMeta warmeta = warBanner.getItemMeta();
warmeta.setDisplayName(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
warmeta.setDisplayName(SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
warBanner.setItemMeta(warmeta);
} else {
warBanner = SavageFactions.plugin.createItem(SavageFactions.plugin.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
warBanner = SaberFactions.plugin.createItem(SaberFactions.plugin.BANNER, 1, (short) 1, SaberFactions.plugin.getConfig().getString("fbanners.Item.Name"), SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
}
fme.msg(TL.COMMAND_BANNER_SUCCESS);
warBanner.setAmount(1);
@@ -64,7 +64,7 @@ public class CmdBanner extends FCommand {
public boolean hasMoney(FPlayer fme, int amt) {
Economy econ = SavageFactions.plugin.getEcon();
Economy econ = SaberFactions.plugin.getEcon();
if (econ.getBalance(fme.getPlayer()) >= amt) {
return true;
} else {
@@ -75,7 +75,7 @@ public class CmdBanner extends FCommand {
public void takeMoney(FPlayer fme, int amt) {
if (hasMoney(fme, amt)) {
Economy econ = SavageFactions.plugin.getEcon();
Economy econ = SaberFactions.plugin.getEcon();
econ.withdrawPlayer(fme.getPlayer(), amt);
fme.sendMessage(TL.COMMAND_BANNER_MONEYTAKE.toString().replace("{amount}", amt + ""));
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -30,10 +30,10 @@ public class CmdBypass extends FCommand {
// TODO: Move this to a transient field in the model??
if (fme.isAdminBypassing()) {
fme.msg(TL.COMMAND_BYPASS_ENABLE.toString());
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
} else {
fme.msg(TL.COMMAND_BYPASS_DISABLE.toString());
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
}
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -28,10 +28,10 @@ public class CmdChatSpy extends FCommand {
if (fme.isSpyingChat()) {
fme.msg(TL.COMMAND_CHATSPY_ENABLE);
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_ENABLELOG.toString());
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_ENABLELOG.toString());
} else {
fme.msg(TL.COMMAND_CHATSPY_DISABLE);
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_DISABLELOG.toString());
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_DISABLELOG.toString());
}
}

View File

@@ -26,7 +26,7 @@ public class CmdCheckpoint extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("checkpoints.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("checkpoints.Enabled")) {
fme.msg(TL.COMMAND_CHECKPOINT_DISABLED);
return;
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -30,7 +30,7 @@ public class CmdChest extends FCommand {
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fchest.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fchest.Enabled")) {
fme.sendMessage("This command is disabled!");
return;
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
@@ -231,10 +231,10 @@ public class CmdConfig extends FCommand {
if (!success.isEmpty()) {
if (sender instanceof Player) {
sendMessage(success);
SavageFactions.plugin.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
} else // using SavageFactions.plugin.log() instead of sendMessage if run from server console so that "[Factions v#.#.#]" is prepended in server log
SaberFactions.plugin.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
} else // using SaberFactions.plugin.log() instead of sendMessage if run from server console so that "[Factions v#.#.#]" is prepended in server log
{
SavageFactions.plugin.log(success);
SaberFactions.plugin.log(success);
}
}
// save change to disk

View File

@@ -5,7 +5,6 @@ import com.massivecraft.factions.*;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.CornerTask;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import java.util.ArrayList;
import java.util.Comparator;
@@ -27,7 +26,7 @@ public class CmdCorner extends FCommand {
@Override
public void perform() {
FLocation to = new FLocation(me.getLocation());
if (SavageFactions.plugin.getFactionsPlayerListener().getCorners().contains(to)) {
if (SaberFactions.plugin.getFactionsPlayerListener().getCorners().contains(to)) {
Faction cornerAt = Board.getInstance().getFactionAt(to);
if (cornerAt != null && cornerAt.isNormal() && !cornerAt.equals(fme.getFaction())) {
msg(TL.COMMAND_CORNER_CANT_CLAIM);
@@ -49,7 +48,7 @@ public class CmdCorner extends FCommand {
if (surrounding.isEmpty()) {
msg(TL.COMMAND_CORNER_CANT_CLAIM);
} else {
new CornerTask(fme, surrounding).runTaskTimer(SavageFactions.plugin, 1L, 1L);
new CornerTask(fme, surrounding).runTaskTimer(SaberFactions.plugin, 1L, 1L);
}
}
} else {

View File

@@ -97,7 +97,7 @@ public class CmdCreate extends FCommand {
// That way we don't have to mess up deleting more stuff.
// And prevent the user from being returned to NORMAL after deleting his old faction.
fme.setRole(Role.LEADER);
if (SavageFactions.plugin.getConfig().getBoolean("faction-creation-broadcast", true)) {
if (SaberFactions.plugin.getConfig().getBoolean("faction-creation-broadcast", true)) {
for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
follower.msg(TL.COMMAND_CREATE_CREATED, fme.describeTo(follower, true), faction.getTag(follower));
}
@@ -109,13 +109,13 @@ public class CmdCreate extends FCommand {
}
if (Conf.logFactionCreate) {
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
SaberFactions.plugin.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
}
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
if (SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
this.fme.msg(TL.COMMAND_PAYPALSET_CREATED);
}
fme.setCooldown("create", System.currentTimeMillis() + (SavageFactions.plugin.getConfig().getInt("fcooldowns.f-create") * 1000));
fme.setCooldown("create", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-create") * 1000));
if (Conf.useCustomDefaultPermissions) {
faction.setDefaultPerms();

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -35,7 +35,7 @@ public class CmdDelFWarp extends FCommand {
}
private boolean transact(FPlayer player) {
return !SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.delwarp", 5), TL.COMMAND_DELFWARP_TODELETE.toString(), TL.COMMAND_DELFWARP_FORDELETE.toString());
return !SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SaberFactions.plugin.getConfig().getDouble("warp-cost.delwarp", 5), TL.COMMAND_DELFWARP_TODELETE.toString(), TL.COMMAND_DELFWARP_FORDELETE.toString());
}
@Override

View File

@@ -87,15 +87,15 @@ public class CmdDisband extends FCommand {
if (!disbandMap.containsKey(me.getUniqueId().toString()) && faction.getTnt() > 0) {
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
disbandMap.put(me.getUniqueId().toString(), faction.getId());
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, () -> disbandMap.remove(me.getUniqueId().toString()), 200L);
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> disbandMap.remove(me.getUniqueId().toString()), 200L);
} else if (faction.getId().equals(disbandMap.get(me.getUniqueId().toString())) || faction.getTnt() == 0) {
if (SavageFactions.plugin.getConfig().getBoolean("faction-disband-broadcast", true)) {
if (SaberFactions.plugin.getConfig().getBoolean("faction-disband-broadcast", true)) {
for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
String amountString = senderIsConsole ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(follower);
UtilFly.checkFly(this.fme, Board.getInstance().getFactionAt(new FLocation(follower)));
if (follower.getFaction() == faction) {
follower.msg(TL.COMMAND_DISBAND_BROADCAST_YOURS, amountString);
fme.setCooldown("disband", System.currentTimeMillis() + (SavageFactions.plugin.getConfig().getInt("fcooldowns.f-disband") * 1000));
fme.setCooldown("disband", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-disband") * 1000));
} else {
follower.msg(TL.COMMAND_DISBAND_BROADCAST_NOTYOURS, amountString, faction.getTag(follower));
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.WarmUpUtil;
@@ -80,7 +80,7 @@ public class CmdFWarp extends FCommand {
}
private boolean transact(FPlayer player) {
return !SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.warp", 5), TL.COMMAND_FWARP_TOWARP.toString(), TL.COMMAND_FWARP_FORWARPING.toString());
return !SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SaberFactions.plugin.getConfig().getDouble("warp-cost.warp", 5), TL.COMMAND_FWARP_TOWARP.toString(), TL.COMMAND_FWARP_FORWARPING.toString());
}
@Override

View File

@@ -39,11 +39,11 @@ public class CmdFly extends FCommand {
public static void startParticles() {
// Just a secondary check.
if (!SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
return;
}
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, () -> {
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> {
for (String name : flyMap.keySet()) {
Player player = Bukkit.getPlayer(name);
if (player == null) {
@@ -52,7 +52,7 @@ public class CmdFly extends FCommand {
if (!player.isFlying()) {
continue;
}
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
if (player.getGameMode() == GameMode.SPECTATOR) {
continue;
}
@@ -61,12 +61,12 @@ public class CmdFly extends FCommand {
if (FPlayers.getInstance().getByPlayer(player).isVanished()) {
// Actually, vanished players (such as admins) should not display particles to prevent others from knowing their vanished assistance for moderation.
// But we can keep it as a config.
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enable-While-Vanished")) {
if (SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enable-While-Vanished")) {
return;
}
continue;
}
if (SavageFactions.plugin.useNonPacketParticles) {
if (SaberFactions.plugin.useNonPacketParticles) {
// 1.9+ based servers will use the built in particleAPI instead of packet based.
// any particle amount higher than 0 made them go everywhere, and the offset at 0 was not working.
// So setting the amount to 0 spawns 1 in the precise location
@@ -84,7 +84,7 @@ public class CmdFly extends FCommand {
}
public static void startFlyCheck() {
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, () -> { //threw the exception for now, until I recode fly :( Cringe.
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> { //threw the exception for now, until I recode fly :( Cringe.
checkTaskState();
if (flyMap.keySet().size() != 0) {
for (String name : flyMap.keySet()) {
@@ -95,7 +95,7 @@ public class CmdFly extends FCommand {
if (player == null
|| !player.isFlying()
|| player.getGameMode() == GameMode.CREATIVE
|| !SavageFactions.plugin.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
|| !SaberFactions.plugin.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
continue;
}
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
@@ -171,7 +171,7 @@ public class CmdFly extends FCommand {
@Override
public void perform() {
// Disabled by default.
if (!SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
if (!SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
fme.msg(TL.COMMAND_FLY_DISABLED);
return;
}
@@ -212,7 +212,7 @@ public class CmdFly extends FCommand {
fme.setFlying(true);
flyMap.put(player.getName(), true);
if (id == -1) {
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
if (SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
startParticles();
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.scoreboards.FTeamWrapper;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -24,7 +24,7 @@ public class CmdFocus
}
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) {
fme.msg(TL.GENERIC_DISABLED);
return;
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Location;
@@ -27,12 +27,12 @@ public class CmdGetVault extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
fme.sendMessage("This command is disabled!");
return;
}
Location vaultLocation = fme.getFaction().getVault();
ItemStack vault = SavageFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fvault.Item.Name")), SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
ItemStack vault = SaberFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fvault.Item.Name")), SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
//check if vault is set
@@ -43,7 +43,7 @@ public class CmdGetVault extends FCommand {
//has enough money?
int amount = SavageFactions.plugin.getConfig().getInt("fvault.Price");
int amount = SaberFactions.plugin.getConfig().getInt("fvault.Price");
if (!fme.hasMoney(amount)) {
return;
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -23,7 +23,7 @@ public class CmdGrace extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) {
fme.msg(TL.GENERIC_DISABLED);
return;
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -40,7 +40,7 @@ public class CmdHelp extends FCommand {
@Override
public void perform() {
if (SavageFactions.plugin.getConfig().getBoolean("use-old-help", true)) {
if (SaberFactions.plugin.getConfig().getBoolean("use-old-help", true)) {
if (helpPages == null) {
updateHelp();
}
@@ -57,9 +57,9 @@ public class CmdHelp extends FCommand {
sendMessage(helpPages.get(page));
return;
}
ConfigurationSection help = SavageFactions.plugin.getConfig().getConfigurationSection("help");
ConfigurationSection help = SaberFactions.plugin.getConfig().getConfigurationSection("help");
if (help == null) {
help = SavageFactions.plugin.getConfig().createSection("help"); // create new help section
help = SaberFactions.plugin.getConfig().createSection("help"); // create new help section
List<String> error = new ArrayList<>();
error.add("&cUpdate help messages in config.yml!");
error.add("&cSet use-old-help for legacy help messages");
@@ -72,7 +72,7 @@ public class CmdHelp extends FCommand {
return;
}
for (String helpLine : page) {
sendMessage(SavageFactions.plugin.txt.parse(helpLine));
sendMessage(SaberFactions.plugin.txt.parse(helpLine));
}
}
@@ -189,7 +189,7 @@ public class CmdHelp extends FCommand {
pageLines.add(p.cmdBase.cmdSafeunclaimall.getUseageTemplate(true));
pageLines.add(p.cmdBase.cmdWarunclaimall.getUseageTemplate(true));
//TODO:TL
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + SavageFactions.plugin.txt.parse("<i>") + " works on safe/war zones as well."));
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + SaberFactions.plugin.txt.parse("<i>") + " works on safe/war zones as well."));
pageLines.add(p.cmdBase.cmdPeaceful.getUseageTemplate(true));
helpPages.add(pageLines);

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -32,7 +32,7 @@ public class CmdInviteAlt extends FCommand {
@Override
public void perform() {
if(!SavageFactions.plugin.getConfig().getBoolean("f-alts.Enabled", false)){
if(!SaberFactions.plugin.getConfig().getBoolean("f-alts.Enabled", false)){
fme.msg(TL.GENERIC_DISABLED);
return;
}

View File

@@ -83,7 +83,7 @@ public class CmdJoin extends FCommand {
if (level == 0) {
limit = Conf.factionMemberLimit;
} else {
limit = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.Members-Limit.level-" + level);
limit = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.Members-Limit.level-" + level);
}
if (limit > 0 && faction.getFPlayers().size() >= limit && !faction.altInvited(fme)) {
@@ -145,9 +145,9 @@ public class CmdJoin extends FCommand {
if (Conf.logFactionJoin) {
if (samePlayer) {
SavageFactions.plugin.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
SaberFactions.plugin.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
} else {
SavageFactions.plugin.log(TL.COMMAND_JOIN_MOVEDLOG.toString(), fme.getName(), fplayer.getName(), faction.getTag());
SaberFactions.plugin.log(TL.COMMAND_JOIN_MOVEDLOG.toString(), fme.getName(), fplayer.getName(), faction.getTag());
}
}
}

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.event.FPlayerLeaveEvent;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
@@ -68,8 +68,8 @@ public class CmdKick extends FCommand {
}
if(toKick.isAlt()){
msg(SavageFactions.plugin.color("&cToo few arguments, &eUse like this:"));
msg(SavageFactions.plugin.color("&b/f alts,alt kick &3<player name>"));
msg(SaberFactions.plugin.color("&cToo few arguments, &eUse like this:"));
msg(SaberFactions.plugin.color("&b/f alts,alt kick &3<player name>"));
return;
}
@@ -129,7 +129,7 @@ public class CmdKick extends FCommand {
fme.msg(TL.COMMAND_KICK_KICKS, toKick.describeTo(fme), toKickFaction.describeTo(fme));
}
if (Conf.logFactionKick) {
SavageFactions.plugin.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
SaberFactions.plugin.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
}
if (toKick.getRole() == Role.LEADER) {
toKickFaction.promoteNewLeader();

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.event.FPlayerLeaveEvent;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
@@ -32,7 +32,7 @@ public class CmdKickAlt extends FCommand{
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("f-alts.Enabled", false)) {
if (!SaberFactions.plugin.getConfig().getBoolean("f-alts.Enabled", false)) {
fme.msg(TL.GENERIC_DISABLED);
return;
}
@@ -126,7 +126,7 @@ public class CmdKickAlt extends FCommand{
}
if (Conf.logFactionKick) {
SavageFactions.plugin.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: "
SaberFactions.plugin.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: "
+ toKickFaction.getTag());
}
// SHOULD NOT BE POSSIBLE BUT KEPT INCASE

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagUtil;
@@ -51,7 +51,7 @@ public class CmdList extends FCommand {
// remove exempt factions
if (fme != null && fme.getPlayer() != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
List<String> exemptFactions = SavageFactions.plugin.getConfig().getStringList("show-exempt");
List<String> exemptFactions = SaberFactions.plugin.getConfig().getStringList("show-exempt");
factionList.removeIf(next -> exemptFactions.contains(next.getTag()));
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.zcore.util.TL;
public class CmdMoney extends FCommand {
@@ -41,7 +41,7 @@ public class CmdMoney extends FCommand {
@Override
public void perform() {
this.commandChain.add(this);
SavageFactions.plugin.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
SaberFactions.plugin.cmdAutoHelp.execute(this.sender, this.args, this.commandChain);
}
@Override

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -39,7 +39,7 @@ public class CmdMoneyDeposit extends FCommand {
boolean success = Econ.transferMoney(fme, fme, faction, amount);
if (success && Conf.logMoneyTransactions) {
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -50,7 +50,7 @@ public class CmdMoneyTransferFf extends FCommand {
if (success && Conf.logMoneyTransactions) {
String name = sender instanceof Player ? fme.getName() : sender.getName();
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -49,7 +49,7 @@ public class CmdMoneyTransferFp extends FCommand {
boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && Conf.logMoneyTransactions) {
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFP_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFP_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -49,7 +49,7 @@ public class CmdMoneyTransferPf extends FCommand {
boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && Conf.logMoneyTransactions) {
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERPF_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERPF_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
}
}

View File

@@ -1,8 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -54,7 +53,7 @@ public class CmdMoneyWithdraw extends FCommand {
boolean success = Econ.transferMoney(fme, faction, fme, amount);
if (success && Conf.logMoneyTransactions) {
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
SaberFactions.plugin.log(ChatColor.stripColor(SaberFactions.plugin.txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
}
}

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@@ -26,12 +26,12 @@ public class CmdNear extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fnear.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fnear.Enabled")) {
fme.msg(TL.COMMAND_NEAR_DISABLED_MSG);
return;
}
double range = SavageFactions.plugin.getConfig().getInt("fnear.Radius");
double range = SaberFactions.plugin.getConfig().getInt("fnear.Radius");
String format = TL.COMMAND_NEAR_FORMAT.toString();
fme.msg(TL.COMMAND_NEAR_USE_MSG);
for (Entity e : me.getNearbyEntities(range, 255, range)) {

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -52,7 +52,7 @@ public class CmdOpen extends FCommand {
}
fplayer.msg(TL.COMMAND_OPEN_CHANGED, myFaction.getTag(fplayer.getFaction()), open);
}
fme.setCooldown("open", System.currentTimeMillis() + (SavageFactions.plugin.getConfig().getInt("fcooldowns.f-open") * 1000));
fme.setCooldown("open", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-open") * 1000));
}
@Override

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -23,7 +23,7 @@ public class CmdPaypalSee extends FCommand {
}
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
fme.msg(TL.GENERIC_DISABLED);
return;
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -22,7 +22,7 @@ public class CmdPaypalSet extends FCommand {
}
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
fme.msg(TL.GENERIC_DISABLED);
return;
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -105,7 +105,7 @@ public class CmdPerm extends FCommand {
}
fme.msg(TL.COMMAND_PERM_SET, argAsString(1), access.name(), argAsString(0));
SavageFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), argAsString(1), access.name(), argAsString(0)) + " for faction " + fme.getTag());
SaberFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), argAsString(1), access.name(), argAsString(0)) + " for faction " + fme.getTag());
}
private Permissable getPermissable(String name) {

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -43,7 +43,7 @@ public class CmdPermanent extends FCommand {
faction.setPermanent(true);
}
SavageFactions.plugin.log((fme == null ? "A server admin" : fme.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
SaberFactions.plugin.log((fme == null ? "A server admin" : fme.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
// Inform all players
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -77,7 +77,7 @@ public class CmdPowerBoost extends FCommand {
int roundedPower = (int) Math.round(targetPower);
msg(TL.COMMAND_POWERBOOST_BOOST, target, roundedPower);
if (!senderIsConsole) {
SavageFactions.plugin.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
SaberFactions.plugin.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
}
}

View File

@@ -1,9 +1,8 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.Particles.ReflectionUtils;
import com.massivecraft.factions.zcore.util.TL;
public class CmdReload extends FCommand {
@@ -27,13 +26,13 @@ public class CmdReload extends FCommand {
long timeInitStart = System.currentTimeMillis();
Conf.load();
Conf.save();
SavageFactions.plugin.reloadConfig();
SavageFactions.plugin.changeItemIDSInConfig();
SavageFactions.plugin.loadLang();
SaberFactions.plugin.reloadConfig();
SaberFactions.plugin.changeItemIDSInConfig();
SaberFactions.plugin.loadLang();
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
SavageFactions.plugin.factionsFlight = true;
if (SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
SaberFactions.plugin.factionsFlight = true;
}
long timeReload = (System.currentTimeMillis() - timeInitStart);

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -29,19 +29,19 @@ public class CmdRules extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("frules.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("frules.Enabled")) {
fme.msg(TL.COMMAND_RULES_DISABLED_MSG);
return;
}
if (this.args.size() == 0) {
HashMap<Integer, String> rules = fme.getFaction().getRulesMap();
if (rules.size() == 0) {
List<String> ruleList = SavageFactions.plugin.getConfig().getStringList("frules.default-rules");
fme.sendMessage(SavageFactions.plugin.colorList(ruleList));
List<String> ruleList = SaberFactions.plugin.getConfig().getStringList("frules.default-rules");
fme.sendMessage(SaberFactions.plugin.colorList(ruleList));
} else {
for (int i = 0; i <= rules.size() - 1; i++) {
fme.sendMessage(SavageFactions.plugin.color(rules.get(i)));
fme.sendMessage(SaberFactions.plugin.color(rules.get(i)));
}
}

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@@ -50,7 +50,7 @@ public class CmdSafeunclaimall extends FCommand {
msg(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMED);
if (Conf.logLandUnclaims) {
SavageFactions.plugin.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
SaberFactions.plugin.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
}
}

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.Particles.ParticleEffect;
import com.massivecraft.factions.util.VisualizeUtil;
@@ -40,7 +40,7 @@ public class CmdSeeChunk extends FCommand {
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
interval = SavageFactions.plugin.getConfig().getLong("see-chunk.interval", 10L);
interval = SaberFactions.plugin.getConfig().getLong("see-chunk.interval", 10L);
if (effect == null) {
effect = ParticleEffect.REDSTONE;
}
@@ -71,7 +71,7 @@ public class CmdSeeChunk extends FCommand {
}
private void startTask() {
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, () -> {
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> {
Iterator<String> itr = seeChunkMap.keySet().iterator();
while (itr.hasNext()) {
Object nameObject = itr.next();
@@ -117,10 +117,10 @@ public class CmdSeeChunk extends FCommand {
continue;
}
if (useParticles) {
if (SavageFactions.plugin.useNonPacketParticles) {
if (SaberFactions.plugin.useNonPacketParticles) {
// Dust options only exists in the 1.13 API, so we use an
// alternative method to achieve this in lower versions.
if (SavageFactions.plugin.mc113) {
if (SaberFactions.plugin.mc113) {
player.spawnParticle(Particle.REDSTONE, loc, 0, new Particle.DustOptions(Color.RED, 1));
} else {
player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1);
@@ -132,7 +132,7 @@ public class CmdSeeChunk extends FCommand {
} else {
Material type = blockY % 5 == 0 ? SavageFactions.plugin.REDSTONE_LAMP_ON : SavageFactions.plugin.STAINED_GLASS;
Material type = blockY % 5 == 0 ? SaberFactions.plugin.REDSTONE_LAMP_ON : SaberFactions.plugin.STAINED_GLASS;
VisualizeUtil.addLocation(player, loc, type);
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
@@ -51,7 +51,7 @@ public class CmdSetFWarp extends FCommand {
// Checks if warp with same name already exists and ignores maxWarp check if it does.
boolean warpExists = myFaction.isWarp(warp);
int maxWarps = SavageFactions.plugin.getConfig().getInt("max-warps", 5);
int maxWarps = SaberFactions.plugin.getConfig().getInt("max-warps", 5);
boolean tooManyWarps = maxWarps <= myFaction.getWarps().size();
if (tooManyWarps && !warpExists) {
fme.msg(TL.COMMAND_SETFWARP_LIMIT, maxWarps);
@@ -73,7 +73,7 @@ public class CmdSetFWarp extends FCommand {
}
private boolean transact(FPlayer player) {
return !SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString(), TL.COMMAND_SETFWARP_FORSET.toString());
return !SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SaberFactions.plugin.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString(), TL.COMMAND_SETFWARP_FORSET.toString());
}
@Override

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagReplacer;
@@ -57,7 +57,7 @@ public class CmdShow extends FCommand {
return;
if (fme != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")
&& SavageFactions.plugin.getConfig().getStringList("show-exempt").contains(faction.getTag())) {
&& SaberFactions.plugin.getConfig().getStringList("show-exempt").contains(faction.getTag())) {
msg(TL.COMMAND_SHOW_EXEMPT);
return;
}
@@ -67,7 +67,7 @@ public class CmdShow extends FCommand {
return;
}
List<String> show = SavageFactions.plugin.getConfig().getStringList("show");
List<String> show = SaberFactions.plugin.getConfig().getStringList("show");
if (show == null || show.isEmpty())
show = defaults;

View File

@@ -35,11 +35,11 @@ public class CmdStuck extends FCommand {
final Player player = fme.getPlayer();
final Location sentAt = player.getLocation();
final FLocation chunk = fme.getLastStoodAt();
final long delay = SavageFactions.plugin.getConfig().getLong("hcf.stuck.delay", 30);
final int radius = SavageFactions.plugin.getConfig().getInt("hcf.stuck.radius", 10);
final long delay = SaberFactions.plugin.getConfig().getLong("hcf.stuck.delay", 30);
final int radius = SaberFactions.plugin.getConfig().getInt("hcf.stuck.radius", 10);
if (SavageFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
long wait = SavageFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
if (SaberFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
long wait = SaberFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);
msg(TL.COMMAND_STUCK_EXISTS, time);
} else {
@@ -49,11 +49,11 @@ public class CmdStuck extends FCommand {
return;
}
final int id = Bukkit.getScheduler().runTaskLater(SavageFactions.plugin, new BukkitRunnable() {
final int id = Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, new BukkitRunnable() {
@Override
public void run() {
if (!SavageFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
if (!SaberFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
return;
}
@@ -61,8 +61,8 @@ public class CmdStuck extends FCommand {
final World world = chunk.getWorld();
if (world.getUID() != player.getWorld().getUID() || sentAt.distance(player.getLocation()) > radius) {
msg(TL.COMMAND_STUCK_OUTSIDE.format(radius));
SavageFactions.plugin.getTimers().remove(player.getUniqueId());
SavageFactions.plugin.getStuckMap().remove(player.getUniqueId());
SaberFactions.plugin.getTimers().remove(player.getUniqueId());
SaberFactions.plugin.getStuckMap().remove(player.getUniqueId());
return;
}
@@ -74,18 +74,18 @@ public class CmdStuck extends FCommand {
public boolean work() {
FLocation chunk = currentFLocation();
Faction faction = board.getFactionAt(chunk);
int buffer = SavageFactions.plugin.getConfig().getInt("world-border.buffer", 0);
int buffer = SaberFactions.plugin.getConfig().getInt("world-border.buffer", 0);
if (faction.isWilderness() && !chunk.isOutsideWorldBorder(buffer)) {
int cx = FLocation.chunkToBlock((int) chunk.getX());
int cz = FLocation.chunkToBlock((int) chunk.getZ());
int y = world.getHighestBlockYAt(cx, cz);
Location tp = new Location(world, cx, y, cz);
msg(TL.COMMAND_STUCK_TELEPORT, tp.getBlockX(), tp.getBlockY(), tp.getBlockZ());
SavageFactions.plugin.getTimers().remove(player.getUniqueId());
SavageFactions.plugin.getStuckMap().remove(player.getUniqueId());
SaberFactions.plugin.getTimers().remove(player.getUniqueId());
SaberFactions.plugin.getStuckMap().remove(player.getUniqueId());
if (!Essentials.handleTeleport(player, tp)) {
player.teleport(tp);
SavageFactions.plugin.debug("/f stuck used regular teleport, not essentials!");
SaberFactions.plugin.debug("/f stuck used regular teleport, not essentials!");
}
this.stop();
return false;
@@ -96,11 +96,11 @@ public class CmdStuck extends FCommand {
}
}, delay * 20).getTaskId();
SavageFactions.plugin.getTimers().put(player.getUniqueId(), System.currentTimeMillis() + (delay * 1000));
long wait = SavageFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
SaberFactions.plugin.getTimers().put(player.getUniqueId(), System.currentTimeMillis() + (delay * 1000));
long wait = SaberFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);
msg(TL.COMMAND_STUCK_START, time);
SavageFactions.plugin.getStuckMap().put(player.getUniqueId(), id);
SaberFactions.plugin.getStuckMap().put(player.getUniqueId(), id);
}
}

View File

@@ -86,7 +86,7 @@ public class CmdTag extends FCommand {
fplayer.msg(TL.COMMAND_TAG_CHANGED, fme.getColorTo(faction) + oldtag, myFaction.getTag(faction));
}
}
fme.setCooldown("tag", System.currentTimeMillis() + (SavageFactions.plugin.getConfig().getInt("fcooldowns.f-tag") * 1000));
fme.setCooldown("tag", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-tag") * 1000));
FTeamWrapper.updatePrefixes(myFaction);
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -32,7 +32,7 @@ public class CmdTnt extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("ftnt.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("ftnt.Enabled")) {
fme.msg(TL.COMMAND_TNT_DISABLED_MSG);
return;
}
@@ -73,7 +73,7 @@ public class CmdTnt extends FCommand {
return;
}
ItemStack tnt = new ItemStack(Material.TNT, amount);
if (fme.getFaction().getTnt() + amount > SavageFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
if (fme.getFaction().getTnt() + amount > SaberFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
msg(TL.COMMAND_TNT_EXCEEDLIMIT);
return;
}
@@ -82,7 +82,7 @@ public class CmdTnt extends FCommand {
fme.getFaction().addTnt(amount);
fme.msg(TL.COMMAND_TNT_DEPOSIT_SUCCESS);
fme.sendMessage(SavageFactions.plugin.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", fme.getFaction().getTnt() + "")));
fme.sendMessage(SaberFactions.plugin.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", fme.getFaction().getTnt() + "")));
return;
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -35,7 +35,7 @@ public class CmdTntFill extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("Tntfill.enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("Tntfill.enabled")) {
this.fme.msg(TL.GENERIC_DISABLED);
return;
}
@@ -51,12 +51,12 @@ public class CmdTntFill extends FCommand {
msg(TL.COMMAND_TNTFILL_HEADER);
int radius = argAsInt(0, 16);
int amount = argAsInt(1, 16);
if (radius > SavageFactions.plugin.getConfig().getInt("Tntfill.max-radius")) {
fme.msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-radius") + ""));
if (radius > SaberFactions.plugin.getConfig().getInt("Tntfill.max-radius")) {
fme.msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", SaberFactions.plugin.getConfig().getInt("Tntfill.max-radius") + ""));
return;
}
if (amount > SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount")) {
fme.msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount") + ""));
if (amount > SaberFactions.plugin.getConfig().getInt("Tntfill.max-amount")) {
fme.msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", SaberFactions.plugin.getConfig().getInt("Tntfill.max-amount") + ""));
return;
}
@@ -181,7 +181,7 @@ public class CmdTntFill extends FCommand {
return;
}
ItemStack tnt = new ItemStack(Material.TNT, amount);
if (fme.getFaction().getTnt() + amount > SavageFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
if (fme.getFaction().getTnt() + amount > SaberFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
msg(TL.COMMAND_TNT_EXCEEDLIMIT);
return;
}

View File

@@ -1,8 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.listeners.FactionsBlockListener;
import com.massivecraft.factions.listeners.FactionsPlayerListener;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.WarmUpUtil;
import com.massivecraft.factions.zcore.util.TL;
@@ -26,7 +25,7 @@ public class CmdTpBanner extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
return;
}

View File

@@ -84,7 +84,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS);
if (Conf.logLandUnclaims) {
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
SaberFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
}
return true;
} else {
@@ -97,7 +97,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS);
if (Conf.logLandUnclaims) {
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
SaberFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
}
return true;
} else {
@@ -119,7 +119,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_UNCLAIMS);
if (Conf.logLandUnclaims) {
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
SaberFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
}
return true;
@@ -170,7 +170,7 @@ public class CmdUnclaim extends FCommand {
myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true));
if (Conf.logLandUnclaims) {
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
SaberFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
}
return true;

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.event.LandUnclaimAllEvent;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@@ -53,7 +53,7 @@ public class CmdUnclaimall extends FCommand {
myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true));
if (Conf.logLandUnclaims) {
SavageFactions.plugin.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
SaberFactions.plugin.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
}
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.fupgrades.FUpgradesGUI;
import com.massivecraft.factions.zcore.util.TL;
@@ -26,7 +26,7 @@ public class CmdUpgrades extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fupgrades.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fupgrades.Enabled")) {
fme.sendMessage("This command is disabled!");
return;
}

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.PermissableAction;
@@ -33,7 +33,7 @@ public class CmdVault extends FCommand {
@Override
public void perform() {
if (!SavageFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
if (!SaberFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
fme.sendMessage("This command is disabled!");
return;
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
@@ -25,8 +25,8 @@ public class CmdVersion extends FCommand {
@Override
public void perform() {
msg(TL.COMMAND_VERSION_NAME); // Did this so people can differentiate between SavageFactions and FactionsUUID (( Requested Feature ))
msg(TL.COMMAND_VERSION_VERSION, SavageFactions.plugin.getDescription().getFullName());
msg(TL.COMMAND_VERSION_NAME); // Did this so people can differentiate between SaberFactions and FactionsUUID (( Requested Feature ))
msg(TL.COMMAND_VERSION_VERSION, SaberFactions.plugin.getDescription().getFullName());
}
@Override

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@@ -49,7 +49,7 @@ public class CmdWarunclaimall extends FCommand {
if (Conf.logLandUnclaims) {
SavageFactions.plugin.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
SaberFactions.plugin.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@@ -228,35 +228,35 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdCorner);
if(SavageFactions.plugin.getConfig().getBoolean("f-alts.Enabled")){
if(SaberFactions.plugin.getConfig().getBoolean("f-alts.Enabled")){
this.addSubCommand(cmdAlts);
}
if (SavageFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) {
if (SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled")) {
this.addSubCommand(this.cmdGrace);
}
if (Bukkit.getServer().getPluginManager().getPlugin("CoreProtect") != null) {
SavageFactions.plugin.log("Found CoreProtect, enabling Inspect");
SaberFactions.plugin.log("Found CoreProtect, enabling Inspect");
this.addSubCommand(this.cmdInspect);
} else {
SavageFactions.plugin.log("CoreProtect not found, disabling Inspect");
SaberFactions.plugin.log("CoreProtect not found, disabling Inspect");
}
if (SavageFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) {
if (SaberFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) {
addSubCommand(this.cmdFocus);
}
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
if (SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
this.addSubCommand(this.cmdFly);
}
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null || Bukkit.getServer().getPluginManager().getPlugin("SavageFTOP") != null) {
SavageFactions.plugin.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
SaberFactions.plugin.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
} else {
SavageFactions.plugin.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");
SaberFactions.plugin.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");
this.addSubCommand(this.cmdTop);
}
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
if (SaberFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
this.addSubCommand(this.cmdPaypalSet);
this.addSubCommand(this.cmdPaypalSee);
}

View File

@@ -13,7 +13,7 @@ import java.text.SimpleDateFormat;
import java.util.List;
public abstract class FCommand extends MCommand<SavageFactions> {
public abstract class FCommand extends MCommand<SaberFactions> {
public static final SimpleDateFormat sdf = new SimpleDateFormat(TL.DATE_FORMAT.toString());
@@ -31,7 +31,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
public boolean isMoneyCommand;
public FCommand() {
super(SavageFactions.plugin);
super(SaberFactions.plugin);
// Due to safety reasons it defaults to disable on lock.
disableOnLock = true;

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.event.FactionRelationEvent;
import com.massivecraft.factions.event.FactionRelationWishEvent;
import com.massivecraft.factions.scoreboards.FTeamWrapper;
@@ -103,8 +103,8 @@ public abstract class FRelationCommand extends FCommand {
}
private boolean hasMaxRelations(Faction them, Relation targetRelation) {
int max = SavageFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), -1);
if (SavageFactions.plugin.getConfig().getBoolean("max-relations.enabled", false)) {
int max = SaberFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), -1);
if (SaberFactions.plugin.getConfig().getBoolean("max-relations.enabled", false)) {
if (max != -1) {
if (myFaction.getRelationCount(targetRelation) >= max) {
msg(TL.COMMAND_RELATIONS_EXCEEDS_ME, max, targetRelation.getPluralTranslation());

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.integration;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
@@ -34,24 +34,24 @@ public class Econ {
String integrationFail = "Economy integration is " + (Conf.econEnabled ? "enabled, but" : "disabled, and") + " the plugin \"Vault\" ";
if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) {
SavageFactions.plugin.log(integrationFail + "is not installed.");
SaberFactions.plugin.log(integrationFail + "is not installed.");
return;
}
RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
SavageFactions.plugin.log(integrationFail + "is not hooked into an economy plugin.");
SaberFactions.plugin.log(integrationFail + "is not hooked into an economy plugin.");
return;
}
econ = rsp.getProvider();
SavageFactions.plugin.log("Economy integration through Vault plugin successful.");
SaberFactions.plugin.log("Economy integration through Vault plugin successful.");
if (!Conf.econEnabled) {
SavageFactions.plugin.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
SaberFactions.plugin.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
}
SavageFactions.plugin.cmdBase.cmdHelp.updateHelp();
SaberFactions.plugin.cmdBase.cmdHelp.updateHelp();
}
public static boolean shouldBeUsed() {
@@ -82,7 +82,7 @@ public class Econ {
public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) {
if (!shouldBeUsed()) {
SavageFactions.plugin.log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin.");
SaberFactions.plugin.log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin.");
return;
}
to.msg("<a>%s's<i> balance is <h>%s<i>.", about.describeTo(to, true), Econ.moneyString(econ.getBalance(about.getAccountId())));

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.integration;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
@@ -38,11 +38,11 @@ public class Worldguard {
if (wgplug == null || !(wgplug instanceof WorldGuardPlugin)) {
enabled = false;
wg = null;
SavageFactions.plugin.log("Could not hook to WorldGuard. WorldGuard checks are disabled.");
SaberFactions.plugin.log("Could not hook to WorldGuard. WorldGuard checks are disabled.");
} else {
wg = (WorldGuardPlugin) wgplug;
enabled = true;
SavageFactions.plugin.log("Successfully hooked to WorldGuard.");
SaberFactions.plugin.log("Successfully hooked to WorldGuard.");
}
}

View File

@@ -113,7 +113,7 @@ public class EngineDynmap {
}
// Shedule non thread safe sync at the end!
Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, () -> {
Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> {
final Map<String, TempMarker> homes = createHomes();
final Map<String, TempAreaMarker> areas = createAreas();

View File

@@ -86,7 +86,7 @@ public class FactionsBlockListener implements Listener {
return false;
} else if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
if (SaberFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
return true;
// Get faction pain build access relation to me
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
@@ -173,7 +173,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler
public void onVaultPlace(BlockPlaceEvent e) {
if (e.getItemInHand().getType() == Material.CHEST) {
ItemStack vault = SavageFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fvault.Item.Name")), SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
ItemStack vault = SaberFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fvault.Item.Name")), SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
if (e.getItemInHand().isSimilar(vault)) {
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
if (fme.getFaction().getVault() != null) {
@@ -199,7 +199,7 @@ public class FactionsBlockListener implements Listener {
Material blockMaterial = blockLoc.getBlock().getType();
if (blockMaterial == Material.CHEST || (SavageFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault") && blockMaterial == Material.HOPPER)) {
if (blockMaterial == Material.CHEST || (SaberFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault") && blockMaterial == Material.HOPPER)) {
e.setCancelled(true);
fme.msg(TL.COMMAND_GETVAULT_CHESTNEAR);
return;
@@ -218,7 +218,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler
public void onHopperPlace(BlockPlaceEvent e) {
if (e.getItemInHand().getType() != Material.HOPPER && !SavageFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault")) {
if (e.getItemInHand().getType() != Material.HOPPER && !SaberFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault")) {
return;
}
@@ -265,7 +265,7 @@ public class FactionsBlockListener implements Listener {
Faction otherFaction = Board.getInstance().getFactionAt(new FLocation(targetLoc));
// Check if the piston is moving in a faction's territory. This disables pistons entirely in faction territory.
if (otherFaction.isNormal() && SavageFactions.plugin.getConfig().getBoolean("disable-pistons-in-territory", false)) {
if (otherFaction.isNormal() && SaberFactions.plugin.getConfig().getBoolean("disable-pistons-in-territory", false)) {
event.setCancelled(true);
return;
}
@@ -284,21 +284,21 @@ public class FactionsBlockListener implements Listener {
@EventHandler
public void onBannerPlace(BlockPlaceEvent e) {
if (SavageFactions.plugin.mc17) {
if (SaberFactions.plugin.mc17) {
return;
}
if (e.getItemInHand().getType() == SavageFactions.plugin.BANNER) {
if (e.getItemInHand().getType() == SaberFactions.plugin.BANNER) {
ItemStack bannerInHand = e.getItemInHand();
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
ItemStack warBanner = fme.getFaction().getBanner();
if (warBanner != null) {
ItemMeta warmeta = warBanner.getItemMeta();
warmeta.setDisplayName(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
warmeta.setDisplayName(SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
warBanner.setItemMeta(warmeta);
} else {
warBanner = SavageFactions.plugin.createItem(SavageFactions.plugin.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
warBanner = SaberFactions.plugin.createItem(SaberFactions.plugin.BANNER, 1, (short) 1, SaberFactions.plugin.getConfig().getString("fbanners.Item.Name"), SaberFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
}
if (warBanner.isSimilar(bannerInHand)) {
@@ -307,12 +307,12 @@ public class FactionsBlockListener implements Listener {
e.setCancelled(true);
return;
}
int bannerTime = SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Time") * 20;
int bannerTime = SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Time") * 20;
Location placedLoc = e.getBlockPlaced().getLocation();
FLocation fplacedLoc = new FLocation(placedLoc);
if ((Board.getInstance().getFactionAt(fplacedLoc).isWarZone() && SavageFactions.plugin.getConfig().getBoolean("fbanners.Placeable.Warzone"))
|| (fme.getFaction().getRelationTo(Board.getInstance().getFactionAt(fplacedLoc)) == Relation.ENEMY) && SavageFactions.plugin.getConfig().getBoolean("fbanners.Placeable.Enemy")) {
if ((Board.getInstance().getFactionAt(fplacedLoc).isWarZone() && SaberFactions.plugin.getConfig().getBoolean("fbanners.Placeable.Warzone"))
|| (fme.getFaction().getRelationTo(Board.getInstance().getFactionAt(fplacedLoc)) == Relation.ENEMY) && SaberFactions.plugin.getConfig().getBoolean("fbanners.Placeable.Enemy")) {
if (bannerCooldownMap.containsKey(fme.getTag())) {
fme.msg(TL.WARBANNER_COOLDOWN);
e.setCancelled(true);
@@ -320,29 +320,29 @@ public class FactionsBlockListener implements Listener {
}
for (FPlayer fplayer : fme.getFaction().getFPlayers()) {
// if (fplayer == fme) { continue; } //Idk if I wanna not send the title to the player
fplayer.getPlayer().sendTitle(SavageFactions.plugin.color(fme.getTag() + " Placed A WarBanner!"), SavageFactions.plugin.color("&7use &c/f tpbanner&7 to tp to the banner!"), 10, 70, 20);
fplayer.getPlayer().sendTitle(SaberFactions.plugin.color(fme.getTag() + " Placed A WarBanner!"), SaberFactions.plugin.color("&7use &c/f tpbanner&7 to tp to the banner!"), 10, 70, 20);
}
bannerCooldownMap.put(fme.getTag(), true);
bannerLocations.put(fme.getTag(), e.getBlockPlaced().getLocation());
int bannerCooldown = SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Place-Cooldown");
int bannerCooldown = SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Place-Cooldown");
ArmorStand as = (ArmorStand) e.getBlockPlaced().getLocation().add(0.5, 1, 0.5).getWorld().spawnEntity(e.getBlockPlaced().getLocation().add(0.5, 1, 0.5), 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(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fbanners.BannerHolo").replace("{Faction}", fme.getTag()))); //Set this to the text you want
as.setCustomName(SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fbanners.BannerHolo").replace("{Faction}", fme.getTag()))); //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
ArmorStand armorStand = as;
String tag = fme.getTag();
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, () -> bannerCooldownMap.remove(tag), Long.parseLong(bannerCooldown + ""));
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> bannerCooldownMap.remove(tag), Long.parseLong(bannerCooldown + ""));
Block banner = e.getBlockPlaced();
Material bannerType = banner.getType();
Faction bannerFaction = fme.getFaction();
banner.getWorld().strikeLightningEffect(banner.getLocation());
// e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.ENTITY_LIGHTNING_IMPACT,2.0F,0.5F);
int radius = SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Effect-Radius");
List<String> effects = SavageFactions.plugin.getConfig().getStringList("fbanners.Effects");
int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, () -> {
int radius = SaberFactions.plugin.getConfig().getInt("fbanners.Banner-Effect-Radius");
List<String> effects = SaberFactions.plugin.getConfig().getStringList("fbanners.Effects");
int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> {
for (Entity e1 : banner.getLocation().getWorld().getNearbyEntities(banner.getLocation(), radius, 255, radius)) {
if (e1 instanceof Player) {
@@ -363,7 +363,7 @@ public class FactionsBlockListener implements Listener {
}
}
}, 0L, 20L);
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, () -> {
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> {
banner.setType(Material.AIR);
as.remove();
banner.getWorld().strikeLightningEffect(banner.getLocation());
@@ -402,7 +402,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler
public void onFallingBlock(EntityChangeBlockEvent event) {
if(!SavageFactions.plugin.getConfig().getBoolean("Falling-Block-Fix.Enabled"))
if(!SaberFactions.plugin.getConfig().getBoolean("Falling-Block-Fix.Enabled"))
return;
Faction faction = Board.getInstance().getFactionAt(new FLocation(event.getBlock()));
@@ -415,7 +415,7 @@ public class FactionsBlockListener implements Listener {
//Grace
@EventHandler
public void onBreak(EntityExplodeEvent e) {
if (!SavageFactions.plugin.getConfig().getBoolean("f-grace.Enabled"))
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled"))
return;
if (!graceisEnabled()) {
@@ -425,7 +425,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler
public void entityDamage(EntityDamageEvent e) {
if (!SavageFactions.plugin.getConfig().getBoolean("f-grace.Enabled"))
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled"))
return;
if (!graceisEnabled()) {
@@ -440,7 +440,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler
public void onTNTPlace(BlockPlaceEvent e1) {
FPlayer fp = FPlayers.getInstance().getByPlayer(e1.getPlayer());
if (!SavageFactions.plugin.getConfig().getBoolean("f-grace.Enabled"))
if (!SaberFactions.plugin.getConfig().getBoolean("f-grace.Enabled"))
return;
if (!graceisEnabled() && !fp.isAdminBypassing()) {
@@ -491,7 +491,7 @@ public class FactionsBlockListener implements Listener {
if (!fme.hasFaction()) {
return;
}
if (event.getBlock().getType() == SavageFactions.plugin.MOB_SPANWER) {
if (event.getBlock().getType() == SaberFactions.plugin.MOB_SPANWER) {
if (!fme.isAdminBypassing()) {
Access access = fme.getFaction().getAccess(fme, PermissableAction.SPAWNER);
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {

View File

@@ -180,9 +180,9 @@ public class FactionsChatListener implements Listener {
listeningPlayer.sendMessage(String.format(yourFormat, talkingPlayer.getDisplayName(), msg));
} catch (UnknownFormatConversionException ex) {
Conf.chatTagInsertIndex = 0;
SavageFactions.plugin.log(Level.SEVERE, "Critical error in chat message formatting!");
SavageFactions.plugin.log(Level.SEVERE, "NOTE: This has been automatically fixed right now by setting chatTagInsertIndex to 0.");
SavageFactions.plugin.log(Level.SEVERE, "For a more proper fix, please read this regarding chat configuration: http://massivecraft.com/plugins/factions/config#Chat_configuration");
SaberFactions.plugin.log(Level.SEVERE, "Critical error in chat message formatting!");
SaberFactions.plugin.log(Level.SEVERE, "NOTE: This has been automatically fixed right now by setting chatTagInsertIndex to 0.");
SaberFactions.plugin.log(Level.SEVERE, "For a more proper fix, please read this regarding chat configuration: http://massivecraft.com/plugins/factions/config#Chat_configuration");
return;
}
}
@@ -202,7 +202,7 @@ public class FactionsChatListener implements Listener {
player.teleport(fme.getFaction().getWarp(warp).getLocation());
fme.msg(TL.COMMAND_FWARP_WARPED, warp);
}
}, SavageFactions.plugin.getConfig().getLong("warmups.f-warp", 0));
}, SaberFactions.plugin.getConfig().getLong("warmups.f-warp", 0));
}
}

View File

@@ -227,9 +227,9 @@ public class FactionsEntityListener implements Listener {
return;
}
UUID uuid = player.getUniqueId();
if (SavageFactions.plugin.getStuckMap().containsKey(uuid)) {
if (SaberFactions.plugin.getStuckMap().containsKey(uuid)) {
FPlayers.getInstance().getByPlayer(player).msg(TL.COMMAND_STUCK_CANCELLED);
SavageFactions.plugin.getStuckMap().remove(uuid);
SaberFactions.plugin.getStuckMap().remove(uuid);
}
}
@@ -644,7 +644,7 @@ public class FactionsEntityListener implements Listener {
@EventHandler
public void onTravel(PlayerPortalEvent event) {
if (!SavageFactions.plugin.getConfig().getBoolean("portals.limit", false)) {
if (!SaberFactions.plugin.getConfig().getBoolean("portals.limit", false)) {
return; // Don't do anything if they don't want us to.
}
@@ -663,7 +663,7 @@ public class FactionsEntityListener implements Listener {
}
FPlayer fp = FPlayers.getInstance().getByPlayer(event.getPlayer());
String mininumRelation = SavageFactions.plugin.getConfig().getString("portals.minimum-relation", "MEMBER"); // Defaults to Neutral if typed wrong.
String mininumRelation = SaberFactions.plugin.getConfig().getString("portals.minimum-relation", "MEMBER"); // Defaults to Neutral if typed wrong.
if (!fp.getFaction().getRelationTo(faction).isAtLeast(Relation.fromString(mininumRelation))) {
event.setCancelled(true);
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.listeners;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -49,9 +49,9 @@ public class FactionsExploitListener implements Listener {
// blocks who occupy less than 1 block width or length wise need to be handled differently
Material mat = event.getTo().getBlock().getType();
if (((mat == SavageFactions.plugin.THIN_GLASS
|| mat == SavageFactions.plugin.IRON_FENCE) && clippingThrough(target, from, 0.65))
|| ((mat == SavageFactions.plugin.FENCE || mat == SavageFactions.plugin.NETHER_FENCE) && clippingThrough(target, from, 0.45))) {
if (((mat == SaberFactions.plugin.THIN_GLASS
|| mat == SaberFactions.plugin.IRON_FENCE) && clippingThrough(target, from, 0.65))
|| ((mat == SaberFactions.plugin.FENCE || mat == SaberFactions.plugin.NETHER_FENCE) && clippingThrough(target, from, 0.45))) {
event.setTo(from);
return;
}

View File

@@ -53,10 +53,10 @@ public class FactionsPlayerListener implements Listener {
public FactionsPlayerListener() {
this.corners = new HashSet<>();
for (Player player : SavageFactions.plugin.getServer().getOnlinePlayers()) {
for (Player player : SaberFactions.plugin.getServer().getOnlinePlayers()) {
initPlayer(player);
}
for (World world : SavageFactions.plugin.getServer().getWorlds()) {
for (World world : SaberFactions.plugin.getServer().getWorlds()) {
WorldBorder border = world.getWorldBorder();
if (border != null) {
int cornerCoord = (int) ((border.getSize() - 1.0) / 2.0);
@@ -99,7 +99,7 @@ public class FactionsPlayerListener implements Listener {
return false;
}
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) {
if (SaberFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) {
return true;
}
@@ -181,7 +181,7 @@ public class FactionsPlayerListener implements Listener {
return false;
}
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
if (SaberFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
return true;
if (otherFaction.getId().equals(myFaction.getId()) && me.getRole() == Role.LEADER) return true;
@@ -303,15 +303,15 @@ public class FactionsPlayerListener implements Listener {
me.login(); // set kills / deaths
// Check for Faction announcements. Let's delay this so they actually see it.
Bukkit.getScheduler().runTaskLater(SavageFactions.plugin, () -> {
Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, () -> {
if (me.isOnline()) {
me.getFaction().sendUnreadAnnouncements(me);
}
}, 33L); // Don't ask me why.
if (SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-enabled", false)) {
if (SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-enabled", false)) {
FScoreboard.init(me);
FScoreboard.get(me).setDefaultSidebar(new FDefaultSidebar(), SavageFactions.plugin.getConfig().getInt("scoreboard.default-update-interval", 20));
FScoreboard.get(me).setDefaultSidebar(new FDefaultSidebar(), SaberFactions.plugin.getConfig().getInt("scoreboard.default-update-interval", 20));
FScoreboard.get(me).setSidebarVisibility(me.showScoreboard());
}
@@ -326,17 +326,17 @@ public class FactionsPlayerListener implements Listener {
fallMap.put(me.getPlayer(), false);
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, () -> fallMap.remove(me.getPlayer()), 180L);
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> fallMap.remove(me.getPlayer()), 180L);
if (me.isSpyingChat() && !player.hasPermission(Permission.CHATSPY.node)) {
me.setSpyingChat(false);
SavageFactions.plugin.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName());
SaberFactions.plugin.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName());
}
if (me.isAdminBypassing() && !player.hasPermission(Permission.BYPASS.node)) {
me.setIsAdminBypassing(false);
SavageFactions.plugin.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName());
SaberFactions.plugin.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName());
}
@@ -370,10 +370,10 @@ public class FactionsPlayerListener implements Listener {
me.logout(); // cache kills / deaths
// if player is waiting for fstuck teleport but leaves, remove
if (SavageFactions.plugin.getStuckMap().containsKey(me.getPlayer().getUniqueId())) {
if (SaberFactions.plugin.getStuckMap().containsKey(me.getPlayer().getUniqueId())) {
FPlayers.getInstance().getByPlayer(me.getPlayer()).msg(TL.COMMAND_STUCK_CANCELLED);
SavageFactions.plugin.getStuckMap().remove(me.getPlayer().getUniqueId());
SavageFactions.plugin.getTimers().remove(me.getPlayer().getUniqueId());
SaberFactions.plugin.getStuckMap().remove(me.getPlayer().getUniqueId());
SaberFactions.plugin.getTimers().remove(me.getPlayer().getUniqueId());
}
Faction myFaction = me.getFaction();
@@ -408,12 +408,12 @@ public class FactionsPlayerListener implements Listener {
}
public void enableFly(FPlayer me) {
if (SavageFactions.plugin.getConfig().getBoolean("ffly.AutoEnable")) {
if (SaberFactions.plugin.getConfig().getBoolean("ffly.AutoEnable")) {
me.setFlying(true);
CmdFly.flyMap.put(me.getName(), true);
if (CmdFly.id == -1) {
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
if (SaberFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
CmdFly.startParticles();
}
}
@@ -529,19 +529,19 @@ public class FactionsPlayerListener implements Listener {
if (changedFaction) {
Bukkit.getServer().getPluginManager().callEvent(new FPlayerEnteredFactionEvent(factionTo, factionFrom, me));
if (SavageFactions.plugin.getConfig().getBoolean("Title.Show-Title")) {
String title = SavageFactions.plugin.getConfig().getString("Title.Format.Title");
if (SaberFactions.plugin.getConfig().getBoolean("Title.Show-Title")) {
String title = SaberFactions.plugin.getConfig().getString("Title.Format.Title");
title = title.replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
title = parseAllPlaceholders(title, factionTo, player);
String subTitle = SavageFactions.plugin.getConfig().getString("Title.Format.Subtitle").replace("{Description}", factionTo.getDescription()).replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
String subTitle = SaberFactions.plugin.getConfig().getString("Title.Format.Subtitle").replace("{Description}", factionTo.getDescription()).replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
subTitle = parseAllPlaceholders(subTitle, factionTo, player);
if (!SavageFactions.plugin.mc17) {
if (!SavageFactions.plugin.mc18) {
me.getPlayer().sendTitle(SavageFactions.plugin.color(title), SavageFactions.plugin.color(subTitle), SavageFactions.plugin.getConfig().getInt("Title.Options.FadeInTime"),
SavageFactions.plugin.getConfig().getInt("Title.Options.ShowTime"),
SavageFactions.plugin.getConfig().getInt("Title.Options.FadeOutTime"));
if (!SaberFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc18) {
me.getPlayer().sendTitle(SaberFactions.plugin.color(title), SaberFactions.plugin.color(subTitle), SaberFactions.plugin.getConfig().getInt("Title.Options.FadeInTime"),
SaberFactions.plugin.getConfig().getInt("Title.Options.ShowTime"),
SaberFactions.plugin.getConfig().getInt("Title.Options.FadeOutTime"));
} else {
me.getPlayer().sendTitle(SavageFactions.plugin.color(title), SavageFactions.plugin.color(subTitle));
me.getPlayer().sendTitle(SaberFactions.plugin.color(title), SaberFactions.plugin.color(subTitle));
}
@@ -549,7 +549,7 @@ public class FactionsPlayerListener implements Listener {
}
if (!SavageFactions.plugin.factionsFlight) {
if (!SaberFactions.plugin.factionsFlight) {
return;
}
@@ -577,12 +577,12 @@ public class FactionsPlayerListener implements Listener {
if (me.isMapAutoUpdating()) {
if (showTimes.containsKey(player.getUniqueId()) && (showTimes.get(player.getUniqueId()) > System.currentTimeMillis())) {
if (SavageFactions.plugin.getConfig().getBoolean("findfactionsexploit.log", false)) {
SavageFactions.plugin.log(Level.WARNING, "%s tried to show a faction map too soon and triggered exploit blocker.", player.getName());
if (SaberFactions.plugin.getConfig().getBoolean("findfactionsexploit.log", false)) {
SaberFactions.plugin.log(Level.WARNING, "%s tried to show a faction map too soon and triggered exploit blocker.", player.getName());
}
} else {
me.sendFancyMessage(Board.getInstance().getMap(me, to, player.getLocation().getYaw()));
showTimes.put(player.getUniqueId(), System.currentTimeMillis() + SavageFactions.plugin.getConfig().getLong("findfactionsexploit.cooldown", 2000));
showTimes.put(player.getUniqueId(), System.currentTimeMillis() + SaberFactions.plugin.getConfig().getLong("findfactionsexploit.cooldown", 2000));
}
} else {
Faction myFaction = me.getFaction();
@@ -843,7 +843,7 @@ public class FactionsPlayerListener implements Listener {
return PermissableAction.DOOR;
if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE"))
return PermissableAction.BUTTON;
if (SavageFactions.plugin.mc113) {
if (SaberFactions.plugin.mc113) {
switch (material) {
case LEVER:
return PermissableAction.LEVER;

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.scoreboards;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
@@ -109,7 +109,7 @@ public class FScoreboard {
updateObjective();
}
}
}.runTaskTimer(SavageFactions.plugin, updateInterval, updateInterval);
}.runTaskTimer(SaberFactions.plugin, updateInterval, updateInterval);
}
public void setTemporarySidebar(final FSidebarProvider provider) {
@@ -132,7 +132,7 @@ public class FScoreboard {
updateObjective();
}
}
}.runTaskLater(SavageFactions.plugin, SavageFactions.plugin.getConfig().getInt("scoreboard.expiration", 7) * 20);
}.runTaskLater(SaberFactions.plugin, SaberFactions.plugin.getConfig().getInt("scoreboard.expiration", 7) * 20);
}
private void updateObjective() {

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.scoreboards;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagUtil;
@@ -36,6 +36,6 @@ public abstract class FSidebarProvider {
// we assume it's broken up into two lines, so returning our tl will suffice.
return TL.COMMAND_SHOW_NOHOME.toString();
}
return SavageFactions.plugin.txt.parse(line); // finally add color :)
return SaberFactions.plugin.txt.parse(line); // finally add color :)
}
}

View File

@@ -39,13 +39,13 @@ public class FTeamWrapper {
return;
}
if (!SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false) || SavageFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members")) {
if (!SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false) || SaberFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members")) {
return;
}
if (updating.add(faction)) {
Bukkit.getScheduler().runTask(SavageFactions.plugin, () -> {
Bukkit.getScheduler().runTask(SaberFactions.plugin, () -> {
updating.remove(faction);
applyUpdates(faction);
});
@@ -61,7 +61,7 @@ public class FTeamWrapper {
return;
}
if (!SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false) || SavageFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members")) {
if (!SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false) || SaberFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members")) {
return;
}
@@ -153,7 +153,7 @@ public class FTeamWrapper {
}
private void updatePrefixes() {
if (SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
if (SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
for (FScoreboard fboard : teams.keySet()) {
updatePrefix(fboard);
}
@@ -161,19 +161,19 @@ public class FTeamWrapper {
}
private void updatePrefix(FScoreboard fboard) {
if (SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
if (SaberFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
FPlayer fplayer = fboard.getFPlayer();
Team team = teams.get(fboard);
boolean focused = false;
if (SavageFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members", false)) {
if (SaberFactions.plugin.getConfig().getBoolean("See-Invisible-Faction-Members", false)) {
team.setCanSeeFriendlyInvisibles(true);
}
if ((SavageFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) && (fplayer.getFaction() != null) && (fplayer.getFaction().getFocused() != null)) {
if ((SaberFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) && (fplayer.getFaction() != null) && (fplayer.getFaction().getFocused() != null)) {
for (FPlayer fp : faction.getFPlayersWhereOnline(true)) {
if (fplayer.getFaction().getFocused().equalsIgnoreCase(fp.getName())) {
team.setPrefix(ChatColor.translateAlternateColorCodes('&', SavageFactions.plugin.getConfig().getString("ffocus.Prefix", "&7»&b")));
team.setPrefix(ChatColor.translateAlternateColorCodes('&', SaberFactions.plugin.getConfig().getString("ffocus.Prefix", "&7»&b")));
focused = true;
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.scoreboards.sidebar;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.scoreboards.FSidebarProvider;
import java.util.ArrayList;
@@ -12,21 +12,21 @@ public class FDefaultSidebar extends FSidebarProvider {
@Override
public String getTitle(FPlayer fplayer) {
return replaceTags(fplayer, SavageFactions.plugin.getConfig().getString("scoreboard.default-title", "{name}"));
return replaceTags(fplayer, SaberFactions.plugin.getConfig().getString("scoreboard.default-title", "{name}"));
}
@Override
public List<String> getLines(FPlayer fplayer) {
if (fplayer.hasFaction()) {
return getOutput(fplayer, "scoreboard.default");
} else if (SavageFactions.plugin.getConfig().getBoolean("scoreboard.factionless-enabled", false)) {
} else if (SaberFactions.plugin.getConfig().getBoolean("scoreboard.factionless-enabled", false)) {
return getOutput(fplayer, "scoreboard.factionless");
}
return getOutput(fplayer, "scoreboard.default"); // no faction, factionless-board disabled
}
public List<String> getOutput(FPlayer fplayer, String list) {
List<String> lines = SavageFactions.plugin.getConfig().getStringList(list);
List<String> lines = SaberFactions.plugin.getConfig().getStringList(list);
if (lines == null || lines.isEmpty()) {
return new ArrayList<>();

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.scoreboards.sidebar;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.scoreboards.FSidebarProvider;
import java.util.List;
@@ -22,7 +22,7 @@ public class FInfoSidebar extends FSidebarProvider {
@Override
public List<String> getLines(FPlayer fplayer) {
List<String> lines = SavageFactions.plugin.getConfig().getStringList("scoreboard.finfo");
List<String> lines = SaberFactions.plugin.getConfig().getStringList("scoreboard.finfo");
ListIterator<String> it = lines.listIterator();
while (it.hasNext()) {

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.struct;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.command.CommandSender;
public enum Permission {
@@ -121,7 +121,7 @@ public enum Permission {
}
public boolean has(CommandSender sender, boolean informSenderIfNot) {
return SavageFactions.plugin.perm.has(sender, this.node, informSenderIfNot);
return SaberFactions.plugin.perm.has(sender, this.node, informSenderIfNot);
}
public boolean has(CommandSender sender) {

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.struct;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.util.MultiversionMaterials;
import com.massivecraft.factions.zcore.fperms.Permissable;
import com.massivecraft.factions.zcore.util.TL;
@@ -199,7 +199,7 @@ public enum Relation implements Permissable {
// Utility method to build items for F Perm GUI
@Override
public ItemStack buildItem() {
final ConfigurationSection RELATION_CONFIG = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation");
final ConfigurationSection RELATION_CONFIG = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation");
String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", ""));
List<String> lore = new ArrayList<>();

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.struct;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.util.MultiversionMaterials;
import com.massivecraft.factions.zcore.fperms.Permissable;
import com.massivecraft.factions.zcore.util.TL;
@@ -113,7 +113,7 @@ public enum Role implements Permissable {
// Utility method to build items for F Perm GUI
@Override
public ItemStack buildItem() {
final ConfigurationSection RELATION_CONFIG = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation");
final ConfigurationSection RELATION_CONFIG = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation");
String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", ""));
List<String> lore = new ArrayList<>();
@@ -132,7 +132,7 @@ public enum Role implements Permissable {
itemMeta.setDisplayName(displayName);
itemMeta.setLore(lore);
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
}

View File

@@ -50,13 +50,13 @@ public class AutoLeaveProcessTask extends BukkitRunnable {
// Check if they should be exempt from this.
if (!fplayer.willAutoLeave()) {
SavageFactions.plugin.debug(Level.INFO, fplayer.getName() + " was going to be auto-removed but was set not to.");
SaberFactions.plugin.debug(Level.INFO, fplayer.getName() + " was going to be auto-removed but was set not to.");
continue;
}
if (fplayer.isOffline() && now - fplayer.getLastLoginTime() > toleranceMillis) {
if (Conf.logFactionLeave || Conf.logFactionKick) {
SavageFactions.plugin.log("Player " + fplayer.getName() + " was auto-removed due to inactivity.");
SaberFactions.plugin.log("Player " + fplayer.getName() + " was auto-removed due to inactivity.");
}
// if player is faction admin, sort out the faction since he's going away

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.util;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
public class AutoLeaveTask implements Runnable {
@@ -18,11 +18,11 @@ public class AutoLeaveTask implements Runnable {
}
task = new AutoLeaveProcessTask();
task.runTaskTimer(SavageFactions.plugin, 1, 1);
task.runTaskTimer(SaberFactions.plugin, 1, 1);
// maybe setting has been changed? if so, restart this task at new rate
if (this.rate != Conf.autoLeaveRoutineRunsEveryXMinutes) {
SavageFactions.plugin.startAutoLeaveTask(true);
SaberFactions.plugin.startAutoLeaveTask(true);
}
}
}

View File

@@ -35,7 +35,7 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
// Return the plugin version since this expansion is bundled with the dependency
@Override
public String getVersion() {
return SavageFactions.plugin.getDescription().getVersion();
return SaberFactions.plugin.getDescription().getVersion();
}
@@ -80,7 +80,7 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
String humanized = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - fPlayer.getLastLoginTime(), true, true) + TL.COMMAND_STATUS_AGOSUFFIX;
return fPlayer.isOnline() ? ChatColor.GREEN + TL.COMMAND_STATUS_ONLINE.toString() : (System.currentTimeMillis() - fPlayer.getLastLoginTime() < 432000000 ? ChatColor.YELLOW + humanized : ChatColor.RED + humanized);
case "player_group":
return SavageFactions.plugin.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(fPlayer.getId())));
return SaberFactions.plugin.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(fPlayer.getId())));
case "player_balance":
return Econ.isSetup() ? Econ.getFriendlyBalance(fPlayer) : TL.ECON_OFF.format("balance");
case "player_power":
@@ -121,7 +121,7 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
case "faction_warps":
return String.valueOf(faction.getWarps().size());
case "faction_raidable":
boolean raid = SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && faction.getLandRounded() >= faction.getPowerRounded();
boolean raid = SaberFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && faction.getLandRounded() >= faction.getPowerRounded();
return raid ? TL.RAIDABLE_TRUE.toString() : TL.RAIDABLE_FALSE.toString();
case "faction_home_world":
return faction.hasHome() ? faction.getHome().getWorld().getName() : "";

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.util;
import com.google.gson.*;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@@ -21,7 +21,7 @@ public class LocationTypeAdapter implements JsonSerializer<Location>, JsonDeseri
return object;
} catch (Exception ex) {
ex.printStackTrace();
SavageFactions.plugin.log(Level.WARNING, "Error encountered while serializing a Location.");
SaberFactions.plugin.log(Level.WARNING, "Error encountered while serializing a Location.");
return object;
}
}
@@ -38,7 +38,7 @@ public class LocationTypeAdapter implements JsonSerializer<Location>, JsonDeseri
object.get("z").getAsDouble());
} catch (Exception ex) {
ex.printStackTrace();
SavageFactions.plugin.log(Level.WARNING, "Error encountered while" +
SaberFactions.plugin.log(Level.WARNING, "Error encountered while" +
" deserializing a Location.");
return null;
}

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.util;
import com.google.gson.*;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import java.lang.reflect.Type;
import java.util.HashSet;
@@ -52,7 +52,7 @@ public class MapFLocToStringSetTypeAdapter implements JsonDeserializer<Map<FLoca
} catch (Exception ex) {
ex.printStackTrace();
SavageFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a Map of FLocations to String Sets.");
SaberFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a Map of FLocations to String Sets.");
return null;
}
}
@@ -97,7 +97,7 @@ public class MapFLocToStringSetTypeAdapter implements JsonDeserializer<Map<FLoca
} catch (Exception ex) {
ex.printStackTrace();
SavageFactions.plugin.log(Level.WARNING, "Error encountered while serializing a Map of FLocations to String Sets.");
SaberFactions.plugin.log(Level.WARNING, "Error encountered while serializing a Map of FLocations to String Sets.");
return obj;
}
}

View File

@@ -2,7 +2,7 @@ package com.massivecraft.factions.util;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
@@ -68,16 +68,16 @@ public class MiscUtil {
ArrayList<String> errors = new ArrayList<>();
if (getComparisonString(str).length() < Conf.factionTagLengthMin) {
errors.add(SavageFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_TOOSHORT.toString(), Conf.factionTagLengthMin));
errors.add(SaberFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_TOOSHORT.toString(), Conf.factionTagLengthMin));
}
if (str.length() > Conf.factionTagLengthMax) {
errors.add(SavageFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_TOOLONG.toString(), Conf.factionTagLengthMax));
errors.add(SaberFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_TOOLONG.toString(), Conf.factionTagLengthMax));
}
for (char c : str.toCharArray()) {
if (!substanceChars.contains(String.valueOf(c))) {
errors.add(SavageFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c));
errors.add(SaberFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c));
}
}
@@ -96,7 +96,7 @@ public class MiscUtil {
// Fix for some data being broken when we added the recruit rank.
if (player.getRole() == null) {
player.setRole(Role.NORMAL);
SavageFactions.plugin.log(Level.WARNING, String.format("Player %s had null role. Setting them to normal. This isn't good D:", player.getName()));
SaberFactions.plugin.log(Level.WARNING, String.format("Player %s had null role. Setting them to normal. This isn't good D:", player.getName()));
}
switch (player.getRole()) {

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.util;
import com.google.gson.*;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import java.lang.reflect.Type;
import java.util.logging.Level;
@@ -32,7 +32,7 @@ public class MyLocationTypeAdapter implements JsonDeserializer<LazyLocation>, Js
} catch (Exception ex) {
ex.printStackTrace();
SavageFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a LazyLocation.");
SaberFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a LazyLocation.");
return null;
}
}
@@ -52,7 +52,7 @@ public class MyLocationTypeAdapter implements JsonDeserializer<LazyLocation>, Js
return obj;
} catch (Exception ex) {
ex.printStackTrace();
SavageFactions.plugin.log(Level.WARNING, "Error encountered while serializing a LazyLocation.");
SaberFactions.plugin.log(Level.WARNING, "Error encountered while serializing a LazyLocation.");
return obj;
}
}

View File

@@ -1,6 +1,6 @@
package com.massivecraft.factions.util.Particles;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Location;
@@ -451,7 +451,7 @@ public enum ParticleEffect {
*/
private static boolean isWater(Location location) {
Material material = location.getBlock().getType();
return material == Material.WATER || material == SavageFactions.plugin.STATIONARY_WATER;
return material == Material.WATER || material == SaberFactions.plugin.STATIONARY_WATER;
}
/**

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.util;
import com.google.gson.*;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
@@ -62,7 +62,7 @@ public class PermissionsMapTypeAdapter implements JsonDeserializer<Map<Permissab
return permissionsMap;
} catch (Exception ex) {
SavageFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a PermissionsMap.");
SaberFactions.plugin.log(Level.WARNING, "Error encountered while deserializing a PermissionsMap.");
ex.printStackTrace();
return null;
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.util;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
@@ -45,7 +45,7 @@ public abstract class SpiralTask implements Runnable {
this.world = Bukkit.getWorld(fLocation.getWorldName());
if (this.world == null) {
SavageFactions.plugin.log(Level.WARNING, "[SpiralTask] A valid world must be specified!");
SaberFactions.plugin.log(Level.WARNING, "[SpiralTask] A valid world must be specified!");
this.stop();
return;
}
@@ -56,7 +56,7 @@ public abstract class SpiralTask implements Runnable {
this.readyToGo = true;
// get this party started
this.setTaskID(Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, this, 2, 2));
this.setTaskID(Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, this, 2, 2));
}
private static long now() {
@@ -187,7 +187,7 @@ public abstract class SpiralTask implements Runnable {
// for successful completion
public void finish() {
// SavageFactions.plugin.log("SpiralTask successfully completed!");
// SaberFactions.plugin.log("SpiralTask successfully completed!");
this.stop();
}

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.util;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@@ -12,18 +12,18 @@ import org.bukkit.Bukkit;
public class UtilFly {
public static void run() {
if (!SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight"))
if (!SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight"))
return;
Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, () -> {
Bukkit.getScheduler().scheduleSyncRepeatingTask(SaberFactions.plugin, () -> {
for (FPlayer fp : FPlayers.getInstance().getOnlinePlayers()) {
if (fp.isFlying()) fp.checkIfNearbyEnemies();
}
}, 0, SavageFactions.plugin.getConfig().getInt("fly-task-interval", 10));
}, 0, SaberFactions.plugin.getConfig().getInt("fly-task-interval", 10));
}
public static void setFly(FPlayer fp, boolean fly, boolean silent, boolean damage) {
if (!SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight"))
if (!SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight"))
return;
fp.getPlayer().setAllowFlight(fly);
@@ -43,7 +43,7 @@ public class UtilFly {
}
public static void checkFly(FPlayer me, Faction factionTo) {
if (!SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight"))
if (!SaberFactions.plugin.getConfig().getBoolean("enable-faction-flight"))
return;
if (me.isAdminBypassing() && me.isFlying())
@@ -81,13 +81,13 @@ public class UtilFly {
public static void setFallDamage(FPlayer fp, boolean fly, boolean damage) {
if (!fly) {
if (!damage) {
fp.sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", SavageFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3) + ""));
fp.sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", SaberFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3) + ""));
}
int cooldown = SavageFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3);
int cooldown = SaberFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3);
if (cooldown > 0) {
fp.setTakeFallDamage(false);
Bukkit.getScheduler().runTaskLater(SavageFactions.plugin, () -> fp.setTakeFallDamage(true), 20L * cooldown);
Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, () -> fp.setTakeFallDamage(true), 20L * cooldown);
}
}
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.util;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.zcore.util.TL;
public class WarmUpUtil {
@@ -21,7 +21,7 @@ public class WarmUpUtil {
player.msg(TL.WARMUPS_ALREADY);
} else {
player.msg(translationKey.format(action, delay));
int id = SavageFactions.plugin.getServer().getScheduler().runTaskLater(SavageFactions.plugin, () -> {
int id = SaberFactions.plugin.getServer().getScheduler().runTaskLater(SaberFactions.plugin, () -> {
player.stopWarmup();
runnable.run();
}, delay * 20).getTaskId();

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.util;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@@ -34,14 +34,14 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
public WarpGUI(FPlayer fme) {
this.fme = fme;
this.section = SavageFactions.plugin.getConfig().getConfigurationSection("fwarp-gui");
this.section = SaberFactions.plugin.getConfig().getConfigurationSection("fwarp-gui");
}
@Override
public void build() {
if (section == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return;
}
@@ -49,14 +49,14 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
guiSize = section.getInt("rows", 3);
if (guiSize > 6) {
guiSize = 6;
SavageFactions.plugin.log(Level.INFO, "Warp GUI size out of bounds, defaulting to 6");
SaberFactions.plugin.log(Level.INFO, "Warp GUI size out of bounds, defaulting to 6");
}
guiSize *= 9;
String guiName = ChatColor.translateAlternateColorCodes('&', section.getString("name", "FactionPermissions"));
warpGUI = Bukkit.createInventory(this, guiSize, guiName);
maxWarps = SavageFactions.plugin.getConfig().getInt("max-warps", 5);
maxWarps = SaberFactions.plugin.getConfig().getInt("max-warps", 5);
Set<String> factionWarps = fme.getFaction().getWarps().keySet();
List<Integer> warpOpenSlots = section.getIntegerList("warp-slots");
@@ -64,7 +64,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
buildDummyItems();
if (maxWarps != warpOpenSlots.size()) {
SavageFactions.plugin.log(Level.SEVERE, "Invalid warp slots for GUI, Please use same value as max warps");
SaberFactions.plugin.log(Level.SEVERE, "Invalid warp slots for GUI, Please use same value as max warps");
return;
}
@@ -102,12 +102,12 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
} else {
fme.setEnteringPassword(true, warp);
fme.msg(TL.COMMAND_FWARP_PASSWORD_REQUIRED);
Bukkit.getScheduler().runTaskLater(SavageFactions.plugin, () -> {
Bukkit.getScheduler().runTaskLater(SaberFactions.plugin, () -> {
if (fme.isEnteringPassword()) {
fme.msg(TL.COMMAND_FWARP_PASSWORD_TIMEOUT);
fme.setEnteringPassword(false, "");
}
}, SavageFactions.plugin.getConfig().getInt("fwarp-gui.password-timeout", 5) * 20);
}, SaberFactions.plugin.getConfig().getInt("fwarp-gui.password-timeout", 5) * 20);
}
}
}
@@ -119,15 +119,15 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
player.teleport(fme.getFaction().getWarp(warp).getLocation());
fme.msg(TL.COMMAND_FWARP_WARPED, warp);
}
}, SavageFactions.plugin.getConfig().getLong("warmups.f-warp", 0));
}, SaberFactions.plugin.getConfig().getLong("warmups.f-warp", 0));
}
private boolean transact(FPlayer player) {
if (!SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing()) {
if (!SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing()) {
return true;
}
double cost = SavageFactions.plugin.getConfig().getDouble("warp-cost.warp", 5);
double cost = SaberFactions.plugin.getConfig().getDouble("warp-cost.warp", 5);
if (!Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) {
return true;
@@ -143,8 +143,8 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
private ItemStack buildItem(String warp) {
ConfigurationSection warpItemSection = section.getConfigurationSection("warp-item");
if (warpItemSection == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR);
}
@@ -177,7 +177,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
string = ChatColor.translateAlternateColorCodes('&', string);
string = string.replace("{warp}", warp);
string = string.replace("{warp-protected}", faction.hasWarpPassword(warp) ? "Enabled" : "Disabled");
string = string.replace("{warp-cost}", !SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) ? "Disabled" : Integer.toString(SavageFactions.plugin.getConfig().getInt("warp-cost.warp", 5)));
string = string.replace("{warp-cost}", !SaberFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) ? "Disabled" : Integer.toString(SaberFactions.plugin.getConfig().getInt("warp-cost.warp", 5)));
return string;
}
@@ -187,7 +187,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
try {
dummyId = Integer.parseInt(key);
} catch (NumberFormatException exception) {
SavageFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
SaberFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
continue;
}
@@ -199,7 +199,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
List<Integer> dummyIdSlots = section.getIntegerList("dummy-slots." + key);
for (Integer slot : dummyIdSlots) {
if (slot + 1 > guiSize || slot < 0) {
SavageFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
SaberFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
continue;
}
dummySlots.add(slot);
@@ -212,14 +212,14 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
final ConfigurationSection dummySection = section.getConfigurationSection("dummy-items." + id);
if (dummySection == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f warp GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR);
}
Material material = Material.matchMaterial(dummySection.getString("material", ""));
if (material == null) {
SavageFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id);
SaberFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id);
return null;
}
@@ -237,7 +237,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
ItemMeta itemMeta = itemStack.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TextUtil;
@@ -311,7 +311,7 @@ public abstract class MCommand<T extends MPlugin> {
s = s.replace("{power}", power);
}
if (s.contains("{group}")) {
String group = SavageFactions.plugin.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(player.getId())));
String group = SaberFactions.plugin.getPrimaryGroup(Bukkit.getOfflinePlayer(UUID.fromString(player.getId())));
s = s.replace("{group}", group);
}
return s;

View File

@@ -171,7 +171,7 @@ public abstract class MPlugin extends JavaPlugin {
conf.save(lang);
} catch (IOException e) {
getLogger().log(Level.WARNING, "Factions: Failed to save lang.yml.");
getLogger().log(Level.WARNING, "Factions: Report this stack trace to prosavage.");
getLogger().log(Level.WARNING, "Factions: Report this stack trace to Driftay.");
e.printStackTrace();
}
}
@@ -242,7 +242,7 @@ public abstract class MPlugin extends JavaPlugin {
// COMMAND HANDLING
// -------------------------------------------- //
// can be overridden by SavageFactions method, to provide option
// can be overridden by SaberFactions method, to provide option
public boolean logPlayerCommands() {
return true;
}

View File

@@ -40,7 +40,7 @@ public class MPluginSecretPlayerListener implements Listener {
/* Should be handled by stuff in FactionsChatListener
Player speaker = event.getPlayer();
String format = event.getFormat();
format = format.replace(Conf.chatTagReplaceString, SavageFactions.plugin.getPlayerFactionTag(speaker)).replace("[FACTION_TITLE]", SavageFactions.plugin.getPlayerTitle(speaker));
format = format.replace(Conf.chatTagReplaceString, SaberFactions.plugin.getPlayerFactionTag(speaker)).replace("[FACTION_TITLE]", SaberFactions.plugin.getPlayerTitle(speaker));
event.setFormat(format);
*/
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.zcore.fperms;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.util.MultiversionMaterials;
import org.bukkit.DyeColor;
import org.bukkit.Material;
@@ -93,11 +93,11 @@ public enum PermissableAction {
// Utility method to build items for F Perm GUI
public ItemStack buildItem(FPlayer fme, Permissable permissable) {
final ConfigurationSection section = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.action");
final ConfigurationSection section = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.action");
if (section == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR);
}
@@ -109,7 +109,7 @@ public enum PermissableAction {
}
Material material = Material.matchMaterial(section.getString("materials." + name().toLowerCase().replace('_', '-')));
if (material == null) {
material = MultiversionMaterials.fromString(SavageFactions.plugin.getConfig().getString("fperm-gui.action.materials")).parseMaterial();
material = MultiversionMaterials.fromString(SaberFactions.plugin.getConfig().getString("fperm-gui.action.materials")).parseMaterial();
}
Access access = fme.getFaction().getAccess(permissable, this);
@@ -135,7 +135,7 @@ public enum PermissableAction {
}
// If under the 1.13 version we will use the colorable option.
if (!SavageFactions.plugin.mc113) {
if (!SaberFactions.plugin.mc113) {
DyeColor dyeColor = null;
try {
@@ -148,14 +148,14 @@ public enum PermissableAction {
}
} else {
// so this is in 1.13 mode, our config will automatically be updated to a material instead of color because of it being removed in the new api
item.setType(Material.valueOf(SavageFactions.plugin.getConfig().getString("fperm-gui.action.access." + accessValue)));
item.setType(Material.valueOf(SaberFactions.plugin.getConfig().getString("fperm-gui.action.access." + accessValue)));
}
for (String loreLine : section.getStringList("placeholder-item.lore")) {
lore.add(replacePlaceholders(loreLine, fme, permissable));
}
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.zcore.fperms.gui;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.util.FactionGUI;
import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.Permissable;
@@ -36,20 +36,20 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
public PermissableActionGUI(FPlayer fme, Permissable permissable) {
this.fme = fme;
this.permissable = permissable;
this.section = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.action");
this.section = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.action");
}
public void build() {
if (section == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return;
}
guiSize = section.getInt("rows", 3);
if (guiSize > 6) {
guiSize = 6;
SavageFactions.plugin.log(Level.INFO, "Action GUI size out of bounds, defaulting to 6");
SaberFactions.plugin.log(Level.INFO, "Action GUI size out of bounds, defaulting to 6");
}
guiSize *= 9;
@@ -63,7 +63,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
continue;
}
if (slot + 1 > guiSize || slot < 0) {
SavageFactions.plugin.log(Level.WARNING, "Invalid slot for: " + key.toUpperCase());
SaberFactions.plugin.log(Level.WARNING, "Invalid slot for: " + key.toUpperCase());
continue;
}
@@ -74,7 +74,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
PermissableAction permissableAction = PermissableAction.fromString(key.toUpperCase().replace('-', '_'));
if (permissableAction == null) {
SavageFactions.plugin.log(Level.WARNING, "Invalid permissable action: " + key.toUpperCase());
SaberFactions.plugin.log(Level.WARNING, "Invalid permissable action: " + key.toUpperCase());
continue;
}
@@ -101,7 +101,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
actionSlots.put(slot, action);
}
}
SavageFactions.plugin.log(Level.WARNING, "Missing action: " + action.name());
SaberFactions.plugin.log(Level.WARNING, "Missing action: " + action.name());
}
}
@@ -147,7 +147,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
actionGUI.setItem(slot, action.buildItem(fme, permissable));
fme.msg(TL.COMMAND_PERM_SET, action.name(), access.name(), permissable.name());
SavageFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), action.name(), access.name(), permissable.name()) + " for faction " + fme.getTag());
SaberFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), action.name(), access.name(), permissable.name()) + " for faction " + fme.getTag());
}
private void buildItems() {
@@ -157,7 +157,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
ItemStack item = permissableAction.buildItem(fme, permissable);
if (item == null) {
SavageFactions.plugin.log(Level.WARNING, "Invalid item for: " + permissableAction.toString().toUpperCase());
SaberFactions.plugin.log(Level.WARNING, "Invalid item for: " + permissableAction.toString().toUpperCase());
continue;
}
@@ -173,8 +173,8 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
private ItemStack getSpecialItem(SpecialItem specialItem) {
if (section == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR);
}
@@ -182,7 +182,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
case RELATION:
return permissable.buildItem();
case BACK:
ConfigurationSection backButtonConfig = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.back-item");
ConfigurationSection backButtonConfig = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.back-item");
ItemStack backButton = new ItemStack(Material.matchMaterial(backButtonConfig.getString("material")));
ItemMeta backButtonMeta = backButton.getItemMeta();
@@ -194,7 +194,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
}
backButtonMeta.setLore(lore);
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
backButtonMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}
@@ -208,8 +208,8 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
private void buildDummyItems() {
if (section == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return;
}
@@ -218,7 +218,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
try {
dummyId = Integer.parseInt(key);
} catch (NumberFormatException exception) {
SavageFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
SaberFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
continue;
}
@@ -228,7 +228,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
}
ItemMeta meta = dummyItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}
@@ -237,7 +237,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
List<Integer> dummySlots = section.getIntegerList("dummy-items." + key);
for (Integer slot : dummySlots) {
if (slot + 1 > guiSize || slot < 0) {
SavageFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
SaberFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
continue;
}
usedDummySlots.add(slot);
@@ -247,17 +247,17 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
}
private ItemStack buildDummyItem(int id) {
final ConfigurationSection dummySection = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.dummy-items." + id);
final ConfigurationSection dummySection = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.dummy-items." + id);
if (dummySection == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build dummy items for F PERM GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build dummy items for F PERM GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR);
}
Material material = Material.matchMaterial(dummySection.getString("material", ""));
if (material == null) {
SavageFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id);
SaberFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id);
return null;
}
@@ -283,7 +283,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
}
itemMeta.setLore(lore);
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}

View File

@@ -1,7 +1,7 @@
package com.massivecraft.factions.zcore.fperms.gui;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.FactionGUI;
@@ -35,13 +35,13 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
public PermissableRelationGUI(FPlayer fme) {
this.fme = fme;
this.section = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation");
this.section = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.relation");
}
public void build() {
if (section == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return;
}
@@ -49,7 +49,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
guiSize = section.getInt("rows", 3);
if (guiSize > 5) {
guiSize = 5;
SavageFactions.plugin.log(Level.INFO, "Relation GUI size out of bounds, defaulting to 5");
SaberFactions.plugin.log(Level.INFO, "Relation GUI size out of bounds, defaulting to 5");
}
guiSize *= 9;
@@ -62,12 +62,12 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
continue;
}
if (slot + 1 > guiSize && slot > 0) {
SavageFactions.plugin.log(Level.WARNING, "Invalid slot of " + key.toUpperCase() + " in relation GUI skipping it");
SaberFactions.plugin.log(Level.WARNING, "Invalid slot of " + key.toUpperCase() + " in relation GUI skipping it");
continue;
}
if (getPermissable(key) == null) {
SavageFactions.plugin.log(Level.WARNING, "Invalid permissable " + key.toUpperCase() + " skipping it");
SaberFactions.plugin.log(Level.WARNING, "Invalid permissable " + key.toUpperCase() + " skipping it");
continue;
}
@@ -112,7 +112,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
ItemStack item = permissable.buildItem();
if (item == null) {
SavageFactions.plugin.log(Level.WARNING, "Invalid material for " + permissable.toString().toUpperCase() + " skipping it");
SaberFactions.plugin.log(Level.WARNING, "Invalid material for " + permissable.toString().toUpperCase() + " skipping it");
continue;
}
@@ -122,8 +122,8 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
private void buildDummyItems() {
if (section == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return;
}
@@ -132,7 +132,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
try {
dummyId = Integer.parseInt(key);
} catch (NumberFormatException exception) {
SavageFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
SaberFactions.plugin.log(Level.WARNING, "Invalid dummy item id: " + key.toUpperCase());
continue;
}
@@ -142,7 +142,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
}
ItemMeta meta = dummyItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}
@@ -151,7 +151,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
List<Integer> dummySlots = section.getIntegerList("dummy-items." + key);
for (Integer slot : dummySlots) {
if (slot + 1 > guiSize || slot < 0) {
SavageFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
SaberFactions.plugin.log(Level.WARNING, "Invalid slot: " + slot + " for dummy item: " + key);
continue;
}
relationGUI.setItem(slot, dummyItem);
@@ -160,17 +160,17 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
}
private ItemStack buildDummyItem(int id) {
final ConfigurationSection dummySection = SavageFactions.plugin.getConfig().getConfigurationSection("fperm-gui.dummy-items." + id);
final ConfigurationSection dummySection = SaberFactions.plugin.getConfig().getConfigurationSection("fperm-gui.dummy-items." + id);
if (dummySection == null) {
SavageFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SavageFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
SaberFactions.plugin.log(Level.WARNING, "Attempted to build f perm GUI but config section not present.");
SaberFactions.plugin.log(Level.WARNING, "Copy your config, allow the section to generate, then copy it back to your old config.");
return new ItemStack(Material.AIR);
}
Material material = Material.matchMaterial(dummySection.getString("material", ""));
if (material == null) {
SavageFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id);
SaberFactions.plugin.log(Level.WARNING, "Invalid material for dummy item: " + id);
return null;
}
@@ -196,7 +196,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI {
}
itemMeta.setLore(lore);
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore.fupgrades;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.CropState;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -29,13 +29,13 @@ public class CropUpgrades implements Listener {
switch (level) {
case 1:
chance = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-1");
chance = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-1");
break;
case 2:
chance = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-2");
chance = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-2");
break;
case 3:
chance = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-3");
chance = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Crop-Boost.level-3");
break;
}
@@ -50,7 +50,7 @@ public class CropUpgrades implements Listener {
private void growCrop(BlockGrowEvent e) {
if (e.getBlock().getType().equals(SavageFactions.plugin.CROPS)) {
if (e.getBlock().getType().equals(SaberFactions.plugin.CROPS)) {
e.setCancelled(true);
Crops c = new Crops(CropState.RIPE);
BlockState bs = e.getBlock().getState();
@@ -60,11 +60,11 @@ public class CropUpgrades implements Listener {
Block below = e.getBlock().getLocation().subtract(0, 1, 0).getBlock();
if (below.getType() == SavageFactions.plugin.SUGAR_CANE_BLOCK) {
if (below.getType() == SaberFactions.plugin.SUGAR_CANE_BLOCK) {
Block above = e.getBlock().getLocation().add(0, 1, 0).getBlock();
if (above.getType() == Material.AIR && above.getLocation().add(0, -2, 0).getBlock().getType() != Material.AIR) {
above.setType(SavageFactions.plugin.SUGAR_CANE_BLOCK);
above.setType(SaberFactions.plugin.SUGAR_CANE_BLOCK);
}
} else if (below.getType() == Material.CACTUS) {

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore.fupgrades;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -30,13 +30,13 @@ public class EXPUpgrade implements Listener {
switch (level) {
case 1:
multiplier = SavageFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-1");
multiplier = SaberFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-1");
break;
case 2:
multiplier = SavageFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-2");
multiplier = SaberFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-2");
break;
case 3:
multiplier = SavageFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-3");
multiplier = SaberFactions.plugin.getConfig().getDouble("fupgrades.MainMenu.EXP.EXP-Boost.level-3");
break;
}

View File

@@ -3,11 +3,10 @@ package com.massivecraft.factions.zcore.fupgrades;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@@ -22,29 +21,29 @@ import java.util.List;
public class FUpgradesGUI implements Listener {
public void openMainMenu(FPlayer fme) {
Inventory inventory = Bukkit.createInventory(null, 45, SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())));
List<Integer> dummySlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.DummyItem.slots");
Material dummyMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.DummyItem.Type"));
int dummyAmount = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.DummyItem.Amount");
short dummyData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.DummyItem.Damage") + "");
ItemStack dummyItem = SavageFactions.plugin.createItem(dummyMaterial,
Inventory inventory = Bukkit.createInventory(null, 45, SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())));
List<Integer> dummySlots = SaberFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.DummyItem.slots");
Material dummyMaterial = Material.getMaterial(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.DummyItem.Type"));
int dummyAmount = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.DummyItem.Amount");
short dummyData = Short.parseShort(SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.DummyItem.Damage") + "");
ItemStack dummyItem = SaberFactions.plugin.createItem(dummyMaterial,
dummyAmount,
dummyData,
SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.DummyItem.Name")),
SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.DummyItem.Lore")));
SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.DummyItem.Name")),
SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.DummyItem.Lore")));
for (int i = 0; i <= dummySlots.size() - 1; i++) {
inventory.setItem(dummySlots.get(i), dummyItem);
}
ItemStack[] items = buildItems(fme);
List<Integer> cropSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Crops.CropItem.slots");
List<Integer> spawnerSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
List<Integer> expSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.EXP.EXPItem.slots");
List<Integer> chestSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Chest.ChestItem.slots");
List<Integer> powerSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Power.PowerItem.slots");
List<Integer> redSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Redstone.RedstoneItem.slots");
List<Integer> memberSlots = SavageFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Members.MembersItem.slots");
List<Integer> cropSlots = SaberFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Crops.CropItem.slots");
List<Integer> spawnerSlots = SaberFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Spawners.SpawnerItem.slots");
List<Integer> expSlots = SaberFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.EXP.EXPItem.slots");
List<Integer> chestSlots = SaberFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Chest.ChestItem.slots");
List<Integer> powerSlots = SaberFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Power.PowerItem.slots");
List<Integer> redSlots = SaberFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Redstone.RedstoneItem.slots");
List<Integer> memberSlots = SaberFactions.plugin.getConfig().getIntegerList("fupgrades.MainMenu.Members.MembersItem.slots");
for (int i = 0; i < cropSlots.size(); i++)
if (cropSlots.get(i) != -1) inventory.setItem(cropSlots.get(i), items[2]);
@@ -76,7 +75,7 @@ public class FUpgradesGUI implements Listener {
return;
FPlayer fme = FPlayers.getInstance().getByPlayer((Player) e.getWhoClicked());
if (e.getClickedInventory().getTitle().equalsIgnoreCase(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())))) {
if (e.getClickedInventory().getTitle().equalsIgnoreCase(SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", fme.getFaction().getTag())))) {
e.setCancelled(true);
ItemStack[] items = buildItems(fme);
ItemStack cropItem = items[2];
@@ -93,13 +92,13 @@ public class FUpgradesGUI implements Listener {
case 3:
return;
case 2:
upgradeItem(fme, UpgradeType.CROP, 3, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-3"));
upgradeItem(fme, UpgradeType.CROP, 3, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-3"));
break;
case 1:
upgradeItem(fme, UpgradeType.CROP, 2, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-2"));
upgradeItem(fme, UpgradeType.CROP, 2, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-2"));
break;
case 0:
upgradeItem(fme, UpgradeType.CROP, 1, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-1"));
upgradeItem(fme, UpgradeType.CROP, 1, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.Cost.level-1"));
break;
}
} else if (e.getCurrentItem().equals(powerItem)) {
@@ -108,15 +107,15 @@ public class FUpgradesGUI implements Listener {
case 3:
return;
case 2:
upgradeItem(fme, UpgradeType.POWER, 3, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Cost.level-3"));
upgradeItem(fme, UpgradeType.POWER, 3, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Cost.level-3"));
updatePower(fme.getFaction());
break;
case 1:
upgradeItem(fme, UpgradeType.POWER, 2, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Cost.level-2"));
upgradeItem(fme, UpgradeType.POWER, 2, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Cost.level-2"));
updatePower(fme.getFaction());
break;
case 0:
upgradeItem(fme, UpgradeType.POWER, 1, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Cost.level-1"));
upgradeItem(fme, UpgradeType.POWER, 1, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Cost.level-1"));
updatePower(fme.getFaction());
break;
}
@@ -126,13 +125,13 @@ public class FUpgradesGUI implements Listener {
case 3:
return;
case 2:
upgradeItem(fme, UpgradeType.SPAWNER, 3, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-3"));
upgradeItem(fme, UpgradeType.SPAWNER, 3, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-3"));
break;
case 1:
upgradeItem(fme, UpgradeType.SPAWNER, 2, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-2"));
upgradeItem(fme, UpgradeType.SPAWNER, 2, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-2"));
break;
case 0:
upgradeItem(fme, UpgradeType.SPAWNER, 1, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-1"));
upgradeItem(fme, UpgradeType.SPAWNER, 1, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-1"));
break;
}
} else if (e.getCurrentItem().equals(expItem)) {
@@ -142,13 +141,13 @@ public class FUpgradesGUI implements Listener {
case 3:
return;
case 2:
upgradeItem(fme, UpgradeType.EXP, 3, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-3"));
upgradeItem(fme, UpgradeType.EXP, 3, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-3"));
break;
case 1:
upgradeItem(fme, UpgradeType.EXP, 2, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-2"));
upgradeItem(fme, UpgradeType.EXP, 2, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-2"));
break;
case 0:
upgradeItem(fme, UpgradeType.EXP, 1, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-1"));
upgradeItem(fme, UpgradeType.EXP, 1, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-1"));
break;
}
} else if (e.getCurrentItem().equals(redItem)) {
@@ -157,7 +156,7 @@ public class FUpgradesGUI implements Listener {
case 1:
return;
case 0:
upgradeItem(fme, UpgradeType.REDSTONE, 1, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Redstone.Cost"));
upgradeItem(fme, UpgradeType.REDSTONE, 1, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Redstone.Cost"));
break;
}
} else if (e.getCurrentItem().equals(chestitem)) {
@@ -166,27 +165,27 @@ public class FUpgradesGUI implements Listener {
case 3:
return;
case 2: {
if (upgradeItem(fme, UpgradeType.CHEST, 3, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-3")))
if (upgradeItem(fme, UpgradeType.CHEST, 3, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-3")))
updateChests(fme.getFaction());
break;
}
case 1: {
if (upgradeItem(fme, UpgradeType.CHEST, 2, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-2")))
if (upgradeItem(fme, UpgradeType.CHEST, 2, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-2")))
updateChests(fme.getFaction());
break;
}
case 0: {
if (upgradeItem(fme, UpgradeType.CHEST, 1, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-1")))
if (upgradeItem(fme, UpgradeType.CHEST, 1, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-1")))
updateChests(fme.getFaction());
break;
}
}
} else if(e.getCurrentItem().equals(memberItem)){
int memberLevel = fme.getFaction().getUpgrade(UpgradeType.MEMBERS) + 1;
if(!SavageFactions.plugin.getConfig().isSet("fupgrades.MainMenu.Members.Cost.level-" + memberLevel)){
if(!SaberFactions.plugin.getConfig().isSet("fupgrades.MainMenu.Members.Cost.level-" + memberLevel)){
return;
}
int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.Cost.level-" + memberLevel);
int cost = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.Cost.level-" + memberLevel);
if(hasMoney(fme, cost)){
fme.getFaction().setUpgrade(UpgradeType.MEMBERS, memberLevel);
fme.getPlayer().closeInventory();
@@ -197,7 +196,7 @@ public class FUpgradesGUI implements Listener {
}
private void updateChests(Faction faction) {
String invName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fchest.Inventory-Title"));
String invName = SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fchest.Inventory-Title"));
for (Player player : faction.getOnlinePlayers()) {
if (player.getInventory().getTitle() != null && player.getInventory().getTitle().equalsIgnoreCase(invName))
@@ -209,13 +208,13 @@ public class FUpgradesGUI implements Listener {
switch (level) {
case 1:
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-1");
size = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-1");
break;
case 2:
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-2");
size = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-2");
break;
case 3:
size = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-3");
size = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Chest-Size.level-3");
break;
}
faction.setChestSize(size * 9);
@@ -227,13 +226,13 @@ public class FUpgradesGUI implements Listener {
switch (level) {
case 1:
power = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Power-Boost.level-1");
power = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Power-Boost.level-1");
break;
case 2:
power = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Power-Boost.level-2");
power = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Power-Boost.level-2");
break;
case 3:
power = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Power-Boost.level-3");
power = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.Power-Boost.level-3");
break;
}
faction.setPowerBoost(power);
@@ -241,21 +240,21 @@ public class FUpgradesGUI implements Listener {
@SuppressWarnings("Duplicates")
private ItemStack[] buildItems(FPlayer fme) {
Material expMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.EXP.EXPItem.Type"));
int expAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.EXPItem.Amount");
short expData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.EXPItem.Damage") + "");
String expName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.EXP.EXPItem.Name"));
List<String> expLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.EXP.EXPItem.Lore"));
Material expMaterial = Material.getMaterial(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.EXP.EXPItem.Type"));
int expAmt = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.EXPItem.Amount");
short expData = Short.parseShort(SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.EXPItem.Damage") + "");
String expName = SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.EXP.EXPItem.Name"));
List<String> expLore = SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.EXP.EXPItem.Lore"));
int expLevel = fme.getFaction().getUpgrade(UpgradeType.EXP);
for (int i = 0; i <= expLore.size() - 1; i++)
expLore.set(i, expLore.get(i).replace("{level}", expLevel + ""));
ItemStack expItem = SavageFactions.plugin.createItem(expMaterial, expAmt, expData, expName, expLore);
ItemStack expItem = SaberFactions.plugin.createItem(expMaterial, expAmt, expData, expName, expLore);
if (expLevel >= 1) {
ItemMeta itemMeta = expItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
@@ -264,11 +263,11 @@ public class FUpgradesGUI implements Listener {
expItem.setAmount(expLevel);
}
Material spawnerMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Spawners.SpawnerItem.Type"));
int spawnerAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.SpawnerItem.Amount");
short spawnerData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.SpawnerItem.Damage") + "");
String spawnerName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Spawners.SpawnerItem.Name"));
List<String> spawnerLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Spawners.SpawnerItem.Lore"));
Material spawnerMaterial = Material.getMaterial(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Spawners.SpawnerItem.Type"));
int spawnerAmt = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.SpawnerItem.Amount");
short spawnerData = Short.parseShort(SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.SpawnerItem.Damage") + "");
String spawnerName = SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Spawners.SpawnerItem.Name"));
List<String> spawnerLore = SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Spawners.SpawnerItem.Lore"));
int spawnerLevel = fme.getFaction().getUpgrade(UpgradeType.SPAWNER);
for (int i = 0; i <= spawnerLore.size() - 1; i++) {
@@ -277,11 +276,11 @@ public class FUpgradesGUI implements Listener {
Material cropMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Type"));
int cropAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Amount");
short cropData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Damage") + "");
String cropName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Name"));
List<String> cropLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Crops.CropItem.Lore"));
Material cropMaterial = Material.getMaterial(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Type"));
int cropAmt = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Amount");
short cropData = Short.parseShort(SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Crops.CropItem.Damage") + "");
String cropName = SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Crops.CropItem.Name"));
List<String> cropLore = SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Crops.CropItem.Lore"));
int cropLevel = fme.getFaction().getUpgrade(UpgradeType.CROP);
for (int i = 0; i <= cropLore.size() - 1; i++) {
@@ -290,12 +289,12 @@ public class FUpgradesGUI implements Listener {
cropLore.set(i, line);
}
ItemStack cropItem = SavageFactions.plugin.createItem(cropMaterial, cropAmt, cropData, cropName, cropLore);
ItemStack cropItem = SaberFactions.plugin.createItem(cropMaterial, cropAmt, cropData, cropName, cropLore);
cropItem.getItemMeta().setLore(cropLore);
if (cropLevel >= 1) {
ItemMeta itemMeta = cropItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
@@ -304,11 +303,11 @@ public class FUpgradesGUI implements Listener {
cropItem.setAmount(cropLevel);
}
ItemStack spawnerItem = SavageFactions.plugin.createItem(spawnerMaterial, spawnerAmt, spawnerData, spawnerName, spawnerLore);
ItemStack spawnerItem = SaberFactions.plugin.createItem(spawnerMaterial, spawnerAmt, spawnerData, spawnerName, spawnerLore);
spawnerItem.getItemMeta().setLore(spawnerLore);
if (spawnerLevel >= 1) {
ItemMeta itemMeta = spawnerItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
@@ -317,11 +316,11 @@ public class FUpgradesGUI implements Listener {
spawnerItem.setAmount(spawnerLevel);
}
Material chestMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Chest.ChestItem.Type"));
int chesttAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.ChestItem.Amount");
short chestData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.ChestItem.Damage") + "");
String chestName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Chest.ChestItem.Name", "&e&lUpgrade Chest Size"));
List<String> chestLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Chest.ChestItem.Lore"));
Material chestMaterial = Material.getMaterial(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Chest.ChestItem.Type"));
int chesttAmt = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.ChestItem.Amount");
short chestData = Short.parseShort(SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.ChestItem.Damage") + "");
String chestName = SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Chest.ChestItem.Name", "&e&lUpgrade Chest Size"));
List<String> chestLore = SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Chest.ChestItem.Lore"));
int chestlevel = fme.getFaction().getUpgrade(UpgradeType.CHEST);
for (int i = 0; i <= chestLore.size() - 1; i++) {
@@ -330,11 +329,11 @@ public class FUpgradesGUI implements Listener {
chestLore.set(i, line);
}
ItemStack chestItem = SavageFactions.plugin.createItem(chestMaterial, chesttAmt, chestData, chestName, chestLore);
ItemStack chestItem = SaberFactions.plugin.createItem(chestMaterial, chesttAmt, chestData, chestName, chestLore);
if (chestlevel >= 1) {
ItemMeta itemMeta = chestItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
@@ -343,11 +342,11 @@ public class FUpgradesGUI implements Listener {
chestItem.setAmount(chestlevel);
}
Material memberMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Members.MembersItem.Type"));
int memberAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.MembersItem.Amount");
short memberData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.MembersItem.Damage") + "");
String memberName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Members.MembersItem.Name", "&e&lUpgrade Member Size"));
List<String> memberLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Members.MembersItem.Lore"));
Material memberMaterial = Material.getMaterial(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Members.MembersItem.Type"));
int memberAmt = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.MembersItem.Amount");
short memberData = Short.parseShort(SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Members.MembersItem.Damage") + "");
String memberName = SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Members.MembersItem.Name", "&e&lUpgrade Member Size"));
List<String> memberLore = SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Members.MembersItem.Lore"));
int memberlevel = fme.getFaction().getUpgrade(UpgradeType.MEMBERS);
for (int i = 0; i <= memberLore.size() - 1; i++) {
@@ -356,11 +355,11 @@ public class FUpgradesGUI implements Listener {
memberLore.set(i, line);
}
ItemStack memberItem = SavageFactions.plugin.createItem(memberMaterial, memberAmt, memberData, memberName, memberLore);
ItemStack memberItem = SaberFactions.plugin.createItem(memberMaterial, memberAmt, memberData, memberName, memberLore);
if (memberlevel >= 1) {
ItemMeta itemMeta = memberItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
@@ -369,11 +368,11 @@ public class FUpgradesGUI implements Listener {
memberItem.setAmount(memberlevel);
}
Material powerMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Power.PowerItem.Type"));
int powerAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.PowerItem.Amount");
short powerData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.PowerItem.Damage") + "");
String powerName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Power.PowerItem.Name"));
List<String> powerLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Power.PowerItem.Lore"));
Material powerMaterial = Material.getMaterial(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Power.PowerItem.Type"));
int powerAmt = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.PowerItem.Amount");
short powerData = Short.parseShort(SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Power.PowerItem.Damage") + "");
String powerName = SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Power.PowerItem.Name"));
List<String> powerLore = SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Power.PowerItem.Lore"));
int powerLevel = fme.getFaction().getUpgrade(UpgradeType.POWER);
for (int i = 0; i <= powerLore.size() - 1; i++) {
@@ -382,12 +381,12 @@ public class FUpgradesGUI implements Listener {
powerLore.set(i, line);
}
ItemStack powerItem = SavageFactions.plugin.createItem(powerMaterial, powerAmt, powerData, powerName, powerLore);
ItemStack powerItem = SaberFactions.plugin.createItem(powerMaterial, powerAmt, powerData, powerName, powerLore);
powerItem.getItemMeta().setLore(powerLore);
if (powerLevel >= 1) {
ItemMeta itemMeta = powerItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);
@@ -396,11 +395,11 @@ public class FUpgradesGUI implements Listener {
powerItem.setAmount(powerLevel);
}
Material redMaterial = Material.getMaterial(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Redstone.RedstoneItem.Type"));
int redAmt = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Redstone.RedstoneItem.Amount");
short redData = Short.parseShort(SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Redstone.RedstoneItem.Damage") + "");
String redName = SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fupgrades.MainMenu.Redstone.RedstoneItem.Name"));
List<String> redLore = SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Redstone.RedstoneItem.Lore"));
Material redMaterial = Material.getMaterial(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Redstone.RedstoneItem.Type"));
int redAmt = SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Redstone.RedstoneItem.Amount");
short redData = Short.parseShort(SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Redstone.RedstoneItem.Damage") + "");
String redName = SaberFactions.plugin.color(SaberFactions.plugin.getConfig().getString("fupgrades.MainMenu.Redstone.RedstoneItem.Name"));
List<String> redLore = SaberFactions.plugin.colorList(SaberFactions.plugin.getConfig().getStringList("fupgrades.MainMenu.Redstone.RedstoneItem.Lore"));
int redLevel = fme.getFaction().getUpgrade(UpgradeType.REDSTONE);
for (int i = 0; i <= redLore.size() - 1; i++) {
@@ -409,12 +408,12 @@ public class FUpgradesGUI implements Listener {
redLore.set(i, line);
}
ItemStack redItem = SavageFactions.plugin.createItem(redMaterial, redAmt, redData, redName, redLore);
ItemStack redItem = SaberFactions.plugin.createItem(redMaterial, redAmt, redData, redName, redLore);
redItem.getItemMeta().setLore(redLore);
if (redLevel >= 1) {
ItemMeta itemMeta = redItem.getItemMeta();
if (!SavageFactions.plugin.mc17) {
if (!SaberFactions.plugin.mc17) {
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
itemMeta.addEnchant(Enchantment.DURABILITY, 3, true);

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore.fupgrades;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockFromToEvent;
@@ -14,7 +14,7 @@ public class RedstoneUpgrade implements Listener {
@EventHandler
public void onWaterRedstone(BlockFromToEvent e) {
List<String> unbreakable = SavageFactions.plugin.getConfig().getStringList("no-water-destroy.Item-List");
List<String> unbreakable = SaberFactions.plugin.getConfig().getStringList("no-water-destroy.Item-List");
String block = e.getToBlock().getType().toString();
FLocation floc = new FLocation(e.getToBlock().getLocation());
Faction factionAtLoc = Board.getInstance().getFactionAt(floc);
@@ -24,7 +24,7 @@ public class RedstoneUpgrade implements Listener {
if (level != 0) {
switch (level) {
case 1:
SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Redstone.Cost");
SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Redstone.Cost");
break;
}
if (unbreakable.contains(block)) {

View File

@@ -3,7 +3,7 @@ package com.massivecraft.factions.zcore.fupgrades;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.SaberFactions;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.SpawnerSpawnEvent;
@@ -20,13 +20,13 @@ public class SpawnerUpgrades implements Listener {
if (level != 0) {
switch (level) {
case 1:
lowerSpawnerDelay(e, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-1"));
lowerSpawnerDelay(e, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-1"));
break;
case 2:
lowerSpawnerDelay(e, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-2"));
lowerSpawnerDelay(e, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-2"));
break;
case 3:
lowerSpawnerDelay(e, SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-3"));
lowerSpawnerDelay(e, SaberFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Spawner-Boost.level-3"));
break;
}
}

View File

@@ -158,7 +158,7 @@ public abstract class MemoryBoard extends Board {
while (iter.hasNext()) {
Entry<FLocation, String> entry = iter.next();
if (!Factions.getInstance().isValidFactionId(entry.getValue())) {
SavageFactions.plugin.log("Board cleaner removed " + entry.getValue() + " from " + entry.getKey());
SaberFactions.plugin.log("Board cleaner removed " + entry.getValue() + " from " + entry.getKey());
iter.remove();
}
}
@@ -200,12 +200,12 @@ public abstract class MemoryBoard extends Board {
Faction faction = fplayer.getFaction();
ArrayList<FancyMessage> ret = new ArrayList<>();
Faction factionLoc = getFactionAt(flocation);
ret.add(new FancyMessage(ChatColor.DARK_GRAY + SavageFactions.plugin.txt.titleize("(" + flocation.getCoordString() + ") " + factionLoc.getTag(fplayer))));
int buffer = SavageFactions.plugin.getConfig().getInt("world-border.buffer", 0);
ret.add(new FancyMessage(ChatColor.DARK_GRAY + SaberFactions.plugin.txt.titleize("(" + flocation.getCoordString() + ") " + factionLoc.getTag(fplayer))));
int buffer = SaberFactions.plugin.getConfig().getInt("world-border.buffer", 0);
// Get the compass
ArrayList<String> asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.DARK_GREEN, SavageFactions.plugin.txt.parse("<gray>"));
ArrayList<String> asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.DARK_GREEN, SaberFactions.plugin.txt.parse("<gray>"));
int halfWidth = Conf.mapWidth / 2;
// Use player's value for height
@@ -292,16 +292,16 @@ public abstract class MemoryBoard extends Board {
@SuppressWarnings("unused")
private List<String> getToolTip(Faction faction, FPlayer to) {
List<String> ret = new ArrayList<>();
List<String> show = SavageFactions.plugin.getConfig().getStringList("map");
List<String> show = SaberFactions.plugin.getConfig().getStringList("map");
if (!faction.isNormal()) {
String tag = faction.getTag(to);
// send header and that's all
String header = show.get(0);
if (TagReplacer.HEADER.contains(header)) {
ret.add(SavageFactions.plugin.txt.titleize(tag));
ret.add(SaberFactions.plugin.txt.titleize(tag));
} else {
ret.add(SavageFactions.plugin.txt.parse(TagReplacer.FACTION.replace(header, tag)));
ret.add(SaberFactions.plugin.txt.parse(TagReplacer.FACTION.replace(header, tag)));
}
return ret; // we only show header for non-normal factions
}
@@ -321,7 +321,7 @@ public abstract class MemoryBoard extends Board {
List<FancyMessage> fancy = TagUtil.parseFancy(faction, to, parsed);
if (fancy != null) {
for (FancyMessage msg : fancy) {
ret.add((SavageFactions.plugin.txt.parse(msg.toOldMessageFormat())));
ret.add((SaberFactions.plugin.txt.parse(msg.toOldMessageFormat())));
}
}
continue;
@@ -335,7 +335,7 @@ public abstract class MemoryBoard extends Board {
if (parsed.contains("%")) {
parsed = parsed.replaceAll("%", ""); // Just in case it got in there before we disallowed it.
}
ret.add(SavageFactions.plugin.txt.parse(parsed));
ret.add(SaberFactions.plugin.txt.parse(parsed));
}
}

Some files were not shown because too many files have changed in this diff Show More