Updated Code I forgot to commit

This commit is contained in:
Driftay 2019-06-29 03:36:31 -04:00
parent 51c163fb16
commit 72799966c7
9 changed files with 10 additions and 21 deletions

View File

@ -365,10 +365,6 @@
<id>mvdw-software</id>
<url>http://repo.mvdw-software.be/content/groups/public/</url>
</repository>
<repository>
<id>ProSavage</id>
<url>https://www.myget.org/F/prosavage/maven/</url>
</repository>
</repositories>
<distributionManagement>

View File

@ -221,7 +221,7 @@ public class Conf {
/// This defines a set of materials which should always be allowed to use, regardless of factions permissions.
/// Useful for HCF features.
/// </summary>
public static Set<Material> territoryBypasssProtectedMaterials = EnumSet.noneOf(Material.class);
public static Set<Material> territoryBypassProtectedMaterials = EnumSet.noneOf(Material.class);
// Economy settings
public static boolean econEnabled = false;
@ -325,6 +325,7 @@ public class Conf {
// mainly for other plugins/mods that use a fake player to take actions, which shouldn't be subject to our protections
public static Set<String> playersWhoBypassAllProtection = new LinkedHashSet<>();
public static boolean useWorldConfigurationsAsWhitelist = false;
public static Set<String> worldsNoClaiming = new LinkedHashSet<>();
public static Set<String> worldsNoPowerLoss = new LinkedHashSet<>();
public static Set<String> worldsIgnorePvP = new LinkedHashSet<>();
@ -343,9 +344,7 @@ public class Conf {
// Default Options - Is this even shown on the Conf.json?
public static boolean useCustomDefaultPermissions = false;
public static boolean usePermissionHints = false;
public static HashMap<String, DefaultPermissions> defaultFactionPermissions = new HashMap<>();
public static transient HashMap<String, DefaultPermissions> defaultFactionPermissions = new HashMap<>();
// Custom Ranks - Oof I forgot I was doing this _SvenjaReissaus_
//public static boolean enableCustomRanks = false; // We will disable it by default to avoid any migration error
//public static int maxCustomRanks = 2; // Setting this to -1 will allow unlimited custom ranks
@ -369,7 +368,7 @@ public class Conf {
territoryProtectedMaterials.add(Material.BEACON);
// Config is not loading if value is empty ???
territoryBypasssProtectedMaterials.add(Material.COOKIE);
territoryBypassProtectedMaterials.add(Material.COOKIE);
territoryDenyUseageMaterials.add(SaberFactions.plugin.FIREBALL);
territoryDenyUseageMaterials.add(Material.FLINT_AND_STEEL);

View File

@ -117,11 +117,6 @@ public class CmdCreate extends FCommand {
fme.setCooldown("create", System.currentTimeMillis() + (SaberFactions.plugin.getConfig().getInt("fcooldowns.f-create") * 1000));
if (Conf.useCustomDefaultPermissions) {
faction.setDefaultPerms();
if (Conf.usePermissionHints)
this.fme.msg(TL.COMMAND_HINT_PERMISSION);
}
}
@Override

View File

@ -65,7 +65,7 @@ public class CmdDisband extends FCommand {
}
if (!fme.isAdminBypassing()) {
if (fme != null && !fme.isAdminBypassing()) {
Access access = faction.getAccess(fme, PermissableAction.DISBAND);
if (fme.getRole() != Role.LEADER && faction.getFPlayerLeader() != fme && access != Access.ALLOW) {
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband " + faction.getTag());
@ -84,7 +84,7 @@ public class CmdDisband extends FCommand {
// check for tnt before disbanding.
if (!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() + ""));
disbandMap.put(me.getUniqueId().toString(), faction.getId());
Bukkit.getScheduler().scheduleSyncDelayedTask(SaberFactions.plugin, () -> disbandMap.remove(me.getUniqueId().toString()), 200L);

View File

@ -642,8 +642,8 @@ public class FactionsPlayerListener implements Listener {
Block block = event.getClickedBlock();
Player player = event.getPlayer();
// Check if the material is bypassing protection
if (Conf.territoryBypasssProtectedMaterials.contains(block.getType())) return;
if (block == null) return; // clicked in air, apparently
if (Conf.territoryBypassProtectedMaterials.contains(block.getType())) return;
if (GetPermissionFromUsableBlock(event.getClickedBlock().getType()) != null) {
if (!canPlayerUseBlock(player, block, false)) {
event.setCancelled(true);

View File

@ -790,7 +790,7 @@ public abstract class MemoryFPlayer implements FPlayer {
error = SaberFactions.plugin.txt.parse(TL.CLAIM_PROTECTED.toString());
} else if (flocation.isOutsideWorldBorder(SaberFactions.plugin.getConfig().getInt("world-border.buffer", 0))) {
error = SaberFactions.plugin.txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
} else if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) {
} else if (Conf.useWorldConfigurationsAsWhitelist != Conf.worldsNoClaiming.contains(flocation.getWorldName())) {
error = SaberFactions.plugin.txt.parse(TL.CLAIM_DISABLED.toString());
} else if (this.isAdminBypassing()) {
return true;

View File

@ -707,7 +707,6 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
}
public void setDefaultPerms() {
if (!Conf.useCustomDefaultPermissions) return;
Map<PermissableAction, Access> defaultMap = new HashMap<>();
for (PermissableAction permissableAction : PermissableAction.values()) {
defaultMap.put(permissableAction, Access.UNDEFINED);

View File

@ -1,4 +1,4 @@
# Lang file for SaberFactions by drtshock & ProSavage
# Lang file for SaberFactions by drtshock & Driftay
# Use & for color codes.
# Made with love <3

View File

@ -4,7 +4,7 @@ api-version: 1.13
main: com.massivecraft.factions.SaberFactions
authors: [Olof Larsson, Brett Flannigan, drtshock, ProSavage, SvenjaReißaus, Driftay]
softdepend: [Skript, CoreProtect, PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap, FactionsTop]
website: www.prosavage.net
commands:
factions:
description: Reference command for Factions.