Compare commits
16 Commits
2.0.3-BETA
...
2.0.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bdc658922f | ||
|
|
40d6054275 | ||
|
|
93744347db | ||
|
|
b13afcb6a2 | ||
|
|
cd33572460 | ||
|
|
c9eca60c18 | ||
|
|
9b9633aa68 | ||
|
|
b46009f633 | ||
|
|
b1d51f40ce | ||
|
|
f6fc529898 | ||
|
|
f730023b42 | ||
|
|
7339afd60e | ||
|
|
2b0bfae44c | ||
|
|
533bd1b984 | ||
|
|
0b626397a5 | ||
|
|
db669ce2c2 |
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.massivecraft</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<version>1.6.9.5-U0.2.1-2.0.2-BETA</version>
|
||||
<version>1.6.9.5-U0.2.1-2.0.3-BETA</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>SaberFactions</name>
|
||||
|
||||
@@ -161,22 +161,22 @@ public class Conf {
|
||||
public static boolean territoryDenyBuildWhenOffline = true;
|
||||
public static boolean territoryPainBuild = false;
|
||||
public static boolean territoryPainBuildWhenOffline = false;
|
||||
public static boolean territoryDenyUseage = true;
|
||||
public static boolean territoryDenyUsage = true;
|
||||
public static boolean territoryEnemyDenyBuild = true;
|
||||
public static boolean territoryEnemyDenyBuildWhenOffline = true;
|
||||
public static boolean territoryEnemyPainBuild = false;
|
||||
public static boolean territoryEnemyPainBuildWhenOffline = false;
|
||||
public static boolean territoryEnemyDenyUseage = true;
|
||||
public static boolean territoryEnemyDenyUsage = true;
|
||||
public static boolean territoryAllyDenyBuild = true;
|
||||
public static boolean territoryAllyDenyBuildWhenOffline = true;
|
||||
public static boolean territoryAllyPainBuild = false;
|
||||
public static boolean territoryAllyPainBuildWhenOffline = false;
|
||||
public static boolean territoryAllyDenyUseage = true;
|
||||
public static boolean territoryAllyDenyUsage = true;
|
||||
public static boolean territoryTruceDenyBuild = true;
|
||||
public static boolean territoryTruceDenyBuildWhenOffline = true;
|
||||
public static boolean territoryTrucePainBuild = false;
|
||||
public static boolean territoryTrucePainBuildWhenOffline = false;
|
||||
public static boolean territoryTruceDenyUseage = true;
|
||||
public static boolean territoryTruceDenyUsage = true;
|
||||
public static boolean territoryBlockCreepers = false;
|
||||
public static boolean territoryBlockCreepersWhenOffline = false;
|
||||
public static boolean territoryBlockFireballs = false;
|
||||
@@ -186,12 +186,12 @@ public class Conf {
|
||||
public static boolean territoryDenyEndermanBlocks = true;
|
||||
public static boolean territoryDenyEndermanBlocksWhenOffline = true;
|
||||
public static boolean safeZoneDenyBuild = true;
|
||||
public static boolean safeZoneDenyUseage = true;
|
||||
public static boolean safeZoneDenyUsage = true;
|
||||
public static boolean safeZoneBlockTNT = true;
|
||||
public static boolean safeZonePreventAllDamageToPlayers = false;
|
||||
public static boolean safeZoneDenyEndermanBlocks = true;
|
||||
public static boolean warZoneDenyBuild = true;
|
||||
public static boolean warZoneDenyUseage = true;
|
||||
public static boolean warZoneDenyUsage = true;
|
||||
public static boolean warZoneBlockCreepers = false;
|
||||
public static boolean warZoneBlockFireballs = false;
|
||||
public static boolean warZoneBlockTNT = true;
|
||||
@@ -199,7 +199,7 @@ public class Conf {
|
||||
public static boolean warZoneFriendlyFire = false;
|
||||
public static boolean warZoneDenyEndermanBlocks = true;
|
||||
public static boolean wildernessDenyBuild = false;
|
||||
public static boolean wildernessDenyUseage = false;
|
||||
public static boolean wildernessDenyUsage = false;
|
||||
public static boolean wildernessBlockCreepers = false;
|
||||
public static boolean wildernessBlockFireballs = false;
|
||||
public static boolean wildernessBlockTNT = false;
|
||||
@@ -217,9 +217,9 @@ public class Conf {
|
||||
public static boolean ownedMessageByChunk = false;
|
||||
public static boolean pistonProtectionThroughDenyBuild = true;
|
||||
public static Set<Material> territoryProtectedMaterials = EnumSet.noneOf(Material.class);
|
||||
public static Set<Material> territoryDenyUseageMaterials = EnumSet.noneOf(Material.class);
|
||||
public static Set<Material> territoryDenyUsageMaterials = EnumSet.noneOf(Material.class);
|
||||
public static Set<Material> territoryProtectedMaterialsWhenOffline = EnumSet.noneOf(Material.class);
|
||||
public static Set<Material> territoryDenyUseageMaterialsWhenOffline = EnumSet.noneOf(Material.class);
|
||||
public static Set<Material> territoryDenyUsageMaterialsWhenOffline = EnumSet.noneOf(Material.class);
|
||||
public static transient Set<EntityType> safeZoneNerfedCreatureTypes = EnumSet.noneOf(EntityType.class);
|
||||
/// <summary>
|
||||
/// This defines a set of materials which should always be allowed to use, regardless of factions permissions.
|
||||
@@ -388,25 +388,25 @@ public class Conf {
|
||||
// Config is not loading if value is empty ???
|
||||
territoryBypassProtectedMaterials.add(Material.COOKIE);
|
||||
|
||||
territoryDenyUseageMaterials.add(XMaterial.FIRE_CHARGE.parseMaterial());
|
||||
territoryDenyUseageMaterials.add(Material.FLINT_AND_STEEL);
|
||||
territoryDenyUseageMaterials.add(Material.BUCKET);
|
||||
territoryDenyUseageMaterials.add(Material.WATER_BUCKET);
|
||||
territoryDenyUseageMaterials.add(Material.LAVA_BUCKET);
|
||||
territoryDenyUsageMaterials.add(XMaterial.FIRE_CHARGE.parseMaterial());
|
||||
territoryDenyUsageMaterials.add(Material.FLINT_AND_STEEL);
|
||||
territoryDenyUsageMaterials.add(Material.BUCKET);
|
||||
territoryDenyUsageMaterials.add(Material.WATER_BUCKET);
|
||||
territoryDenyUsageMaterials.add(Material.LAVA_BUCKET);
|
||||
if (!FactionsPlugin.getInstance().mc17) {
|
||||
territoryDenyUseageMaterials.add(Material.ARMOR_STAND);
|
||||
territoryDenyUsageMaterials.add(Material.ARMOR_STAND);
|
||||
}
|
||||
|
||||
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.BEACON);
|
||||
|
||||
territoryDenyUseageMaterialsWhenOffline.add(XMaterial.FIRE_CHARGE.parseMaterial());
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL);
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET);
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.WATER_BUCKET);
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.LAVA_BUCKET);
|
||||
territoryDenyUsageMaterialsWhenOffline.add(XMaterial.FIRE_CHARGE.parseMaterial());
|
||||
territoryDenyUsageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL);
|
||||
territoryDenyUsageMaterialsWhenOffline.add(Material.BUCKET);
|
||||
territoryDenyUsageMaterialsWhenOffline.add(Material.WATER_BUCKET);
|
||||
territoryDenyUsageMaterialsWhenOffline.add(Material.LAVA_BUCKET);
|
||||
if (!FactionsPlugin.getInstance().mc17) {
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.ARMOR_STAND);
|
||||
territoryDenyUsageMaterialsWhenOffline.add(Material.ARMOR_STAND);
|
||||
}
|
||||
safeZoneNerfedCreatureTypes.add(EntityType.BLAZE);
|
||||
safeZoneNerfedCreatureTypes.add(EntityType.CAVE_SPIDER);
|
||||
|
||||
@@ -146,18 +146,10 @@ public class FactionsPlugin extends MPlugin {
|
||||
public void onEnable() {
|
||||
log("==== Setup ====");
|
||||
|
||||
|
||||
// Vault dependency check.
|
||||
if (getServer().getPluginManager().getPlugin("Vault") == null) {
|
||||
log("Vault is not present, the plugin will not run properly.");
|
||||
getServer().getPluginManager().disablePlugin(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
|
||||
switch (version) {
|
||||
case 7:
|
||||
FactionsPlugin.instance.log("Minecraft Version 1.7 found, disabling banners, itemflags inside GUIs, and Titles.");
|
||||
FactionsPlugin.instance.log("Minecraft Version 1.7 found, disabling banners, itemflags inside GUIs, corners, and Titles.");
|
||||
mc17 = true;
|
||||
break;
|
||||
case 8:
|
||||
@@ -176,6 +168,18 @@ public class FactionsPlugin extends MPlugin {
|
||||
mc114 = true;
|
||||
break;
|
||||
}
|
||||
//Dependency checks
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("Vault") && Bukkit.getPluginManager().isPluginEnabled("Essentials")) {
|
||||
RegisteredServiceProvider<Economy> rsp = FactionsPlugin.this.getServer().getServicesManager().getRegistration(Economy.class);
|
||||
FactionsPlugin.econ = rsp.getProvider();
|
||||
} else {
|
||||
divider();
|
||||
System.out.println("You are missing dependencies!");
|
||||
System.out.println("Please verify EssentialsX and Vault are installed!");
|
||||
Bukkit.getPluginManager().disablePlugin(instance);
|
||||
divider();
|
||||
return;
|
||||
}
|
||||
migrateFPlayerLeaders();
|
||||
log("==== End Setup ====");
|
||||
|
||||
@@ -184,7 +188,12 @@ public class FactionsPlugin extends MPlugin {
|
||||
}
|
||||
this.loadSuccessful = false;
|
||||
|
||||
saveDefaultConfig();
|
||||
if (!new File(this.getDataFolder() + "/config.yml").exists()) {
|
||||
this.saveResource("config.yml", false);
|
||||
this.reloadConfig();
|
||||
}
|
||||
//Attempt to generate a permission list
|
||||
PermissionList.generateFile();
|
||||
|
||||
// Load Conf from disk
|
||||
Conf.load();
|
||||
@@ -259,7 +268,7 @@ public class FactionsPlugin extends MPlugin {
|
||||
this.getServer().getScheduler().runTaskTimer(this, CheckTask::cleanupTask, 0L, 1200L);
|
||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new WeeWooTask(this), 600L, 600L);
|
||||
}
|
||||
if(Conf.useDiscordSystem) {
|
||||
if(Conf.useDiscordSystem && !Conf.discordBotToken.equals("<token here>")) {
|
||||
new FactionChatHandler(this);
|
||||
} else {
|
||||
System.out.println("\n\n\n SABER-FACTIONS-DISCORD-INTEGRATION - You are not using Discord integration features, set conf.json option useDiscordSystem to true and put a valid token in before using!\n\n\n");
|
||||
@@ -289,10 +298,6 @@ public class FactionsPlugin extends MPlugin {
|
||||
|
||||
if (!CommodoreProvider.isSupported()) this.getCommand(refCommand).setTabCompleter(this);
|
||||
|
||||
|
||||
RegisteredServiceProvider<Economy> rsp = FactionsPlugin.this.getServer().getServicesManager().getRegistration(Economy.class);
|
||||
FactionsPlugin.econ = rsp.getProvider();
|
||||
|
||||
if (getDescription().getFullName().contains("BETA")) {
|
||||
divider();
|
||||
System.out.println("You are using a BETA version of the plugin!");
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.listeners.FactionsPlayerListener;
|
||||
import com.massivecraft.factions.shop.ShopConfig;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -28,6 +29,11 @@ public class CmdReload extends FCommand {
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
|
||||
FactionsPlugin.getInstance().factionsFlight = true;
|
||||
}
|
||||
|
||||
if (!FactionsPlugin.getInstance().mc17) {
|
||||
FactionsPlayerListener.loadCorners();
|
||||
}
|
||||
|
||||
long timeReload = (System.currentTimeMillis() - timeInitStart);
|
||||
|
||||
context.msg(TL.COMMAND_RELOAD_TIME, timeReload);
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.CornerTask;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
@@ -29,6 +31,10 @@ public class CmdCorner extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (FactionsPlugin.getInstance().mc17) {
|
||||
context.player.sendMessage(ChatColor.RED + "This command is disabled!");
|
||||
return;
|
||||
}
|
||||
FLocation to = new FLocation(context.player.getLocation());
|
||||
if (FactionsPlugin.getInstance().getFactionsPlayerListener().getCorners().contains(to)) {
|
||||
Faction cornerAt = Board.getInstance().getFactionAt(to);
|
||||
|
||||
@@ -262,9 +262,9 @@ public class FactionsBlockListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler (ignoreCancelled = true)
|
||||
public void onHopperPlace(BlockPlaceEvent e) {
|
||||
if (e.getItemInHand().getType() != Material.HOPPER && !FactionsPlugin.getInstance().getConfig().getBoolean("fvault.No-Hoppers-near-vault")) {
|
||||
if (e.getItemInHand().getType() != Material.HOPPER || !FactionsPlugin.getInstance().getConfig().getBoolean("fvault.No-Hoppers-near-vault")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,25 +47,31 @@ import java.util.logging.Level;
|
||||
public class FactionsPlayerListener implements Listener {
|
||||
|
||||
HashMap<Player, Boolean> fallMap = new HashMap<>();
|
||||
private Set<FLocation> corners;
|
||||
public static Set<FLocation> corners;
|
||||
// Holds the next time a player can have a map shown.
|
||||
private HashMap<UUID, Long> showTimes = new HashMap<>();
|
||||
// for handling people who repeatedly spam attempts to open a door (or similar) in another faction's territory
|
||||
private Map<String, InteractAttemptSpam> interactSpammers = new HashMap<>();
|
||||
|
||||
public FactionsPlayerListener() {
|
||||
this.corners = new HashSet<>();
|
||||
for (Player player : FactionsPlugin.getInstance().getServer().getOnlinePlayers()) {
|
||||
initPlayer(player);
|
||||
}
|
||||
if (!FactionsPlugin.getInstance().mc17) {
|
||||
loadCorners();
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadCorners() {
|
||||
FactionsPlayerListener.corners = new HashSet<>();
|
||||
for (World world : FactionsPlugin.getInstance().getServer().getWorlds()) {
|
||||
WorldBorder border = world.getWorldBorder();
|
||||
if (border != null) {
|
||||
int cornerCoord = (int) ((border.getSize() - 1.0) / 2.0);
|
||||
this.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(cornerCoord), FLocation.blockToChunk(cornerCoord)));
|
||||
this.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(cornerCoord), FLocation.blockToChunk(-cornerCoord)));
|
||||
this.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(-cornerCoord), FLocation.blockToChunk(cornerCoord)));
|
||||
this.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(-cornerCoord), FLocation.blockToChunk(-cornerCoord)));
|
||||
FactionsPlayerListener.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(cornerCoord), FLocation.blockToChunk(cornerCoord)));
|
||||
FactionsPlayerListener.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(cornerCoord), FLocation.blockToChunk(-cornerCoord)));
|
||||
FactionsPlayerListener.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(-cornerCoord), FLocation.blockToChunk(cornerCoord)));
|
||||
FactionsPlayerListener.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(-cornerCoord), FLocation.blockToChunk(-cornerCoord)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,17 +114,17 @@ public class FactionsPlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (otherFaction.hasPlayersOnline()) {
|
||||
if (!Conf.territoryDenyUseageMaterials.contains(material)) {
|
||||
if (!Conf.territoryDenyUsageMaterials.contains(material)) {
|
||||
return true; // Item isn't one we're preventing for online factions.
|
||||
}
|
||||
} else {
|
||||
if (!Conf.territoryDenyUseageMaterialsWhenOffline.contains(material)) {
|
||||
if (!Conf.territoryDenyUsageMaterialsWhenOffline.contains(material)) {
|
||||
return true; // Item isn't one we're preventing for offline factions.
|
||||
}
|
||||
}
|
||||
|
||||
if (otherFaction.isWilderness()) {
|
||||
if (!Conf.wildernessDenyUseage || Conf.worldsNoWildernessProtection.contains(location.getWorld().getName())) {
|
||||
if (!Conf.wildernessDenyUsage || Conf.worldsNoWildernessProtection.contains(location.getWorld().getName())) {
|
||||
return true; // This is not faction territory. Use whatever you like here.
|
||||
}
|
||||
|
||||
@@ -128,7 +134,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
|
||||
return false;
|
||||
} else if (otherFaction.isSafeZone()) {
|
||||
if (!Conf.safeZoneDenyUseage || Permission.MANAGE_SAFE_ZONE.has(player)) {
|
||||
if (!Conf.safeZoneDenyUsage || Permission.MANAGE_SAFE_ZONE.has(player)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -138,7 +144,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
|
||||
return false;
|
||||
} else if (otherFaction.isWarZone()) {
|
||||
if (!Conf.warZoneDenyUseage || Permission.MANAGE_WAR_ZONE.has(player)) {
|
||||
if (!Conf.warZoneDenyUsage || Permission.MANAGE_WAR_ZONE.has(player)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,7 @@ import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class MissionGUI implements FactionGUI {
|
||||
private FactionsPlugin plugin;
|
||||
@@ -79,30 +76,39 @@ public class MissionGUI implements FactionGUI {
|
||||
if (configurationSection == null) {
|
||||
return;
|
||||
}
|
||||
for (int fill = 0; fill < configurationSection.getInt("FillItem.Rows") * 9; ++fill) {
|
||||
ItemStack fillItem = new ItemStack(XMaterial.matchXMaterial(configurationSection.getString("FillItem.Material")).parseItem());
|
||||
ItemMeta meta = fillItem.getItemMeta();
|
||||
meta.setDisplayName("");
|
||||
fillItem.setItemMeta(meta);
|
||||
inventory.setItem(fill, fillItem);
|
||||
}
|
||||
for (String key : configurationSection.getKeys(false)) {
|
||||
ConfigurationSection section = configurationSection.getConfigurationSection(key);
|
||||
int slot = section.getInt("Slot");
|
||||
if (!key.equals("FillItem")) {
|
||||
ConfigurationSection section = configurationSection.getConfigurationSection(key);
|
||||
int slot = section.getInt("Slot");
|
||||
|
||||
ItemStack itemStack = XMaterial.matchXMaterial(section.getString("Material")).parseItem();
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', section.getString("Name")));
|
||||
List<String> loreLines = new ArrayList<>();
|
||||
for (String line : section.getStringList("Lore")) {
|
||||
loreLines.add(ChatColor.translateAlternateColorCodes('&', line));
|
||||
ItemStack itemStack = XMaterial.matchXMaterial(section.getString("Material")).parseItem();
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', section.getString("Name")));
|
||||
List<String> loreLines = new ArrayList<>();
|
||||
for (String line : section.getStringList("Lore")) {
|
||||
loreLines.add(ChatColor.translateAlternateColorCodes('&', line));
|
||||
}
|
||||
if (fPlayer.getFaction().getMissions().containsKey(key)) {
|
||||
Mission mission = fPlayer.getFaction().getMissions().get(key);
|
||||
itemMeta.addEnchant(Enchantment.SILK_TOUCH, 1, true);
|
||||
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
loreLines.add("");
|
||||
loreLines.add(plugin.color(plugin.getConfig().getString("Mission-Progress-Format")
|
||||
.replace("{progress}", String.valueOf(mission.getProgress()))
|
||||
.replace("{total}", String.valueOf(section.getConfigurationSection("Mission").get("Amount")))));
|
||||
}
|
||||
itemMeta.setLore(loreLines);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
inventory.setItem(slot, itemStack);
|
||||
slots.put(slot, key);
|
||||
}
|
||||
if (fPlayer.getFaction().getMissions().containsKey(key)) {
|
||||
Mission mission = fPlayer.getFaction().getMissions().get(key);
|
||||
itemMeta.addEnchant(Enchantment.SILK_TOUCH, 1, true);
|
||||
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
loreLines.add("");
|
||||
loreLines.add(plugin.color(plugin.getConfig().getString("Mission-Progress-Format")
|
||||
.replace("{progress}", String.valueOf(mission.getProgress()))
|
||||
.replace("{total}", String.valueOf(section.getConfigurationSection("Mission").get("Amount")))));
|
||||
}
|
||||
itemMeta.setLore(loreLines);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
inventory.setItem(slot, itemStack);
|
||||
slots.put(slot, key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,13 +174,13 @@ public enum Relation implements Permissable {
|
||||
if (isMember()) {
|
||||
return false;
|
||||
} else if (isEnemy()) {
|
||||
return Conf.territoryEnemyDenyUseage;
|
||||
return Conf.territoryEnemyDenyUsage;
|
||||
} else if (isAlly()) {
|
||||
return Conf.territoryAllyDenyUseage;
|
||||
return Conf.territoryAllyDenyUsage;
|
||||
} else if (isTruce()) {
|
||||
return Conf.territoryTruceDenyUseage;
|
||||
return Conf.territoryTruceDenyUsage;
|
||||
} else {
|
||||
return Conf.territoryDenyUseage;
|
||||
return Conf.territoryDenyUsage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.tag;
|
||||
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -12,7 +13,8 @@ public enum GeneralTag implements Tag {
|
||||
MAX_ALLIES("{max-allies}", () -> getRelation("ally")),
|
||||
MAX_ENEMIES("{max-enemies}", () -> getRelation("enemy")),
|
||||
MAX_TRUCES("{max-truces}", () -> getRelation("truce")),
|
||||
FACTIONLESS("{factionless}", () -> String.valueOf(Factions.getInstance().getNone().getFPlayersWhereOnline(true).size())),
|
||||
FACTIONLESS("factionless", () -> String.valueOf(FPlayers.getInstance().getOnlinePlayers().stream().filter(p -> !p.hasFaction()).count())),
|
||||
FACTIONLESS_TOTAL("factionless-total", () -> String.valueOf(FPlayers.getInstance().getAllFPlayers().stream().filter(p -> !p.hasFaction()).count())),
|
||||
TOTAL_ONLINE("{total-online}", () -> String.valueOf(Bukkit.getOnlinePlayers().size())),
|
||||
;
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@ public class CornerTask extends BukkitRunnable {
|
||||
FLocation fLocation = surrounding.remove(0);
|
||||
if (fPlayer.attemptClaim(fPlayer.getFaction(), fLocation, true)) {
|
||||
++amount;
|
||||
} else {
|
||||
fPlayer.sendMessage(TL.COMMAND_CORNER_FAIL_WITH_FEEDBACK.toString().replace("&", "§") + amount);
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.massivecraft.factions.util;
|
||||
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PermissionList {
|
||||
public static void generateFile() {
|
||||
File file = new File(FactionsPlugin.getInstance().getDataFolder().toString() + "/" + "permissions.yml");
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
FactionsPlugin.getInstance().log("Generating a file with all permissions...");
|
||||
file.createNewFile();
|
||||
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
|
||||
for (Permission p : Permission.values()) {
|
||||
config.set(p.node, p.name());
|
||||
}
|
||||
config.save(file);
|
||||
FactionsPlugin.getInstance().log("Generation complete you can find this file at " + FactionsPlugin.getInstance().getDataFolder().toString() + "/" + "permissions.yml");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,6 +123,7 @@ public enum TL {
|
||||
COMMAND_CORNER_CANT_CLAIM("&c&l[!] &cYou may not claim this corner!"),
|
||||
COMMAND_CORNER_CLAIMED("\n&2&l[!] &aYou have claimed the corner successfully, totalling in &b%1$d &achunks!\n"),
|
||||
COMMAND_CORNER_ATTEMPTING_CLAIM("&c&l[!] &7Attempting to claim corner..."),
|
||||
COMMAND_CORNER_FAIL_WITH_FEEDBACK("&c&l[!] &cOne or more claims in this corner could not be claimed! Total chunks claimed:&b "),
|
||||
COMMAND_CORNER_NOT_CORNER("&c&l[!] &7You must be in a corner to use this command!"),
|
||||
COMMAND_CORNER_DESCRIPTION("claim a corner at world border"),
|
||||
COMMAND_CORNERLIST_DESCRIPTION("list of all corners"),
|
||||
@@ -967,7 +968,7 @@ public enum TL {
|
||||
CLAIM_MEMBERS("Factions must have at least %s members to claim land."),
|
||||
CLAIM_SAFEZONE("You can not claim a Safe Zone."),
|
||||
CLAIM_WARZONE("You can not claim a War Zone."),
|
||||
CLAIM_POWER("You can't claim more land!You need more power!"),
|
||||
CLAIM_POWER("You can't claim more land! You need more power!"),
|
||||
CLAIM_LIMIT("Limit reached. You can't claim more land!"),
|
||||
CLAIM_ALLY("You can't claim the land of your allies."),
|
||||
CLAIM_CONTIGIOUS("You can only claim additional land which is connected to your first claim or controlled by another faction!"),
|
||||
|
||||
@@ -756,6 +756,9 @@ DenyMissionsMoreThenOnce: true #this setting to true, means that if they complet
|
||||
|
||||
#Mission Types: KILL, MINE, PLACE, FISH, TAME, ENCHANT, CONSUME
|
||||
Missions:
|
||||
FillItem:
|
||||
Material: BLACK_STAINED_GLASS_PANE
|
||||
Rows: 3
|
||||
sugarcane:
|
||||
Slot: 11
|
||||
Material: "SUGAR_CANE"
|
||||
@@ -1324,6 +1327,7 @@ Tntfill:
|
||||
# - {offline-list} : Lists all offline members with tooltips
|
||||
# - {alts} : List all alts online or offline
|
||||
# - {truces-list} : Lists each faction truce with tooltips
|
||||
# - {factionless-total} : Count of all factionless players online
|
||||
|
||||
# Player variables. Can be used in tooltips.show, scoreboards, or /f show
|
||||
# - {group} : Players group
|
||||
|
||||
@@ -65,6 +65,8 @@ permissions:
|
||||
factions.kit.halfplayer:
|
||||
description: Can do all but create factions.
|
||||
children:
|
||||
factions.missions: true
|
||||
factions.shop: true
|
||||
factions.permissions: true
|
||||
factions.setdiscord: true
|
||||
factions.discord: true
|
||||
@@ -118,6 +120,7 @@ permissions:
|
||||
factions.checkpoint: true
|
||||
factions.rules: true
|
||||
factions.setwarp: true
|
||||
factions.warp: true
|
||||
factions.banner: true
|
||||
factions.vault: true
|
||||
factions.getvault: true
|
||||
|
||||
Reference in New Issue
Block a user