Check System Added and Massive Reformat

This commit is contained in:
Driftay 2019-08-24 13:18:50 -04:00
parent 84f4e0f732
commit 72f76aeb71
199 changed files with 15584 additions and 15463 deletions

View File

@ -4,7 +4,6 @@ import com.google.common.collect.ImmutableMap;
import com.massivecraft.factions.integration.dynmap.DynmapStyle; import com.massivecraft.factions.integration.dynmap.DynmapStyle;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import com.massivecraft.factions.zcore.fperms.DefaultPermissions; import com.massivecraft.factions.zcore.fperms.DefaultPermissions;
import com.massivecraft.factions.zcore.fperms.Permissable;
import com.massivecraft.factions.zcore.fperms.PermissableAction; import com.massivecraft.factions.zcore.fperms.PermissableAction;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
@ -85,6 +84,7 @@ public class Conf {
public static int stealthFlyCheckRadius = 32; public static int stealthFlyCheckRadius = 32;
public static int factionBufferSize = 20; public static int factionBufferSize = 20;
public static boolean removeHomesOnLeave = true; public static boolean removeHomesOnLeave = true;
public static boolean useCheckSystem = true;
public static boolean gracePeriod = false; public static boolean gracePeriod = false;
public static boolean noEnderpearlsInFly = false; public static boolean noEnderpearlsInFly = false;
public static boolean broadcastDescriptionChanges = false; public static boolean broadcastDescriptionChanges = false;
@ -365,6 +365,7 @@ public class Conf {
static { static {
lockedPermissions.add(PermissableAction.CHEST); lockedPermissions.add(PermissableAction.CHEST);
} }
static { static {
baseCommandAliases.add("f"); baseCommandAliases.add("f");

View File

@ -79,6 +79,7 @@ public class FLocation implements Serializable {
public static int blockToChunk(int blockVal) { // 1 chunk is 16x16 blocks public static int blockToChunk(int blockVal) { // 1 chunk is 16x16 blocks
return blockVal >> 4; // ">> 4" == "/ 16" return blockVal >> 4; // ">> 4" == "/ 16"
} }
public static int blockToRegion(int blockVal) { // 1 region is 512x512 blocks public static int blockToRegion(int blockVal) { // 1 region is 512x512 blocks
return blockVal >> 9; // ">> 9" == "/ 512" return blockVal >> 9; // ">> 9" == "/ 512"
} }

View File

@ -30,10 +30,10 @@ public interface FPlayer extends EconomyParticipator {
boolean hasNotificationsEnabled(); boolean hasNotificationsEnabled();
void setAlt(boolean alt);
boolean isAlt(); boolean isAlt();
void setAlt(boolean alt);
/** /**
* Used to know if stealth is toggled on or off * Used to know if stealth is toggled on or off
* *

View File

@ -23,6 +23,12 @@ import java.util.concurrent.ConcurrentHashMap;
public interface Faction extends EconomyParticipator { public interface Faction extends EconomyParticipator {
long getCheckNotifier();
void setCheckNotifier(long minutes);
void sendCheckNotify();
boolean altInvited(FPlayer fplayer); boolean altInvited(FPlayer fplayer);
Map<String, Mission> getMissions(); Map<String, Mission> getMissions();
@ -200,7 +206,9 @@ public interface Faction extends EconomyParticipator {
boolean noMonstersInTerritory(); boolean noMonstersInTerritory();
boolean isNormal(); boolean isNormal();
boolean isSystemFaction(); boolean isSystemFaction();
@Deprecated @Deprecated
boolean isNone(); boolean isNone();

View File

@ -17,7 +17,6 @@ import com.massivecraft.factions.missions.MissionHandler;
import com.massivecraft.factions.shop.ShopClickPersistence; import com.massivecraft.factions.shop.ShopClickPersistence;
import com.massivecraft.factions.shop.ShopConfig; import com.massivecraft.factions.shop.ShopConfig;
import com.massivecraft.factions.struct.ChatMode; import com.massivecraft.factions.struct.ChatMode;
import com.massivecraft.factions.util.Placeholder;
import com.massivecraft.factions.util.*; import com.massivecraft.factions.util.*;
import com.massivecraft.factions.util.Particles.ReflectionUtils; import com.massivecraft.factions.util.Particles.ReflectionUtils;
import com.massivecraft.factions.zcore.CommandVisibility; import com.massivecraft.factions.zcore.CommandVisibility;
@ -63,9 +62,7 @@ public class P extends MPlugin {
// Plugins can check this boolean while hooking in have // Plugins can check this boolean while hooking in have
// a green light to use the api. // a green light to use the api.
public static boolean startupFinished = false; public static boolean startupFinished = false;
private FactionsPlayerListener factionsPlayerListener; public static Economy econ = null;
public boolean PlaceholderApi; public boolean PlaceholderApi;
// Commands // Commands
public FCmdRoot cmdBase; public FCmdRoot cmdBase;
@ -78,6 +75,7 @@ public class P extends MPlugin {
public boolean useNonPacketParticles = false; public boolean useNonPacketParticles = false;
public boolean factionsFlight = false; public boolean factionsFlight = false;
SkriptAddon skriptAddon; SkriptAddon skriptAddon;
private FactionsPlayerListener factionsPlayerListener;
private boolean locked = false; private boolean locked = false;
private boolean spam = false; private boolean spam = false;
private Integer AutoLeaveTask = null; private Integer AutoLeaveTask = null;
@ -85,7 +83,6 @@ public class P extends MPlugin {
private ClipPlaceholderAPIManager clipPlaceholderAPIManager; private ClipPlaceholderAPIManager clipPlaceholderAPIManager;
private boolean mvdwPlaceholderAPIManager = false; private boolean mvdwPlaceholderAPIManager = false;
private Listener[] eventsListener; private Listener[] eventsListener;
public static Economy econ = null;
public P() { public P() {
@ -198,6 +195,10 @@ public class P extends MPlugin {
faction.addFPlayer(fPlayer); faction.addFPlayer(fPlayer);
} }
} }
if (Conf.useCheckSystem) {
new CheckWallTask().runTaskTimerAsynchronously(this, 0L, 1200L);
this.log(Level.INFO, "Enabling Check Wall Timers!");
}
if (getConfig().getBoolean("enable-faction-flight", true)) { if (getConfig().getBoolean("enable-faction-flight", true)) {
UtilFly.run(); UtilFly.run();
@ -268,7 +269,7 @@ public class P extends MPlugin {
IEssentials ess = Essentials.setup(); IEssentials ess = Essentials.setup();
if(ess != null && Conf.removeHomesOnLeave){ if (ess != null && Conf.removeHomesOnLeave) {
getServer().getPluginManager().registerEvents(new EssentialsHomeHandler(ess), this); getServer().getPluginManager().registerEvents(new EssentialsHomeHandler(ess), this);
} }
@ -300,7 +301,6 @@ public class P extends MPlugin {
} }
private void setupPlaceholderAPI() { private void setupPlaceholderAPI() {
Plugin clip = getServer().getPluginManager().getPlugin("PlaceholderAPI"); Plugin clip = getServer().getPluginManager().getPlugin("PlaceholderAPI");
if (clip != null && clip.isEnabled()) { if (clip != null && clip.isEnabled()) {
@ -324,7 +324,8 @@ public class P extends MPlugin {
public List<String> replacePlaceholders(List<String> lore, Placeholder... placeholders) { public List<String> replacePlaceholders(List<String> lore, Placeholder... placeholders) {
for (Placeholder placeholder : placeholders) { for (Placeholder placeholder : placeholders) {
for (int x = 0; x <= lore.size() - 1; x++) lore.set(x, lore.get(x).replace(placeholder.getTag(), placeholder.getReplace())); for (int x = 0; x <= lore.size() - 1; x++)
lore.set(x, lore.get(x).replace(placeholder.getTag(), placeholder.getReplace()));
} }
return lore; return lore;
} }
@ -703,6 +704,7 @@ public class P extends MPlugin {
getLogger().log(level, s); getLogger().log(level, s);
} }
} }
public FactionsPlayerListener getFactionsPlayerListener() { public FactionsPlayerListener getFactionsPlayerListener() {
return this.factionsPlayerListener; return this.factionsPlayerListener;
} }

View File

@ -42,7 +42,7 @@ public class CmdAdmin extends FCommand {
boolean permAny = Permission.ADMIN_ANY.has(sender, false); boolean permAny = Permission.ADMIN_ANY.has(sender, false);
Faction targetFaction = fyou.getFaction(); Faction targetFaction = fyou.getFaction();
if(fyou.isAlt()){ if (fyou.isAlt()) {
msg(ChatColor.RED + "You can not promote alt accounts."); msg(ChatColor.RED + "You can not promote alt accounts.");
return; return;
} }

View File

@ -0,0 +1,56 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.PermissableAction;
import com.massivecraft.factions.zcore.util.TL;
public class CmdCheck extends FCommand {
public CmdCheck() {
this.aliases.add("check");
this.requiredArgs.add("minutes");
this.permission = Permission.CHECK.node;
this.disableOnLock = true;
this.disableOnSpam = false;
this.senderMustBePlayer = true;
this.senderMustBeMember = true;
this.senderMustBeModerator = false;
this.senderMustBeColeader = false;
this.senderMustBeAdmin = false;
}
@Override
public void perform() {
if (!Conf.useCheckSystem) {
msg(TL.GENERIC_DISABLED);
return;
}
Access access = myFaction.getAccess(fme, PermissableAction.CHECK);
if ((access == Access.DENY || (access == Access.UNDEFINED && !assertMinRole(Role.LEADER))) && !fme.isAdminBypassing()) {
fme.msg(TL.GENERIC_NOPERMISSION, "check");
return;
}
int minutes = this.argAsInt(0);
if (minutes <= 0) {
msg(TL.COMMAND_CHECK_INVALID_NUMBER);
} else {
myFaction.setCheckNotifier(minutes);
msg(TL.COMMAND_CHECK_SUCCESSFUL.format(minutes));
}
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_CHECK_DESCRIPTION;
}
}

View File

@ -51,7 +51,7 @@ public class CmdColeader extends FCommand {
boolean permAny = Permission.COLEADER_ANY.has(sender, false); boolean permAny = Permission.COLEADER_ANY.has(sender, false);
Faction targetFaction = you.getFaction(); Faction targetFaction = you.getFaction();
if(you.isAlt()){ if (you.isAlt()) {
msg(ChatColor.RED + "You can not promote alt accounts."); msg(ChatColor.RED + "You can not promote alt accounts.");
return; return;
} }

View File

@ -108,7 +108,6 @@ public class CmdCreate extends FCommand {
Econ.setBalance(faction.getAccountId(), Conf.econFactionStartingBalance); Econ.setBalance(faction.getAccountId(), Conf.econFactionStartingBalance);
if (Conf.logFactionCreate) if (Conf.logFactionCreate)
P.p.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag); P.p.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);

View File

@ -84,7 +84,7 @@ public class CmdDisband extends FCommand {
// check for tnt before disbanding. // check for tnt before disbanding.
if ((fme!= null && !disbandMap.containsKey(me.getUniqueId().toString())) && faction.getTnt() > 0) { if ((fme != null && !disbandMap.containsKey(me.getUniqueId().toString())) && faction.getTnt() > 0) {
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + "")); msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
disbandMap.put(me.getUniqueId().toString(), faction.getId()); disbandMap.put(me.getUniqueId().toString(), faction.getId());
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, () -> disbandMap.remove(me.getUniqueId().toString()), 200L); Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, () -> disbandMap.remove(me.getUniqueId().toString()), 200L);

View File

@ -9,6 +9,8 @@ import java.util.UUID;
public class CmdFGlobal extends FCommand { public class CmdFGlobal extends FCommand {
public static List<UUID> toggled = new ArrayList<>();
public CmdFGlobal() { public CmdFGlobal() {
super(); super();
@ -26,18 +28,16 @@ public class CmdFGlobal extends FCommand {
senderMustBeAdmin = false; senderMustBeAdmin = false;
} }
public static List<UUID> toggled = new ArrayList<>();
@Override @Override
public void perform() { public void perform() {
Player p = (Player)sender; Player p = (Player) sender;
// /f global // /f global
if (toggled.contains(p.getUniqueId())){ if (toggled.contains(p.getUniqueId())) {
toggled.remove(p.getUniqueId()); toggled.remove(p.getUniqueId());
}else{ } else {
toggled.add(p.getUniqueId()); toggled.add(p.getUniqueId());
} }

View File

@ -68,7 +68,9 @@ public class CmdFWarp extends FCommand {
fPlayer.msg(TL.COMMAND_FWARP_WARPED, warpName); fPlayer.msg(TL.COMMAND_FWARP_WARPED, warpName);
} }
}, this.p.getConfig().getLong("warmups.f-warp", 0)); }, this.p.getConfig().getLong("warmups.f-warp", 0));
} else { fme.msg(TL.COMMAND_FWARP_INVALID_WARP, warpName); } } else {
fme.msg(TL.COMMAND_FWARP_INVALID_WARP, warpName);
}
} }
} }

View File

@ -164,6 +164,11 @@ public class CmdFly extends FCommand {
} }
} }
public static void disableFlight(final FPlayer fme) {
fme.setFlying(false);
flyMap.remove(fme.getPlayer().getName());
}
public boolean isInFlightChecker(Player player) { public boolean isInFlightChecker(Player player) {
return flyMap.containsKey(player.getName()); return flyMap.containsKey(player.getName());
} }
@ -222,12 +227,6 @@ public class CmdFly extends FCommand {
}, this.p.getConfig().getLong("warmups.f-fly", 0)); }, this.p.getConfig().getLong("warmups.f-fly", 0));
} }
public static void disableFlight(final FPlayer fme) {
fme.setFlying(false);
flyMap.remove(fme.getPlayer().getName());
}
@Override @Override
public TL getUsageTranslation() { public TL getUsageTranslation() {
return TL.COMMAND_FLY_DESCRIPTION; return TL.COMMAND_FLY_DESCRIPTION;

View File

@ -1,7 +1,6 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.*; import com.massivecraft.factions.*;
import com.massivecraft.factions.integration.Essentials;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.struct.Role;
@ -10,7 +9,6 @@ import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.PermissableAction; import com.massivecraft.factions.zcore.fperms.PermissableAction;
import com.massivecraft.factions.zcore.util.SmokeUtil; import com.massivecraft.factions.zcore.util.SmokeUtil;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -71,7 +69,7 @@ public class CmdHome extends FCommand {
myFaction = factionArg; myFaction = factionArg;
if(myFaction.isWilderness()) if (myFaction.isWilderness())
return; return;
if (!fme.isAdminBypassing()) { if (!fme.isAdminBypassing()) {
@ -83,7 +81,6 @@ public class CmdHome extends FCommand {
} }
if (!myFaction.hasHome()) { if (!myFaction.hasHome()) {
fme.msg(TL.COMMAND_HOME_NOHOME.toString() + (fme.getRole().value < Role.MODERATOR.value ? TL.GENERIC_ASKYOURLEADER.toString() : TL.GENERIC_YOUSHOULD.toString())); fme.msg(TL.COMMAND_HOME_NOHOME.toString() + (fme.getRole().value < Role.MODERATOR.value ? TL.GENERIC_ASKYOURLEADER.toString() : TL.GENERIC_YOUSHOULD.toString()));
fme.sendMessage(p.cmdBase.cmdSethome.getUseageTemplate()); fme.sendMessage(p.cmdBase.cmdSethome.getUseageTemplate());
@ -91,8 +88,6 @@ public class CmdHome extends FCommand {
} }
if (!Conf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory()) { if (!Conf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory()) {
fme.msg(TL.COMMAND_HOME_INENEMY); fme.msg(TL.COMMAND_HOME_INENEMY);
return; return;
@ -148,7 +143,6 @@ public class CmdHome extends FCommand {
} }
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
if (!payForCommand(Conf.econCostHome, TL.COMMAND_HOME_TOTELEPORT.toString(), TL.COMMAND_HOME_FORTELEPORT.toString())) { if (!payForCommand(Conf.econCostHome, TL.COMMAND_HOME_TOTELEPORT.toString(), TL.COMMAND_HOME_FORTELEPORT.toString())) {
return; return;
@ -161,7 +155,6 @@ public class CmdHome extends FCommand {
// } // }
this.doWarmUp(WarmUpUtil.Warmup.HOME, TL.WARMUPS_NOTIFY_TELEPORT, "Home", () -> { this.doWarmUp(WarmUpUtil.Warmup.HOME, TL.WARMUPS_NOTIFY_TELEPORT, "Home", () -> {
// Create a smoke effect // Create a smoke effect
if (Conf.homesTeleportCommandSmokeEffectEnabled) { if (Conf.homesTeleportCommandSmokeEffectEnabled) {

View File

@ -99,7 +99,6 @@ public class CmdJoin extends FCommand {
} }
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay // if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
if (samePlayer && !canAffordCommand(Conf.econCostJoin, TL.COMMAND_JOIN_TOJOIN.toString())) { if (samePlayer && !canAffordCommand(Conf.econCostJoin, TL.COMMAND_JOIN_TOJOIN.toString())) {
return; return;
@ -133,7 +132,7 @@ public class CmdJoin extends FCommand {
fplayer.resetFactionData(); fplayer.resetFactionData();
if(faction.altInvited(fplayer)){ if (faction.altInvited(fplayer)) {
fplayer.setAlt(true); fplayer.setAlt(true);
fplayer.setFaction(faction, true); fplayer.setFaction(faction, true);
} else { } else {

View File

@ -67,7 +67,7 @@ public class CmdKick extends FCommand {
return; return;
} }
if(toKick.isAlt()){ if (toKick.isAlt()) {
msg(P.p.color("&cToo few arguments, &eUse like this:")); msg(P.p.color("&cToo few arguments, &eUse like this:"));
msg(P.p.color("&b/f alts,alt kick &3<player name>")); msg(P.p.color("&b/f alts,alt kick &3<player name>"));
return; return;

View File

@ -8,7 +8,9 @@ import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagUtil; import com.massivecraft.factions.zcore.util.TagUtil;
import java.util.*; import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class CmdList extends FCommand { public class CmdList extends FCommand {

View File

@ -49,7 +49,7 @@ public class CmdMod extends FCommand {
boolean permAny = Permission.MOD_ANY.has(sender, false); boolean permAny = Permission.MOD_ANY.has(sender, false);
Faction targetFaction = you.getFaction(); Faction targetFaction = you.getFaction();
if(you.isAlt()){ if (you.isAlt()) {
msg(ChatColor.RED + "You can not promote alt accounts."); msg(ChatColor.RED + "You can not promote alt accounts.");
return; return;
} }

View File

@ -23,6 +23,7 @@ public class CmdPaypalSee extends FCommand {
senderMustBeAdmin = true; senderMustBeAdmin = true;
} }
@Override @Override
public void perform() { public void perform() {
if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) { if (!P.p.getConfig().getBoolean("fpaypal.Enabled")) {

View File

@ -1,12 +1,11 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
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;
public class CmdSpam extends FCommand { public class CmdSpam extends FCommand {
public CmdSpam(){ public CmdSpam() {
this.aliases.add("spam"); this.aliases.add("spam");
this.optionalArgs.put("on/off", "flip"); this.optionalArgs.put("on/off", "flip");

View File

@ -23,7 +23,6 @@ public class CmdStealth extends FCommand {
public void perform() { public void perform() {
Faction faction = fme.getFaction(); Faction faction = fme.getFaction();
if (faction != null && !faction.getId().equalsIgnoreCase("0") && !faction.getId().equalsIgnoreCase("none") && !faction.getId().equalsIgnoreCase("safezone") && !faction.getId().equalsIgnoreCase("warzone")) { if (faction != null && !faction.getId().equalsIgnoreCase("0") && !faction.getId().equalsIgnoreCase("none") && !faction.getId().equalsIgnoreCase("safezone") && !faction.getId().equalsIgnoreCase("warzone")) {
fme.setStealth(!fme.isStealthEnabled()); fme.setStealth(!fme.isStealthEnabled());

View File

@ -1,7 +1,7 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.*; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
public class CmdStrike extends FCommand { public class CmdStrike extends FCommand {

View File

@ -135,6 +135,7 @@ public class FCmdRoot extends FCommand {
public CmdNotifications cmdNotifications = new CmdNotifications(); public CmdNotifications cmdNotifications = new CmdNotifications();
public CmdShop cmdShop = new CmdShop(); public CmdShop cmdShop = new CmdShop();
public CmdMissions cmdMissions = new CmdMissions(); public CmdMissions cmdMissions = new CmdMissions();
public CmdCheck cmdCheck = new CmdCheck();
public FCmdRoot() { public FCmdRoot() {
@ -255,11 +256,15 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdFGlobal); this.addSubCommand(this.cmdFGlobal);
this.addSubCommand(this.cmdViewChest); this.addSubCommand(this.cmdViewChest);
if(P.p.getConfig().getBoolean("Missions-Enabled")){ if (Conf.useCheckSystem) {
this.addSubCommand(this.cmdCheck);
}
if (P.p.getConfig().getBoolean("Missions-Enabled")) {
this.addSubCommand(this.cmdMissions); this.addSubCommand(this.cmdMissions);
} }
if(P.p.getConfig().getBoolean("F-Shop.Enabled")){ if (P.p.getConfig().getBoolean("F-Shop.Enabled")) {
this.addSubCommand(this.cmdShop); this.addSubCommand(this.cmdShop);
} }
@ -267,11 +272,11 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdInventorySee); this.addSubCommand(this.cmdInventorySee);
} }
if(P.p.getConfig().getBoolean("f-points.Enabled")){ if (P.p.getConfig().getBoolean("f-points.Enabled")) {
this.addSubCommand(this.cmdPoints); this.addSubCommand(this.cmdPoints);
} }
if(P.p.getConfig().getBoolean("f-alts.Enabled")){ if (P.p.getConfig().getBoolean("f-alts.Enabled")) {
this.addSubCommand(this.cmdAlts); this.addSubCommand(this.cmdAlts);
} }

View File

@ -71,7 +71,7 @@ public abstract class FCommand extends MCommand<P> {
return false; return false;
} }
if(p.getSpam() && this.disableOnSpam){ if (p.getSpam() && this.disableOnSpam) {
msg("<b>Anti-Spam is currently enabled! Please try again later."); msg("<b>Anti-Spam is currently enabled! Please try again later.");
return false; return false;
} }

View File

@ -12,7 +12,7 @@ public class CmdAlts extends FCommand {
public CmdAltsList cmdAltsList = new CmdAltsList(); public CmdAltsList cmdAltsList = new CmdAltsList();
public CmdAlts(){ public CmdAlts() {
super(); super();
this.aliases.add("alts"); this.aliases.add("alts");

View File

@ -33,17 +33,17 @@ public class CmdAltsList extends FCommand {
@Override @Override
public void perform() { public void perform() {
Faction faction = myFaction; Faction faction = myFaction;
if(argIsSet(0)){ if (argIsSet(0)) {
faction = argAsFaction(0); faction = argAsFaction(0);
} }
if(faction == null) if (faction == null)
return; return;
if(faction != myFaction && !fme.isAdminBypassing()){ if (faction != myFaction && !fme.isAdminBypassing()) {
return; return;
} }
if(faction.getAltPlayers().size() == 0){ if (faction.getAltPlayers().size() == 0) {
msg(TL.COMMAND_ALTS_LIST_NOALTS, faction.getTag()); msg(TL.COMMAND_ALTS_LIST_NOALTS, faction.getTag());
return; return;
} }

View File

@ -33,7 +33,7 @@ public class CmdInviteAlt extends FCommand {
@Override @Override
public void perform() { public void perform() {
if(!P.p.getConfig().getBoolean("f-alts.Enabled", false)){ if (!P.p.getConfig().getBoolean("f-alts.Enabled", false)) {
fme.msg(TL.GENERIC_DISABLED); fme.msg(TL.GENERIC_DISABLED);
return; return;
} }

View File

@ -94,7 +94,7 @@ public class ChestLogsHandler implements Listener {
if (e.getClickedInventory() != null) { if (e.getClickedInventory() != null) {
if (e.getClickedInventory().equals(topInventory)) { if (e.getClickedInventory().equals(topInventory)) {
ItemStack current = e.getCurrentItem(); ItemStack current = e.getCurrentItem();
if(current == null) return; if (current == null) return;
ItemStack cursor = e.getCursor(); ItemStack cursor = e.getCursor();
if (e.getClick().isShiftClick()) return; if (e.getClick().isShiftClick()) return;
if (cursor != null) { if (cursor != null) {

View File

@ -33,10 +33,7 @@ public class CmdGrace extends FCommand {
boolean gracePeriod = Conf.gracePeriod; boolean gracePeriod = Conf.gracePeriod;
if (args.size() == 0) { if (args.size() == 0) {
if (gracePeriod) Conf.gracePeriod = !gracePeriod;
Conf.gracePeriod = false;
else
Conf.gracePeriod = true;
} }
fme.msg(TL.COMMAND_GRACE_TOGGLE, gracePeriod ? "enabled" : "disabled"); fme.msg(TL.COMMAND_GRACE_TOGGLE, gracePeriod ? "enabled" : "disabled");
} }

View File

@ -7,7 +7,7 @@ import com.massivecraft.factions.zcore.util.TL;
public class CmdLogout extends FCommand { public class CmdLogout extends FCommand {
public CmdLogout(){ public CmdLogout() {
super(); super();
this.aliases.add("logout"); this.aliases.add("logout");
@ -25,7 +25,7 @@ public class CmdLogout extends FCommand {
public void perform() { public void perform() {
LogoutHandler handler = LogoutHandler.getByName(fme.getPlayer().getName()); LogoutHandler handler = LogoutHandler.getByName(fme.getPlayer().getName());
if(handler.isLogoutActive(fme.getPlayer())){ if (handler.isLogoutActive(fme.getPlayer())) {
fme.msg(TL.COMMAND_LOGOUT_ACTIVE); fme.msg(TL.COMMAND_LOGOUT_ACTIVE);
return; return;
} }
@ -35,5 +35,7 @@ public class CmdLogout extends FCommand {
} }
@Override @Override
public TL getUsageTranslation() { return TL.COMMAND_LOGOUT_DESCRIPTION; } public TL getUsageTranslation() {
return TL.COMMAND_LOGOUT_DESCRIPTION;
}
} }

View File

@ -22,30 +22,28 @@ public class LogoutHandler {
factionDatas.put(name, this); factionDatas.put(name, this);
} }
public static LogoutHandler getByName(String name) {
LogoutHandler logoutHandler = factionDatas.get(name);
return logoutHandler == null ? new LogoutHandler(name) : factionDatas.get(name);
}
public boolean isLogoutActive(Player player) { public boolean isLogoutActive(Player player) {
return logoutCooldown.containsKey(player.getUniqueId()) && System.currentTimeMillis() < logoutCooldown.get(player.getUniqueId()); return logoutCooldown.containsKey(player.getUniqueId()) && System.currentTimeMillis() < logoutCooldown.get(player.getUniqueId());
} }
public void cancelLogout(Player player) { public void cancelLogout(Player player) {
if(logoutCooldown.containsKey(player.getUniqueId())) {
logoutCooldown.remove(player.getUniqueId()); logoutCooldown.remove(player.getUniqueId());
} }
}
public void applyLogoutCooldown(Player player) { public void applyLogoutCooldown(Player player) {
logoutCooldown.put(player.getUniqueId(), System.currentTimeMillis() + (30 * 1000)); logoutCooldown.put(player.getUniqueId(), System.currentTimeMillis() + (30 * 1000));
Bukkit.getScheduler().runTaskLater(P.p, () -> { Bukkit.getScheduler().runTaskLater(P.p, () -> {
if(isLogoutActive(player)) { if (isLogoutActive(player)) {
player.setMetadata("Logout", new FixedMetadataValue(P.p, true)); player.setMetadata("Logout", new FixedMetadataValue(P.p, true));
player.kickPlayer(String.valueOf(TL.COMMAND_LOGOUT_KICK_MESSAGE)); player.kickPlayer(String.valueOf(TL.COMMAND_LOGOUT_KICK_MESSAGE));
cancelLogout(player); cancelLogout(player);
} }
}, Conf.logoutCooldown * 20L); }, Conf.logoutCooldown * 20L);
} }
public static LogoutHandler getByName(String name) {
LogoutHandler logoutHandler = factionDatas.get(name);
return logoutHandler == null ? new LogoutHandler(name) : factionDatas.get(name);
}
} }

View File

@ -10,7 +10,7 @@ public class CmdPoints extends FCommand {
public CmdPointsSet cmdPointsSet = new CmdPointsSet(); public CmdPointsSet cmdPointsSet = new CmdPointsSet();
public CmdPointsAdd cmdPointsAdd = new CmdPointsAdd(); public CmdPointsAdd cmdPointsAdd = new CmdPointsAdd();
public CmdPoints(){ public CmdPoints() {
super(); super();
this.aliases.add("points"); this.aliases.add("points");

View File

@ -1,7 +1,6 @@
package com.massivecraft.factions.cmd.points; package com.massivecraft.factions.cmd.points;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction; import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.cmd.FCommand; import com.massivecraft.factions.cmd.FCommand;
@ -48,7 +47,7 @@ public class CmdPointsAdd extends FCommand {
msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", args.get(0))); msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", args.get(0)));
return; return;
} }
if(argAsInt(1) <= 0){ if (argAsInt(1) <= 0) {
msg(TL.COMMAND_POINTS_INSUFFICIENT); msg(TL.COMMAND_POINTS_INSUFFICIENT);
return; return;
} }

View File

@ -47,7 +47,7 @@ public class CmdPointsRemove extends FCommand {
return; return;
} }
if(argAsInt(1) <= 0){ if (argAsInt(1) <= 0) {
msg(TL.COMMAND_POINTS_INSUFFICIENT); msg(TL.COMMAND_POINTS_INSUFFICIENT);
return; return;
} }

View File

@ -46,7 +46,7 @@ public class CmdPointsSet extends FCommand {
return; return;
} }
if(argAsInt(1) < 0){ if (argAsInt(1) < 0) {
msg(TL.COMMAND_POINTS_INSUFFICIENT); msg(TL.COMMAND_POINTS_INSUFFICIENT);
return; return;
} }

View File

@ -40,7 +40,7 @@ public class FPromoteCommand extends FCommand {
return; return;
} }
if(target.isAlt()){ if (target.isAlt()) {
msg(ChatColor.RED + "You can not edit the rank of alt accounts."); msg(ChatColor.RED + "You can not edit the rank of alt accounts.");
return; return;
} }

View File

@ -116,8 +116,10 @@ public class CmdTnt extends FCommand {
return; return;
} }
for (int i = 0; i <= fullStacks - 1; i++) me.getPlayer().getInventory().addItem(new ItemStack(XMaterial.TNT.parseMaterial(), 64)); for (int i = 0; i <= fullStacks - 1; i++)
if (remainderAmt != 0) me.getPlayer().getInventory().addItem(new ItemStack(XMaterial.TNT.parseMaterial(), remainderAmt)); me.getPlayer().getInventory().addItem(new ItemStack(XMaterial.TNT.parseMaterial(), 64));
if (remainderAmt != 0)
me.getPlayer().getInventory().addItem(new ItemStack(XMaterial.TNT.parseMaterial(), remainderAmt));
fme.getFaction().takeTnt(amount); fme.getFaction().takeTnt(amount);
me.updateInventory(); me.updateInventory();

View File

@ -22,7 +22,7 @@ public class Essentials {
public static IEssentials setup() { public static IEssentials setup() {
Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials"); Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials");
if (ess != null) { if (ess != null) {
return Essentials.essentials = (IEssentials)ess; return Essentials.essentials = (IEssentials) ess;
} }
return null; return null;
} }

View File

@ -101,6 +101,47 @@ public class FactionsBlockListener implements Listener {
return false; return false;
} }
public static boolean graceisEnabled() {
return Conf.gracePeriod;
}
private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation loc, Faction myFaction, Access access, PermissableAction action, boolean shouldHurt) {
boolean landOwned = (myFaction.doesLocationHaveOwnersSet(loc) && !myFaction.getOwnerList(loc).isEmpty());
if ((landOwned && myFaction.getOwnerListString(loc).contains(player.getName())) || (me.getRole() == Role.LEADER && me.getFactionId().equals(myFaction.getId())))
return true;
else if (landOwned && !myFaction.getOwnerListString(loc).contains(player.getName())) {
me.msg(TL.ACTIONS_OWNEDTERRITORYDENY.toString().replace("{owners}", myFaction.getOwnerListString(loc)));
if (shouldHurt) {
player.damage(Conf.actionDeniedPainAmount);
me.msg(TL.ACTIONS_NOPERMISSIONPAIN.toString().replace("{action}", action.toString()).replace("{faction}", Board.getInstance().getFactionAt(loc).getTag(myFaction)));
}
return false;
} else if (!landOwned && access == Access.DENY) { // If land is not owned but access is set to DENY anyway
if (shouldHurt) {
player.damage(Conf.actionDeniedPainAmount);
me.msg(TL.ACTIONS_NOPERMISSIONPAIN.toString().replace("{action}", action.toString()).replace("{faction}", Board.getInstance().getFactionAt(loc).getTag(myFaction)));
}
me.msg(TL.ACTIONS_NOPERMISSION.toString().replace("{faction}", myFaction.getTag(me.getFaction())).replace("{action}", action.toString()));
return false;
} else if (access == Access.ALLOW) return true;
me.msg(TL.ACTIONS_NOPERMISSION.toString().replace("{faction}", myFaction.getTag(me.getFaction())).replace("{action}", action.toString()));
return false;
}
private static boolean CheckActionState(Faction target, FLocation location, FPlayer me, PermissableAction action, boolean pain) {
if (Conf.ownedAreasEnabled && target.doesLocationHaveOwnersSet(location) && !target.playerHasOwnershipRights(me, location)) {
// If pain should be applied
if (pain && Conf.ownedAreaPainBuild)
me.msg(TL.ACTIONS_OWNEDTERRITORYPAINDENY.toString().replace("{action}", action.toString()).replace("{faction}", target.getOwnerListString(location)));
if (Conf.ownedAreaDenyBuild && pain) return false;
else if (Conf.ownedAreaDenyBuild) {
me.msg(TL.ACTIONS_NOPERMISSION.toString().replace("{faction}", target.getTag(me.getFaction())).replace("{action}", action.toString()));
return false;
}
}
return CheckPlayerAccess(me.getPlayer(), me, location, target, target.getAccess(me, action), action, pain);
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockPlace(BlockPlaceEvent event) { public void onBlockPlace(BlockPlaceEvent event) {
if (!event.canBuild()) { if (!event.canBuild()) {
@ -400,7 +441,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler @EventHandler
public void onFallingBlock(EntityChangeBlockEvent event) { public void onFallingBlock(EntityChangeBlockEvent event) {
if(!P.p.getConfig().getBoolean("Falling-Block-Fix.Enabled")) if (!P.p.getConfig().getBoolean("Falling-Block-Fix.Enabled"))
return; return;
Faction faction = Board.getInstance().getFactionAt(new FLocation(event.getBlock())); Faction faction = Board.getInstance().getFactionAt(new FLocation(event.getBlock()));
@ -450,11 +491,6 @@ public class FactionsBlockListener implements Listener {
} }
} }
public static boolean graceisEnabled() {
return Conf.gracePeriod;
}
private boolean canPistonMoveBlock(Faction pistonFaction, Location target) { private boolean canPistonMoveBlock(Faction pistonFaction, Location target) {
Faction otherFaction = Board.getInstance().getFactionAt(new FLocation(target)); Faction otherFaction = Board.getInstance().getFactionAt(new FLocation(target));
@ -479,7 +515,7 @@ public class FactionsBlockListener implements Listener {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent event) { public void onBlockBreak(BlockBreakEvent event) {
FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer()); FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer());
if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "destroy", false)){ if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "destroy", false)) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -510,41 +546,4 @@ public class FactionsBlockListener implements Listener {
} }
} }
} }
private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation loc, Faction myFaction, Access access, PermissableAction action, boolean shouldHurt) {
boolean landOwned = (myFaction.doesLocationHaveOwnersSet(loc) && !myFaction.getOwnerList(loc).isEmpty());
if ((landOwned && myFaction.getOwnerListString(loc).contains(player.getName())) || (me.getRole() == Role.LEADER && me.getFactionId().equals(myFaction.getId())))
return true;
else if (landOwned && !myFaction.getOwnerListString(loc).contains(player.getName())) {
me.msg(TL.ACTIONS_OWNEDTERRITORYDENY.toString().replace("{owners}", myFaction.getOwnerListString(loc)));
if (shouldHurt) {
player.damage(Conf.actionDeniedPainAmount);
me.msg(TL.ACTIONS_NOPERMISSIONPAIN.toString().replace("{action}", action.toString()).replace("{faction}", Board.getInstance().getFactionAt(loc).getTag(myFaction)));
}
return false;
} else if (!landOwned && access == Access.DENY) { // If land is not owned but access is set to DENY anyway
if (shouldHurt) {
player.damage(Conf.actionDeniedPainAmount);
me.msg(TL.ACTIONS_NOPERMISSIONPAIN.toString().replace("{action}", action.toString()).replace("{faction}", Board.getInstance().getFactionAt(loc).getTag(myFaction)));
}
me.msg(TL.ACTIONS_NOPERMISSION.toString().replace("{faction}", myFaction.getTag(me.getFaction())).replace("{action}", action.toString()));
return false;
} else if (access == Access.ALLOW) return true;
me.msg(TL.ACTIONS_NOPERMISSION.toString().replace("{faction}", myFaction.getTag(me.getFaction())).replace("{action}", action.toString()));
return false;
}
private static boolean CheckActionState(Faction target, FLocation location, FPlayer me, PermissableAction action, boolean pain) {
if (Conf.ownedAreasEnabled && target.doesLocationHaveOwnersSet(location) && !target.playerHasOwnershipRights(me, location)) {
// If pain should be applied
if (pain && Conf.ownedAreaPainBuild)
me.msg(TL.ACTIONS_OWNEDTERRITORYPAINDENY.toString().replace("{action}", action.toString()).replace("{faction}", target.getOwnerListString(location)));
if (Conf.ownedAreaDenyBuild && pain) return false;
else if (Conf.ownedAreaDenyBuild) {
me.msg(TL.ACTIONS_NOPERMISSION.toString().replace("{faction}", target.getTag(me.getFaction())).replace("{action}", action.toString()));
return false;
}
}
return CheckPlayerAccess(me.getPlayer(), me, location, target, target.getAccess(me, action), action, pain);
}
} }

View File

@ -46,9 +46,8 @@ import java.util.logging.Level;
public class FactionsPlayerListener implements Listener { public class FactionsPlayerListener implements Listener {
private Set<FLocation> corners;
HashMap<Player, Boolean> fallMap = new HashMap<>(); HashMap<Player, Boolean> fallMap = new HashMap<>();
private 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
@ -287,6 +286,173 @@ public class FactionsPlayerListener implements Listener {
return false; return false;
} }
/// <summary>
/// This checks if the current player can execute an action based on it's factions access and surroundings
/// It will grant access in the following priorities:
/// - If Faction Land is Owned and the Owner is the current player, or player is faction leader.
/// - If Faction Land is not Owned and my access value is not set to DENY
/// - If none of the filters above matches, then we consider access is set to ALLOW|UNDEFINED
/// This check does not performs any kind of bypass check (i.e.: me.isAdminBypassing())
/// </summary>
/// <param name="player">The player entity which the check will be made upon</param>
/// <param name="me">The Faction player object related to the player</param>
/// <param name="loc">The World location where the action is being executed</param>
/// <param name="myFaction">The faction of the player being checked</param>
/// <param name="access">The current's faction access permission for the action</param>
private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation loc, Faction factionToCheck, Access access, PermissableAction action, boolean pain) {
boolean doPain = pain && Conf.handleExploitInteractionSpam;
if (access != null && access != Access.UNDEFINED) {
// TODO: Update this once new access values are added other than just allow / deny.
boolean landOwned = (factionToCheck.doesLocationHaveOwnersSet(loc) && !factionToCheck.getOwnerList(loc).isEmpty());
if ((landOwned && factionToCheck.getOwnerListString(loc).contains(player.getName())) || (me.getRole() == Role.LEADER && me.getFactionId().equals(factionToCheck.getId())))
return true;
else if (landOwned && !factionToCheck.getOwnerListString(loc).contains(player.getName())) {
me.msg("<b>You can't do that in this territory, it is owned by: " + factionToCheck.getOwnerListString(loc));
if (doPain) {
player.damage(Conf.actionDeniedPainAmount);
}
return false;
} else if (!landOwned && access == Access.ALLOW) return true;
else {
me.msg("You cannot " + action + " in the territory of " + factionToCheck.getTag(me.getFaction()));
return false;
}
}
// Approves any permission check if the player in question is a leader AND owns the faction.
if (me.getRole().equals(Role.LEADER) && me.getFaction().equals(factionToCheck)) return true;
me.msg("You cannot " + action + " in the territory of " + factionToCheck.getTag(me.getFaction()));
return false;
}
/// <summary>
/// This will try to resolve a permission action based on the item material, if it's not usable, will return null
/// </summary>
private static PermissableAction GetPermissionFromUsableBlock(Block block) {
return GetPermissionFromUsableBlock(block.getType());
}
/// <summary>
/// This will try to resolve a permission action based on the item material, if it's not usable, will return null
/// <summary>
private static PermissableAction GetPermissionFromUsableBlock(Material material) {
// Check for doors that might have diff material name in old version.
if (material.name().contains("DOOR") || material.name().contains("FENCE_GATE"))
return PermissableAction.DOOR;
if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE"))
return PermissableAction.BUTTON;
if (P.p.mc113) {
switch (material) {
case LEVER:
return PermissableAction.LEVER;
case ACACIA_BUTTON:
case BIRCH_BUTTON:
case DARK_OAK_BUTTON:
case JUNGLE_BUTTON:
case OAK_BUTTON:
case SPRUCE_BUTTON:
case STONE_BUTTON:
return PermissableAction.BUTTON;
case ACACIA_DOOR:
case BIRCH_DOOR:
case IRON_DOOR:
case JUNGLE_DOOR:
case OAK_DOOR:
case SPRUCE_DOOR:
case DARK_OAK_DOOR:
case ACACIA_TRAPDOOR:
case BIRCH_TRAPDOOR:
case DARK_OAK_TRAPDOOR:
case IRON_TRAPDOOR:
case JUNGLE_TRAPDOOR:
case OAK_TRAPDOOR:
case SPRUCE_TRAPDOOR:
case ACACIA_FENCE_GATE:
case BIRCH_FENCE_GATE:
case DARK_OAK_FENCE_GATE:
case JUNGLE_FENCE_GATE:
case OAK_FENCE_GATE:
case SPRUCE_FENCE_GATE:
return PermissableAction.DOOR;
case CHEST:
case TRAPPED_CHEST:
case CHEST_MINECART:
case SHULKER_BOX:
case BLACK_SHULKER_BOX:
case BLUE_SHULKER_BOX:
case BROWN_SHULKER_BOX:
case CYAN_SHULKER_BOX:
case GRAY_SHULKER_BOX:
case GREEN_SHULKER_BOX:
case LIGHT_BLUE_SHULKER_BOX:
case LIGHT_GRAY_SHULKER_BOX:
case LIME_SHULKER_BOX:
case MAGENTA_SHULKER_BOX:
case ORANGE_SHULKER_BOX:
case PINK_SHULKER_BOX:
case PURPLE_SHULKER_BOX:
case RED_SHULKER_BOX:
case WHITE_SHULKER_BOX:
case YELLOW_SHULKER_BOX:
case FURNACE:
case DROPPER:
case DISPENSER:
case ENCHANTING_TABLE:
case BREWING_STAND:
case CAULDRON:
case HOPPER:
case BEACON:
case JUKEBOX:
case ANVIL:
case CHIPPED_ANVIL:
case DAMAGED_ANVIL:
return PermissableAction.CONTAINER;
default:
return null;
}
} else {
switch (material) {
case LEVER:
return PermissableAction.LEVER;
case DARK_OAK_DOOR:
case ACACIA_DOOR:
case BIRCH_DOOR:
case IRON_DOOR:
case JUNGLE_DOOR:
case SPRUCE_DOOR:
case ACACIA_FENCE_GATE:
case BIRCH_FENCE_GATE:
case DARK_OAK_FENCE_GATE:
case OAK_FENCE_GATE:
case JUNGLE_FENCE_GATE:
case SPRUCE_FENCE_GATE:
return PermissableAction.DOOR;
case CHEST:
case ENDER_CHEST:
case TRAPPED_CHEST:
case DISPENSER:
case ENCHANTING_TABLE:
case DROPPER:
case FURNACE:
case HOPPER:
case ANVIL:
case CHIPPED_ANVIL:
case DAMAGED_ANVIL:
case BREWING_STAND:
return PermissableAction.CONTAINER;
default:
return null;
}
}
}
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void onPlayerJoin(PlayerJoinEvent event) { public void onPlayerJoin(PlayerJoinEvent event) {
initPlayer(event.getPlayer()); initPlayer(event.getPlayer());
@ -486,13 +652,11 @@ public class FactionsPlayerListener implements Listener {
} }
} }
private String convertTime(int time) { private String convertTime(int time) {
String result = String.valueOf(Math.round((System.currentTimeMillis() / 1000L - time) / 36.0D) / 100.0D); String result = String.valueOf(Math.round((System.currentTimeMillis() / 1000L - time) / 36.0D) / 100.0D);
return (result.length() == 3 ? result + "0" : result) + "/hrs ago"; return (result.length() == 3 ? result + "0" : result) + "/hrs ago";
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent event) { public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
@ -804,194 +968,10 @@ public class FactionsPlayerListener implements Listener {
FTeamWrapper.applyUpdatesLater(event.getFaction()); FTeamWrapper.applyUpdatesLater(event.getFaction());
} }
private static class InteractAttemptSpam {
private int attempts = 0;
private long lastAttempt = System.currentTimeMillis();
// returns the current attempt count
public int increment() {
long now = System.currentTimeMillis();
if (now > lastAttempt + 2000) {
attempts = 1;
} else {
attempts++;
}
lastAttempt = now;
return attempts;
}
}
public Set<FLocation> getCorners() { public Set<FLocation> getCorners() {
return this.corners; return this.corners;
} }
/// <summary>
/// This checks if the current player can execute an action based on it's factions access and surroundings
/// It will grant access in the following priorities:
/// - If Faction Land is Owned and the Owner is the current player, or player is faction leader.
/// - If Faction Land is not Owned and my access value is not set to DENY
/// - If none of the filters above matches, then we consider access is set to ALLOW|UNDEFINED
/// This check does not performs any kind of bypass check (i.e.: me.isAdminBypassing())
/// </summary>
/// <param name="player">The player entity which the check will be made upon</param>
/// <param name="me">The Faction player object related to the player</param>
/// <param name="loc">The World location where the action is being executed</param>
/// <param name="myFaction">The faction of the player being checked</param>
/// <param name="access">The current's faction access permission for the action</param>
private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation loc, Faction factionToCheck, Access access, PermissableAction action, boolean pain) {
boolean doPain = pain && Conf.handleExploitInteractionSpam;
if (access != null && access != Access.UNDEFINED) {
// TODO: Update this once new access values are added other than just allow / deny.
boolean landOwned = (factionToCheck.doesLocationHaveOwnersSet(loc) && !factionToCheck.getOwnerList(loc).isEmpty());
if ((landOwned && factionToCheck.getOwnerListString(loc).contains(player.getName())) || (me.getRole() == Role.LEADER && me.getFactionId().equals(factionToCheck.getId())))
return true;
else if (landOwned && !factionToCheck.getOwnerListString(loc).contains(player.getName())) {
me.msg("<b>You can't do that in this territory, it is owned by: " + factionToCheck.getOwnerListString(loc));
if (doPain) {
player.damage(Conf.actionDeniedPainAmount);
}
return false;
} else if (!landOwned && access == Access.ALLOW) return true;
else {
me.msg("You cannot " + action + " in the territory of " + factionToCheck.getTag(me.getFaction()));
return false;
}
}
// Approves any permission check if the player in question is a leader AND owns the faction.
if (me.getRole().equals(Role.LEADER) && me.getFaction().equals(factionToCheck)) return true;
me.msg("You cannot " + action + " in the territory of " + factionToCheck.getTag(me.getFaction()));
return false;
}
/// <summary>
/// This will try to resolve a permission action based on the item material, if it's not usable, will return null
/// </summary>
private static PermissableAction GetPermissionFromUsableBlock(Block block) {
return GetPermissionFromUsableBlock(block.getType());
}
/// <summary>
/// This will try to resolve a permission action based on the item material, if it's not usable, will return null
/// <summary>
private static PermissableAction GetPermissionFromUsableBlock(Material material) {
// Check for doors that might have diff material name in old version.
if (material.name().contains("DOOR") || material.name().contains("FENCE_GATE"))
return PermissableAction.DOOR;
if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE"))
return PermissableAction.BUTTON;
if (P.p.mc113) {
switch (material) {
case LEVER:
return PermissableAction.LEVER;
case ACACIA_BUTTON:
case BIRCH_BUTTON:
case DARK_OAK_BUTTON:
case JUNGLE_BUTTON:
case OAK_BUTTON:
case SPRUCE_BUTTON:
case STONE_BUTTON:
return PermissableAction.BUTTON;
case ACACIA_DOOR:
case BIRCH_DOOR:
case IRON_DOOR:
case JUNGLE_DOOR:
case OAK_DOOR:
case SPRUCE_DOOR:
case DARK_OAK_DOOR:
case ACACIA_TRAPDOOR:
case BIRCH_TRAPDOOR:
case DARK_OAK_TRAPDOOR:
case IRON_TRAPDOOR:
case JUNGLE_TRAPDOOR:
case OAK_TRAPDOOR:
case SPRUCE_TRAPDOOR:
case ACACIA_FENCE_GATE:
case BIRCH_FENCE_GATE:
case DARK_OAK_FENCE_GATE:
case JUNGLE_FENCE_GATE:
case OAK_FENCE_GATE:
case SPRUCE_FENCE_GATE:
return PermissableAction.DOOR;
case CHEST:
case TRAPPED_CHEST:
case CHEST_MINECART:
case SHULKER_BOX:
case BLACK_SHULKER_BOX:
case BLUE_SHULKER_BOX:
case BROWN_SHULKER_BOX:
case CYAN_SHULKER_BOX:
case GRAY_SHULKER_BOX:
case GREEN_SHULKER_BOX:
case LIGHT_BLUE_SHULKER_BOX:
case LIGHT_GRAY_SHULKER_BOX:
case LIME_SHULKER_BOX:
case MAGENTA_SHULKER_BOX:
case ORANGE_SHULKER_BOX:
case PINK_SHULKER_BOX:
case PURPLE_SHULKER_BOX:
case RED_SHULKER_BOX:
case WHITE_SHULKER_BOX:
case YELLOW_SHULKER_BOX:
case FURNACE:
case DROPPER:
case DISPENSER:
case ENCHANTING_TABLE:
case BREWING_STAND:
case CAULDRON:
case HOPPER:
case BEACON:
case JUKEBOX:
case ANVIL:
case CHIPPED_ANVIL:
case DAMAGED_ANVIL:
return PermissableAction.CONTAINER;
default:
return null;
}
} else {
switch (material) {
case LEVER:
return PermissableAction.LEVER;
case DARK_OAK_DOOR:
case ACACIA_DOOR:
case BIRCH_DOOR:
case IRON_DOOR:
case JUNGLE_DOOR:
case SPRUCE_DOOR:
case ACACIA_FENCE_GATE:
case BIRCH_FENCE_GATE:
case DARK_OAK_FENCE_GATE:
case OAK_FENCE_GATE:
case JUNGLE_FENCE_GATE:
case SPRUCE_FENCE_GATE:
return PermissableAction.DOOR;
case CHEST:
case ENDER_CHEST:
case TRAPPED_CHEST:
case DISPENSER:
case ENCHANTING_TABLE:
case DROPPER:
case FURNACE:
case HOPPER:
case ANVIL:
case CHIPPED_ANVIL:
case DAMAGED_ANVIL:
case BREWING_STAND:
return PermissableAction.CONTAINER;
default:
return null;
}
}
}
@EventHandler @EventHandler
public void AsyncPlayerChatEvent(AsyncPlayerChatEvent e) { public void AsyncPlayerChatEvent(AsyncPlayerChatEvent e) {
Player p = e.getPlayer(); Player p = e.getPlayer();
@ -1026,4 +1006,21 @@ public class FactionsPlayerListener implements Listener {
} }
} }
} }
private static class InteractAttemptSpam {
private int attempts = 0;
private long lastAttempt = System.currentTimeMillis();
// returns the current attempt count
public int increment() {
long now = System.currentTimeMillis();
if (now > lastAttempt + 2000) {
attempts = 1;
} else {
attempts++;
}
lastAttempt = now;
return attempts;
}
}
} }

View File

@ -20,7 +20,7 @@ public class MissionHandler implements Listener {
private P plugin; private P plugin;
public MissionHandler(P plugin){ public MissionHandler(P plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -2,13 +2,11 @@ package com.massivecraft.factions.shop;
import com.massivecraft.factions.P; import com.massivecraft.factions.P;
import com.massivecraft.factions.cmd.FCommand; import com.massivecraft.factions.cmd.FCommand;
import com.massivecraft.factions.cmd.logout.CmdLogout;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
public class CmdShop extends FCommand { public class CmdShop extends FCommand {
public CmdShop(){ public CmdShop() {
super(); super();
this.aliases.add("shop"); this.aliases.add("shop");
this.disableOnLock = false; this.disableOnLock = false;
@ -23,7 +21,7 @@ public class CmdShop extends FCommand {
@Override @Override
public void perform() { public void perform() {
if(!P.p.getConfig().getBoolean("F-Shop.Enabled")){ if (!P.p.getConfig().getBoolean("F-Shop.Enabled")) {
return; return;
} }
ShopGUI.openShop(fme); ShopGUI.openShop(fme);

View File

@ -18,13 +18,6 @@ import java.util.List;
public class ShopClickPersistence implements Listener { public class ShopClickPersistence implements Listener {
public void runCommands(List<String> list, Player p) {
for (String cmd : list) {
cmd = cmd.replace("%player%", p.getName());
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd);
}
}
public static String color(String line) { public static String color(String line) {
line = ChatColor.translateAlternateColorCodes('&', line); line = ChatColor.translateAlternateColorCodes('&', line);
return line; return line;
@ -37,6 +30,13 @@ public class ShopClickPersistence implements Listener {
return lore; return lore;
} }
public void runCommands(List<String> list, Player p) {
for (String cmd : list) {
cmd = cmd.replace("%player%", p.getName());
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd);
}
}
@EventHandler @EventHandler
public void click(InventoryClickEvent e) { public void click(InventoryClickEvent e) {
Inventory i = e.getClickedInventory(); Inventory i = e.getClickedInventory();
@ -46,7 +46,7 @@ public class ShopClickPersistence implements Listener {
if (e.getView().getTitle().equalsIgnoreCase(color(config.getString("F-Shop.GUI.Name")))) { if (e.getView().getTitle().equalsIgnoreCase(color(config.getString("F-Shop.GUI.Name")))) {
ItemStack item = e.getCurrentItem(); ItemStack item = e.getCurrentItem();
if(item == null) return; if (item == null) return;
String name = color(item.getItemMeta().getDisplayName()); String name = color(item.getItemMeta().getDisplayName());
e.setCancelled(true); e.setCancelled(true);
int t = e.getSlot(); int t = e.getSlot();

View File

@ -13,9 +13,11 @@ public class ShopConfig {
public static File shop = new File("plugins/Factions/shop.yml"); public static File shop = new File("plugins/Factions/shop.yml");
public static FileConfiguration s = YamlConfiguration.loadConfiguration(shop); public static FileConfiguration s = YamlConfiguration.loadConfiguration(shop);
public static FileConfiguration getShop() { public static FileConfiguration getShop() {
return s; return s;
} }
public static void loadShop() { public static void loadShop() {
s = YamlConfiguration.loadConfiguration(shop); s = YamlConfiguration.loadConfiguration(shop);
} }

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.P;
import com.massivecraft.factions.util.XMaterial; import com.massivecraft.factions.util.XMaterial;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;

View File

@ -18,6 +18,7 @@ public enum Permission {
BYPASS("bypass"), BYPASS("bypass"),
CHAT("chat"), CHAT("chat"),
CHATSPY("chatspy"), CHATSPY("chatspy"),
CHECK("check"),
CLAIM("claim"), CLAIM("claim"),
CLAIMAT("claimat"), CLAIMAT("claimat"),
CLAIM_LINE("claim.line"), CLAIM_LINE("claim.line"),

View File

@ -0,0 +1,23 @@
package com.massivecraft.factions.util;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import org.bukkit.scheduler.BukkitRunnable;
public class CheckWallTask extends BukkitRunnable {
private int overtime;
public CheckWallTask() {
overtime = 0;
}
public void run() {
++overtime;
for (Faction faction : Factions.getInstance().getAllFactions()) {
if (faction.getCheckNotifier() != 0L && overtime % faction.getCheckNotifier() == 0L) {
faction.sendCheckNotify();
}
}
}
}

View File

@ -4,21 +4,20 @@ import com.github.stefvanschie.inventoryframework.Gui;
import com.github.stefvanschie.inventoryframework.GuiItem; import com.github.stefvanschie.inventoryframework.GuiItem;
import com.github.stefvanschie.inventoryframework.pane.PaginatedPane; import com.github.stefvanschie.inventoryframework.pane.PaginatedPane;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P; import com.massivecraft.factions.P;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.Bukkit;
import com.massivecraft.factions.zcore.util.TL;
import java.util.Map; import java.util.Map;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import org.bukkit.configuration.ConfigurationSection;
public class FactionWarpsFrame { public class FactionWarpsFrame {
@ -27,7 +26,7 @@ public class FactionWarpsFrame {
public FactionWarpsFrame(final Faction f) { public FactionWarpsFrame(final Faction f) {
this.section = P.p.getConfig().getConfigurationSection("fwarp-gui"); this.section = P.p.getConfig().getConfigurationSection("fwarp-gui");
this.gui = new Gui(P.p, section.getInt("rows", 3), P.p.color(this.section.getString("name").replace("{faction}",f.getTag()))); this.gui = new Gui(P.p, section.getInt("rows", 3), P.p.color(this.section.getString("name").replace("{faction}", f.getTag())));
} }
public void buildGUI(final FPlayer fplayer) { public void buildGUI(final FPlayer fplayer) {
@ -35,7 +34,8 @@ public class FactionWarpsFrame {
final List<GuiItem> GUIItems = new ArrayList<>(); final List<GuiItem> GUIItems = new ArrayList<>();
final List<Integer> slots = section.getIntegerList("warp-slots"); final List<Integer> slots = section.getIntegerList("warp-slots");
int count = 0; int count = 0;
for (int x = 0; x <= gui.getRows() * 9 - 1; ++x) GUIItems.add(new GuiItem(buildDummyItem(), e -> e.setCancelled(true))); for (int x = 0; x <= gui.getRows() * 9 - 1; ++x)
GUIItems.add(new GuiItem(buildDummyItem(), e -> e.setCancelled(true)));
slots.forEach(slot -> GUIItems.set(slot, new GuiItem(XMaterial.AIR.parseItem()))); slots.forEach(slot -> GUIItems.set(slot, new GuiItem(XMaterial.AIR.parseItem())));
for (final Map.Entry<String, LazyLocation> warp : fplayer.getFaction().getWarps().entrySet()) { for (final Map.Entry<String, LazyLocation> warp : fplayer.getFaction().getWarps().entrySet()) {
if (count > slots.size()) continue; if (count > slots.size()) continue;

View File

@ -1318,7 +1318,8 @@ public enum XMaterial {
*/ */
public static String getExactMajorVersion(String version) { public static String getExactMajorVersion(String version) {
// getBukkitVersion() // getBukkitVersion()
if (version.contains("SNAPSHOT") || version.contains("-R")) version = version.substring(0, version.indexOf("-")); if (version.contains("SNAPSHOT") || version.contains("-R"))
version = version.substring(0, version.indexOf("-"));
// getVersion() // getVersion()
if (version.contains("git")) version = version.substring(version.indexOf("MC:") + 4).replace(")", ""); if (version.contains("git")) version = version.substring(version.indexOf("MC:") + 4).replace(")", "");
if (version.split(Pattern.quote(".")).length > 2) version = version.substring(0, version.lastIndexOf(".")); if (version.split(Pattern.quote(".")).length > 2) version = version.substring(0, version.lastIndexOf("."));
@ -1334,7 +1335,8 @@ public enum XMaterial {
*/ */
private static MinecraftVersion valueOfVersion(String version) { private static MinecraftVersion valueOfVersion(String version) {
version = getExactMajorVersion(version); version = getExactMajorVersion(version);
if (version.equals("1.10") || version.equals("1.11") || version.equals("1.12")) return MinecraftVersion.VERSION_1_9; if (version.equals("1.10") || version.equals("1.11") || version.equals("1.12"))
return MinecraftVersion.VERSION_1_9;
version = version.replace(".", "_"); version = version.replace(".", "_");
if (!version.startsWith("VERSION_")) version = "VERSION_" + version; if (!version.startsWith("VERSION_")) version = "VERSION_" + version;
String check = version; String check = version;

View File

@ -1,5 +1,8 @@
package com.massivecraft.factions.zcore.fperms; package com.massivecraft.factions.zcore.fperms;
import com.massivecraft.factions.util.XMaterial;
import javafx.scene.paint.Material;
public class DefaultPermissions { public class DefaultPermissions {
public boolean ban; public boolean ban;
public boolean build; public boolean build;
@ -27,6 +30,7 @@ public class DefaultPermissions {
public boolean tntfill; public boolean tntfill;
public boolean withdraw; public boolean withdraw;
public boolean chest; public boolean chest;
public boolean check;
public boolean spawner; public boolean spawner;
public DefaultPermissions() { public DefaultPermissions() {
@ -59,6 +63,7 @@ public class DefaultPermissions {
this.tntfill = def; this.tntfill = def;
this.withdraw = def; this.withdraw = def;
this.chest = def; this.chest = def;
this.check = def;
this.spawner = def; this.spawner = def;
} }
@ -88,6 +93,7 @@ public class DefaultPermissions {
boolean canTntfill, boolean canTntfill,
boolean canWithdraw, boolean canWithdraw,
boolean canChest, boolean canChest,
boolean canCheck,
boolean canSpawners) { boolean canSpawners) {
this.ban = canBan; this.ban = canBan;
this.build = canBuild; this.build = canBuild;
@ -115,6 +121,7 @@ public class DefaultPermissions {
this.tntfill = canTntfill; this.tntfill = canTntfill;
this.withdraw = canWithdraw; this.withdraw = canWithdraw;
this.chest = canChest; this.chest = canChest;
this.check = canCheck;
this.spawner = canSpawners; this.spawner = canSpawners;
} }
@ -146,6 +153,7 @@ public class DefaultPermissions {
else if (name == "tntfill") return this.tntfill; else if (name == "tntfill") return this.tntfill;
else if (name == "withdraw") return this.withdraw; else if (name == "withdraw") return this.withdraw;
else if (name == "chest") return this.chest; else if (name == "chest") return this.chest;
else if(name == "check") return this.check;
else if (name == "spawner") return this.spawner; else if (name == "spawner") return this.spawner;
else return false; else return false;
} }

View File

@ -39,6 +39,7 @@ public enum PermissableAction {
TNTFILL("tntfill"), TNTFILL("tntfill"),
WITHDRAW("withdraw"), WITHDRAW("withdraw"),
CHEST("chest"), CHEST("chest"),
CHECK("check"),
SPAWNER("spawner"); SPAWNER("spawner");
private String name; private String name;

View File

@ -67,6 +67,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
protected Role defaultRole; protected Role defaultRole;
protected Map<Permissable, Map<PermissableAction, Access>> permissions = new HashMap<>(); protected Map<Permissable, Map<PermissableAction, Access>> permissions = new HashMap<>();
protected Set<BanInfo> bans = new HashSet<>(); protected Set<BanInfo> bans = new HashSet<>();
protected long checkNotifier = 0;
protected String player; protected String player;
Inventory chest; Inventory chest;
Map<String, Object> bannerSerialized; Map<String, Object> bannerSerialized;
@ -97,6 +98,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
this.foundedDate = System.currentTimeMillis(); this.foundedDate = System.currentTimeMillis();
this.maxVaults = Conf.defaultMaxVaults; this.maxVaults = Conf.defaultMaxVaults;
this.defaultRole = Role.RECRUIT; this.defaultRole = Role.RECRUIT;
this.checkNotifier = 0;
resetPerms(); // Reset on new Faction so it has default values. resetPerms(); // Reset on new Faction so it has default values.
} }
@ -122,6 +124,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
invites = old.invites; invites = old.invites;
announcements = old.announcements; announcements = old.announcements;
this.defaultRole = Role.NORMAL; this.defaultRole = Role.NORMAL;
this.checkNotifier = 0;
resetPerms(); // Reset on new Faction so it has default values. resetPerms(); // Reset on new Faction so it has default values.
} }
@ -342,6 +345,21 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return false; return false;
} }
@Override
public long getCheckNotifier() {
return this.checkNotifier;
}
@Override
public void setCheckNotifier(final long minutes) {
this.checkNotifier = minutes;
}
@Override
public void sendCheckNotify() {
this.sendMessage(TL.CHECK_NOTIFY_MESSAGE.toString());
}
public Set<BanInfo> getBannedPlayers() { public Set<BanInfo> getBannedPlayers() {
return this.bans; return this.bans;
} }

View File

@ -280,6 +280,11 @@ public enum TL {
COMMAND_CREATE_CREATEDLOG(" created a new faction: "), COMMAND_CREATE_CREATEDLOG(" created a new faction: "),
COMMAND_CREATE_DESCRIPTION("Create a new faction"), COMMAND_CREATE_DESCRIPTION("Create a new faction"),
COMMAND_CHECK_INVALID_NUMBER("&c&l[!] &7You may not set your factions wall check timer to that number!"),
COMMAND_CHECK_SUCCESSFUL("&c&l[!] &7You have set your factions wall check timer to &b%1$d &7minutes!"),
COMMAND_CHECK_DESCRIPTION("Check your factions walls!"),
CHECK_NOTIFY_MESSAGE("\n &c&lFaction Walls&7» &bCheck Your Walls! \n"),
COMMAND_DEINVITE_CANDEINVITE("&c&l[!]&7 Players you can &cdeinvite: "), COMMAND_DEINVITE_CANDEINVITE("&c&l[!]&7 Players you can &cdeinvite: "),
COMMAND_DEINVITE_CLICKTODEINVITE("&c&l[!]&7 Click to &crevoke&7 invite for &c%1$s"), COMMAND_DEINVITE_CLICKTODEINVITE("&c&l[!]&7 Click to &crevoke&7 invite for &c%1$s"),
COMMAND_DEINVITE_ALREADYMEMBER("&c&l[!]&7 &c%1$s&7 is already a member of &c%2$s"), COMMAND_DEINVITE_ALREADYMEMBER("&c&l[!]&7 &c%1$s&7 is already a member of &c%2$s"),

View File

@ -472,6 +472,7 @@ fperm-gui:
tntbank: BEACON tntbank: BEACON
tntfill: TNT tntfill: TNT
chest: ENDER_CHEST chest: ENDER_CHEST
check: WATCH
spawner: MOB_SPAWNER spawner: MOB_SPAWNER
home: ENDER_EYE home: ENDER_EYE
slots: slots:
@ -505,8 +506,9 @@ fperm-gui:
tntbank: 39 tntbank: 39
tntfill: 41 tntfill: 41
chest: 42 chest: 42
check: 50
spawner: 38 spawner: 38
home: 49 home: 48
# {action} Action name eg: Setwarp, Kick # {action} Action name eg: Setwarp, Kick
# {action-access} Access name eg: Allow, Deny # {action-access} Access name eg: Allow, Deny
# {action-access-color} Access color eg: Allow;GREEN # {action-access-color} Access color eg: Allow;GREEN

View File

@ -114,6 +114,8 @@ permissions:
factions.banner: true factions.banner: true
factions.vault: true factions.vault: true
factions.getvault: true factions.getvault: true
factions.check:
description: give players access to use check commands
factions.admin: factions.admin:
description: hand over your admin rights description: hand over your admin rights
factions.admin.any: factions.admin.any: