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>
|
<groupId>com.massivecraft</groupId>
|
||||||
<artifactId>Factions</artifactId>
|
<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>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>SaberFactions</name>
|
<name>SaberFactions</name>
|
||||||
|
|||||||
@@ -161,22 +161,22 @@ public class Conf {
|
|||||||
public static boolean territoryDenyBuildWhenOffline = true;
|
public static boolean territoryDenyBuildWhenOffline = true;
|
||||||
public static boolean territoryPainBuild = false;
|
public static boolean territoryPainBuild = false;
|
||||||
public static boolean territoryPainBuildWhenOffline = false;
|
public static boolean territoryPainBuildWhenOffline = false;
|
||||||
public static boolean territoryDenyUseage = true;
|
public static boolean territoryDenyUsage = true;
|
||||||
public static boolean territoryEnemyDenyBuild = true;
|
public static boolean territoryEnemyDenyBuild = true;
|
||||||
public static boolean territoryEnemyDenyBuildWhenOffline = true;
|
public static boolean territoryEnemyDenyBuildWhenOffline = true;
|
||||||
public static boolean territoryEnemyPainBuild = false;
|
public static boolean territoryEnemyPainBuild = false;
|
||||||
public static boolean territoryEnemyPainBuildWhenOffline = false;
|
public static boolean territoryEnemyPainBuildWhenOffline = false;
|
||||||
public static boolean territoryEnemyDenyUseage = true;
|
public static boolean territoryEnemyDenyUsage = true;
|
||||||
public static boolean territoryAllyDenyBuild = true;
|
public static boolean territoryAllyDenyBuild = true;
|
||||||
public static boolean territoryAllyDenyBuildWhenOffline = true;
|
public static boolean territoryAllyDenyBuildWhenOffline = true;
|
||||||
public static boolean territoryAllyPainBuild = false;
|
public static boolean territoryAllyPainBuild = false;
|
||||||
public static boolean territoryAllyPainBuildWhenOffline = false;
|
public static boolean territoryAllyPainBuildWhenOffline = false;
|
||||||
public static boolean territoryAllyDenyUseage = true;
|
public static boolean territoryAllyDenyUsage = true;
|
||||||
public static boolean territoryTruceDenyBuild = true;
|
public static boolean territoryTruceDenyBuild = true;
|
||||||
public static boolean territoryTruceDenyBuildWhenOffline = true;
|
public static boolean territoryTruceDenyBuildWhenOffline = true;
|
||||||
public static boolean territoryTrucePainBuild = false;
|
public static boolean territoryTrucePainBuild = false;
|
||||||
public static boolean territoryTrucePainBuildWhenOffline = false;
|
public static boolean territoryTrucePainBuildWhenOffline = false;
|
||||||
public static boolean territoryTruceDenyUseage = true;
|
public static boolean territoryTruceDenyUsage = true;
|
||||||
public static boolean territoryBlockCreepers = false;
|
public static boolean territoryBlockCreepers = false;
|
||||||
public static boolean territoryBlockCreepersWhenOffline = false;
|
public static boolean territoryBlockCreepersWhenOffline = false;
|
||||||
public static boolean territoryBlockFireballs = false;
|
public static boolean territoryBlockFireballs = false;
|
||||||
@@ -186,12 +186,12 @@ public class Conf {
|
|||||||
public static boolean territoryDenyEndermanBlocks = true;
|
public static boolean territoryDenyEndermanBlocks = true;
|
||||||
public static boolean territoryDenyEndermanBlocksWhenOffline = true;
|
public static boolean territoryDenyEndermanBlocksWhenOffline = true;
|
||||||
public static boolean safeZoneDenyBuild = true;
|
public static boolean safeZoneDenyBuild = true;
|
||||||
public static boolean safeZoneDenyUseage = true;
|
public static boolean safeZoneDenyUsage = true;
|
||||||
public static boolean safeZoneBlockTNT = true;
|
public static boolean safeZoneBlockTNT = true;
|
||||||
public static boolean safeZonePreventAllDamageToPlayers = false;
|
public static boolean safeZonePreventAllDamageToPlayers = false;
|
||||||
public static boolean safeZoneDenyEndermanBlocks = true;
|
public static boolean safeZoneDenyEndermanBlocks = true;
|
||||||
public static boolean warZoneDenyBuild = true;
|
public static boolean warZoneDenyBuild = true;
|
||||||
public static boolean warZoneDenyUseage = true;
|
public static boolean warZoneDenyUsage = true;
|
||||||
public static boolean warZoneBlockCreepers = false;
|
public static boolean warZoneBlockCreepers = false;
|
||||||
public static boolean warZoneBlockFireballs = false;
|
public static boolean warZoneBlockFireballs = false;
|
||||||
public static boolean warZoneBlockTNT = true;
|
public static boolean warZoneBlockTNT = true;
|
||||||
@@ -199,7 +199,7 @@ public class Conf {
|
|||||||
public static boolean warZoneFriendlyFire = false;
|
public static boolean warZoneFriendlyFire = false;
|
||||||
public static boolean warZoneDenyEndermanBlocks = true;
|
public static boolean warZoneDenyEndermanBlocks = true;
|
||||||
public static boolean wildernessDenyBuild = false;
|
public static boolean wildernessDenyBuild = false;
|
||||||
public static boolean wildernessDenyUseage = false;
|
public static boolean wildernessDenyUsage = false;
|
||||||
public static boolean wildernessBlockCreepers = false;
|
public static boolean wildernessBlockCreepers = false;
|
||||||
public static boolean wildernessBlockFireballs = false;
|
public static boolean wildernessBlockFireballs = false;
|
||||||
public static boolean wildernessBlockTNT = false;
|
public static boolean wildernessBlockTNT = false;
|
||||||
@@ -217,9 +217,9 @@ public class Conf {
|
|||||||
public static boolean ownedMessageByChunk = false;
|
public static boolean ownedMessageByChunk = false;
|
||||||
public static boolean pistonProtectionThroughDenyBuild = true;
|
public static boolean pistonProtectionThroughDenyBuild = true;
|
||||||
public static Set<Material> territoryProtectedMaterials = EnumSet.noneOf(Material.class);
|
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> 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);
|
public static transient Set<EntityType> safeZoneNerfedCreatureTypes = EnumSet.noneOf(EntityType.class);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This defines a set of materials which should always be allowed to use, regardless of factions permissions.
|
/// 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 ???
|
// Config is not loading if value is empty ???
|
||||||
territoryBypassProtectedMaterials.add(Material.COOKIE);
|
territoryBypassProtectedMaterials.add(Material.COOKIE);
|
||||||
|
|
||||||
territoryDenyUseageMaterials.add(XMaterial.FIRE_CHARGE.parseMaterial());
|
territoryDenyUsageMaterials.add(XMaterial.FIRE_CHARGE.parseMaterial());
|
||||||
territoryDenyUseageMaterials.add(Material.FLINT_AND_STEEL);
|
territoryDenyUsageMaterials.add(Material.FLINT_AND_STEEL);
|
||||||
territoryDenyUseageMaterials.add(Material.BUCKET);
|
territoryDenyUsageMaterials.add(Material.BUCKET);
|
||||||
territoryDenyUseageMaterials.add(Material.WATER_BUCKET);
|
territoryDenyUsageMaterials.add(Material.WATER_BUCKET);
|
||||||
territoryDenyUseageMaterials.add(Material.LAVA_BUCKET);
|
territoryDenyUsageMaterials.add(Material.LAVA_BUCKET);
|
||||||
if (!FactionsPlugin.getInstance().mc17) {
|
if (!FactionsPlugin.getInstance().mc17) {
|
||||||
territoryDenyUseageMaterials.add(Material.ARMOR_STAND);
|
territoryDenyUsageMaterials.add(Material.ARMOR_STAND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
territoryProtectedMaterialsWhenOffline.add(Material.BEACON);
|
territoryProtectedMaterialsWhenOffline.add(Material.BEACON);
|
||||||
|
|
||||||
territoryDenyUseageMaterialsWhenOffline.add(XMaterial.FIRE_CHARGE.parseMaterial());
|
territoryDenyUsageMaterialsWhenOffline.add(XMaterial.FIRE_CHARGE.parseMaterial());
|
||||||
territoryDenyUseageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL);
|
territoryDenyUsageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL);
|
||||||
territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET);
|
territoryDenyUsageMaterialsWhenOffline.add(Material.BUCKET);
|
||||||
territoryDenyUseageMaterialsWhenOffline.add(Material.WATER_BUCKET);
|
territoryDenyUsageMaterialsWhenOffline.add(Material.WATER_BUCKET);
|
||||||
territoryDenyUseageMaterialsWhenOffline.add(Material.LAVA_BUCKET);
|
territoryDenyUsageMaterialsWhenOffline.add(Material.LAVA_BUCKET);
|
||||||
if (!FactionsPlugin.getInstance().mc17) {
|
if (!FactionsPlugin.getInstance().mc17) {
|
||||||
territoryDenyUseageMaterialsWhenOffline.add(Material.ARMOR_STAND);
|
territoryDenyUsageMaterialsWhenOffline.add(Material.ARMOR_STAND);
|
||||||
}
|
}
|
||||||
safeZoneNerfedCreatureTypes.add(EntityType.BLAZE);
|
safeZoneNerfedCreatureTypes.add(EntityType.BLAZE);
|
||||||
safeZoneNerfedCreatureTypes.add(EntityType.CAVE_SPIDER);
|
safeZoneNerfedCreatureTypes.add(EntityType.CAVE_SPIDER);
|
||||||
|
|||||||
@@ -146,18 +146,10 @@ public class FactionsPlugin extends MPlugin {
|
|||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
log("==== Setup ====");
|
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]);
|
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
|
||||||
switch (version) {
|
switch (version) {
|
||||||
case 7:
|
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;
|
mc17 = true;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
@@ -176,6 +168,18 @@ public class FactionsPlugin extends MPlugin {
|
|||||||
mc114 = true;
|
mc114 = true;
|
||||||
break;
|
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();
|
migrateFPlayerLeaders();
|
||||||
log("==== End Setup ====");
|
log("==== End Setup ====");
|
||||||
|
|
||||||
@@ -184,7 +188,12 @@ public class FactionsPlugin extends MPlugin {
|
|||||||
}
|
}
|
||||||
this.loadSuccessful = false;
|
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
|
// Load Conf from disk
|
||||||
Conf.load();
|
Conf.load();
|
||||||
@@ -259,7 +268,7 @@ public class FactionsPlugin extends MPlugin {
|
|||||||
this.getServer().getScheduler().runTaskTimer(this, CheckTask::cleanupTask, 0L, 1200L);
|
this.getServer().getScheduler().runTaskTimer(this, CheckTask::cleanupTask, 0L, 1200L);
|
||||||
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new WeeWooTask(this), 600L, 600L);
|
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new WeeWooTask(this), 600L, 600L);
|
||||||
}
|
}
|
||||||
if(Conf.useDiscordSystem) {
|
if(Conf.useDiscordSystem && !Conf.discordBotToken.equals("<token here>")) {
|
||||||
new FactionChatHandler(this);
|
new FactionChatHandler(this);
|
||||||
} else {
|
} 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");
|
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);
|
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")) {
|
if (getDescription().getFullName().contains("BETA")) {
|
||||||
divider();
|
divider();
|
||||||
System.out.println("You are using a BETA version of the plugin!");
|
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.Conf;
|
||||||
import com.massivecraft.factions.FactionsPlugin;
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
|
import com.massivecraft.factions.listeners.FactionsPlayerListener;
|
||||||
import com.massivecraft.factions.shop.ShopConfig;
|
import com.massivecraft.factions.shop.ShopConfig;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
@@ -28,6 +29,11 @@ public class CmdReload extends FCommand {
|
|||||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
|
if (FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
|
||||||
FactionsPlugin.getInstance().factionsFlight = true;
|
FactionsPlugin.getInstance().factionsFlight = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!FactionsPlugin.getInstance().mc17) {
|
||||||
|
FactionsPlayerListener.loadCorners();
|
||||||
|
}
|
||||||
|
|
||||||
long timeReload = (System.currentTimeMillis() - timeInitStart);
|
long timeReload = (System.currentTimeMillis() - timeInitStart);
|
||||||
|
|
||||||
context.msg(TL.COMMAND_RELOAD_TIME, timeReload);
|
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.util.CornerTask;
|
||||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@@ -29,6 +31,10 @@ public class CmdCorner extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
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());
|
FLocation to = new FLocation(context.player.getLocation());
|
||||||
if (FactionsPlugin.getInstance().getFactionsPlayerListener().getCorners().contains(to)) {
|
if (FactionsPlugin.getInstance().getFactionsPlayerListener().getCorners().contains(to)) {
|
||||||
Faction cornerAt = Board.getInstance().getFactionAt(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) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,25 +47,31 @@ import java.util.logging.Level;
|
|||||||
public class FactionsPlayerListener implements Listener {
|
public class FactionsPlayerListener implements Listener {
|
||||||
|
|
||||||
HashMap<Player, Boolean> fallMap = new HashMap<>();
|
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.
|
// Holds the next time a player can have a map shown.
|
||||||
private HashMap<UUID, Long> showTimes = new HashMap<>();
|
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
|
// 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<>();
|
private Map<String, InteractAttemptSpam> interactSpammers = new HashMap<>();
|
||||||
|
|
||||||
public FactionsPlayerListener() {
|
public FactionsPlayerListener() {
|
||||||
this.corners = new HashSet<>();
|
|
||||||
for (Player player : FactionsPlugin.getInstance().getServer().getOnlinePlayers()) {
|
for (Player player : FactionsPlugin.getInstance().getServer().getOnlinePlayers()) {
|
||||||
initPlayer(player);
|
initPlayer(player);
|
||||||
}
|
}
|
||||||
|
if (!FactionsPlugin.getInstance().mc17) {
|
||||||
|
loadCorners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void loadCorners() {
|
||||||
|
FactionsPlayerListener.corners = new HashSet<>();
|
||||||
for (World world : FactionsPlugin.getInstance().getServer().getWorlds()) {
|
for (World world : FactionsPlugin.getInstance().getServer().getWorlds()) {
|
||||||
WorldBorder border = world.getWorldBorder();
|
WorldBorder border = world.getWorldBorder();
|
||||||
if (border != null) {
|
if (border != null) {
|
||||||
int cornerCoord = (int) ((border.getSize() - 1.0) / 2.0);
|
int cornerCoord = (int) ((border.getSize() - 1.0) / 2.0);
|
||||||
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)));
|
||||||
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)));
|
||||||
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)));
|
||||||
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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,17 +114,17 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (otherFaction.hasPlayersOnline()) {
|
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.
|
return true; // Item isn't one we're preventing for online factions.
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!Conf.territoryDenyUseageMaterialsWhenOffline.contains(material)) {
|
if (!Conf.territoryDenyUsageMaterialsWhenOffline.contains(material)) {
|
||||||
return true; // Item isn't one we're preventing for offline factions.
|
return true; // Item isn't one we're preventing for offline factions.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (otherFaction.isWilderness()) {
|
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.
|
return true; // This is not faction territory. Use whatever you like here.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +134,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else if (otherFaction.isSafeZone()) {
|
} else if (otherFaction.isSafeZone()) {
|
||||||
if (!Conf.safeZoneDenyUseage || Permission.MANAGE_SAFE_ZONE.has(player)) {
|
if (!Conf.safeZoneDenyUsage || Permission.MANAGE_SAFE_ZONE.has(player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +144,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else if (otherFaction.isWarZone()) {
|
} else if (otherFaction.isWarZone()) {
|
||||||
if (!Conf.warZoneDenyUseage || Permission.MANAGE_WAR_ZONE.has(player)) {
|
if (!Conf.warZoneDenyUsage || Permission.MANAGE_WAR_ZONE.has(player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ import org.bukkit.inventory.ItemFlag;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class MissionGUI implements FactionGUI {
|
public class MissionGUI implements FactionGUI {
|
||||||
private FactionsPlugin plugin;
|
private FactionsPlugin plugin;
|
||||||
@@ -79,7 +76,15 @@ public class MissionGUI implements FactionGUI {
|
|||||||
if (configurationSection == null) {
|
if (configurationSection == null) {
|
||||||
return;
|
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)) {
|
for (String key : configurationSection.getKeys(false)) {
|
||||||
|
if (!key.equals("FillItem")) {
|
||||||
ConfigurationSection section = configurationSection.getConfigurationSection(key);
|
ConfigurationSection section = configurationSection.getConfigurationSection(key);
|
||||||
int slot = section.getInt("Slot");
|
int slot = section.getInt("Slot");
|
||||||
|
|
||||||
@@ -105,6 +110,7 @@ public class MissionGUI implements FactionGUI {
|
|||||||
slots.put(slot, key);
|
slots.put(slot, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Inventory getInventory() {
|
public Inventory getInventory() {
|
||||||
return inventory;
|
return inventory;
|
||||||
|
|||||||
@@ -174,13 +174,13 @@ public enum Relation implements Permissable {
|
|||||||
if (isMember()) {
|
if (isMember()) {
|
||||||
return false;
|
return false;
|
||||||
} else if (isEnemy()) {
|
} else if (isEnemy()) {
|
||||||
return Conf.territoryEnemyDenyUseage;
|
return Conf.territoryEnemyDenyUsage;
|
||||||
} else if (isAlly()) {
|
} else if (isAlly()) {
|
||||||
return Conf.territoryAllyDenyUseage;
|
return Conf.territoryAllyDenyUsage;
|
||||||
} else if (isTruce()) {
|
} else if (isTruce()) {
|
||||||
return Conf.territoryTruceDenyUseage;
|
return Conf.territoryTruceDenyUsage;
|
||||||
} else {
|
} else {
|
||||||
return Conf.territoryDenyUseage;
|
return Conf.territoryDenyUsage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.massivecraft.factions.tag;
|
package com.massivecraft.factions.tag;
|
||||||
|
|
||||||
|
import com.massivecraft.factions.FPlayers;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.FactionsPlugin;
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
@@ -12,7 +13,8 @@ public enum GeneralTag implements Tag {
|
|||||||
MAX_ALLIES("{max-allies}", () -> getRelation("ally")),
|
MAX_ALLIES("{max-allies}", () -> getRelation("ally")),
|
||||||
MAX_ENEMIES("{max-enemies}", () -> getRelation("enemy")),
|
MAX_ENEMIES("{max-enemies}", () -> getRelation("enemy")),
|
||||||
MAX_TRUCES("{max-truces}", () -> getRelation("truce")),
|
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())),
|
TOTAL_ONLINE("{total-online}", () -> String.valueOf(Bukkit.getOnlinePlayers().size())),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ public class CornerTask extends BukkitRunnable {
|
|||||||
FLocation fLocation = surrounding.remove(0);
|
FLocation fLocation = surrounding.remove(0);
|
||||||
if (fPlayer.attemptClaim(fPlayer.getFaction(), fLocation, true)) {
|
if (fPlayer.attemptClaim(fPlayer.getFaction(), fLocation, true)) {
|
||||||
++amount;
|
++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_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_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_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_NOT_CORNER("&c&l[!] &7You must be in a corner to use this command!"),
|
||||||
COMMAND_CORNER_DESCRIPTION("claim a corner at world border"),
|
COMMAND_CORNER_DESCRIPTION("claim a corner at world border"),
|
||||||
COMMAND_CORNERLIST_DESCRIPTION("list of all corners"),
|
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_MEMBERS("Factions must have at least %s members to claim land."),
|
||||||
CLAIM_SAFEZONE("You can not claim a Safe Zone."),
|
CLAIM_SAFEZONE("You can not claim a Safe Zone."),
|
||||||
CLAIM_WARZONE("You can not claim a War 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_LIMIT("Limit reached. You can't claim more land!"),
|
||||||
CLAIM_ALLY("You can't claim the land of your allies."),
|
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!"),
|
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
|
#Mission Types: KILL, MINE, PLACE, FISH, TAME, ENCHANT, CONSUME
|
||||||
Missions:
|
Missions:
|
||||||
|
FillItem:
|
||||||
|
Material: BLACK_STAINED_GLASS_PANE
|
||||||
|
Rows: 3
|
||||||
sugarcane:
|
sugarcane:
|
||||||
Slot: 11
|
Slot: 11
|
||||||
Material: "SUGAR_CANE"
|
Material: "SUGAR_CANE"
|
||||||
@@ -1324,6 +1327,7 @@ Tntfill:
|
|||||||
# - {offline-list} : Lists all offline members with tooltips
|
# - {offline-list} : Lists all offline members with tooltips
|
||||||
# - {alts} : List all alts online or offline
|
# - {alts} : List all alts online or offline
|
||||||
# - {truces-list} : Lists each faction truce with tooltips
|
# - {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
|
# Player variables. Can be used in tooltips.show, scoreboards, or /f show
|
||||||
# - {group} : Players group
|
# - {group} : Players group
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ permissions:
|
|||||||
factions.kit.halfplayer:
|
factions.kit.halfplayer:
|
||||||
description: Can do all but create factions.
|
description: Can do all but create factions.
|
||||||
children:
|
children:
|
||||||
|
factions.missions: true
|
||||||
|
factions.shop: true
|
||||||
factions.permissions: true
|
factions.permissions: true
|
||||||
factions.setdiscord: true
|
factions.setdiscord: true
|
||||||
factions.discord: true
|
factions.discord: true
|
||||||
@@ -118,6 +120,7 @@ permissions:
|
|||||||
factions.checkpoint: true
|
factions.checkpoint: true
|
||||||
factions.rules: true
|
factions.rules: true
|
||||||
factions.setwarp: true
|
factions.setwarp: true
|
||||||
|
factions.warp: true
|
||||||
factions.banner: true
|
factions.banner: true
|
||||||
factions.vault: true
|
factions.vault: true
|
||||||
factions.getvault: true
|
factions.getvault: true
|
||||||
|
|||||||
Reference in New Issue
Block a user