Initial Commit

This commit is contained in:
Driftay 2019-06-28 16:46:45 -04:00
parent 8b08c4f72a
commit 1fd3220e5e
6 changed files with 17 additions and 18 deletions

View File

@ -53,10 +53,12 @@ public class CmdInviteAlt extends FCommand {
return; return;
} }
Access access = myFaction.getAccess(target, PermissableAction.INVITEALT); if (!fme.isAdminBypassing()) {
if (access == Access.DENY || (access == Access.UNDEFINED && !assertMinRole(Role.MODERATOR))) { Access access = myFaction.getAccess(fme, PermissableAction.INVITE);
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "invitealt"); if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
return; fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage invites");
return;
}
} }
if (myFaction.isBanned(target)) { if (myFaction.isBanned(target)) {

View File

@ -62,9 +62,9 @@ public class CmdKickAlt extends FCommand{
// requirements // requirements
if (!Permission.KICK_ANY.has(sender)) { if (!Permission.KICK_ANY.has(sender)) {
Access access = myFaction.getAccess(fme, PermissableAction.KICKALT); Access access = myFaction.getAccess(fme, PermissableAction.KICK);
if (access == Access.DENY || (access == Access.UNDEFINED && !assertMinRole(Role.MODERATOR))) { if (access == Access.DENY || (access == Access.UNDEFINED && !assertMinRole(Role.MODERATOR))) {
fme.msg(TL.GENERIC_NOPERMISSION, "kickalt"); fme.msg(TL.GENERIC_NOPERMISSION, "kick");
return; return;
} }
@ -90,12 +90,12 @@ public class CmdKickAlt extends FCommand{
} }
} }
Access access = myFaction.getAccess(fme, PermissableAction.KICKALT); Access access = myFaction.getAccess(fme, PermissableAction.KICK);
// This statement allows us to check if they've specifically denied it, // This statement allows us to check if they've specifically denied it,
// or default to // or default to
// the old setting of allowing moderators to kick // the old setting of allowing moderators to kick
if (access == Access.DENY || (access == Access.UNDEFINED && !assertMinRole(Role.MODERATOR))) { if (access == Access.DENY || (access == Access.UNDEFINED && !assertMinRole(Role.MODERATOR))) {
fme.msg(TL.GENERIC_NOPERMISSION, "kickalt"); fme.msg(TL.GENERIC_NOPERMISSION, "kick");
return; return;
} }

View File

@ -2,6 +2,7 @@ package com.massivecraft.factions.integration;
import com.earth2me.essentials.Teleport; import com.earth2me.essentials.Teleport;
import com.earth2me.essentials.Trade; import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -41,6 +42,8 @@ public class Essentials {
} }
public static boolean isVanished(Player player) { public static boolean isVanished(Player player) {
return essentials != null && essentials.getUser(player).isVanished(); if (essentials == null) return false;
User user = essentials.getUser(player);
return user != null && user.isVanished();
} }
} }

View File

@ -839,7 +839,7 @@ public class FactionsPlayerListener implements Listener {
/// <summary> /// <summary>
private static PermissableAction GetPermissionFromUsableBlock(Material material) { private static PermissableAction GetPermissionFromUsableBlock(Material material) {
// Check for doors that might have diff material name in old version. // Check for doors that might have diff material name in old version.
if (material.name().contains("DOOR")) if (material.name().contains("DOOR") || material.name().contains("FENCE_GATE"))
return PermissableAction.DOOR; return PermissableAction.DOOR;
if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE")) if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE"))
return PermissableAction.BUTTON; return PermissableAction.BUTTON;
@ -929,9 +929,11 @@ public class FactionsPlayerListener implements Listener {
case IRON_DOOR: case IRON_DOOR:
case JUNGLE_DOOR: case JUNGLE_DOOR:
case SPRUCE_DOOR: case SPRUCE_DOOR:
case ACACIA_FENCE_GATE: case ACACIA_FENCE_GATE:
case BIRCH_FENCE_GATE: case BIRCH_FENCE_GATE:
case DARK_OAK_FENCE_GATE: case DARK_OAK_FENCE_GATE:
case OAK_FENCE_GATE:
case JUNGLE_FENCE_GATE: case JUNGLE_FENCE_GATE:
case SPRUCE_FENCE_GATE: case SPRUCE_FENCE_GATE:
return PermissableAction.DOOR; return PermissableAction.DOOR;

View File

@ -1,4 +0,0 @@
package me.driftay.addons;
public class Utils {
}

View File

@ -521,8 +521,6 @@ fperm-gui:
tntfill: 41 tntfill: 41
chest: 42 chest: 42
spawner: 38 spawner: 38
invitealt: 50
kickalt: 48
home: 49 home: 49
# Material to show, if the material is colorable eg: Wool, Stained Clay it will update with it's access color # Material to show, if the material is colorable eg: Wool, Stained Clay it will update with it's access color
materials: materials:
@ -556,8 +554,6 @@ fperm-gui:
chest: STAINED_GLASS chest: STAINED_GLASS
spawner: STAINED_GLASS spawner: STAINED_GLASS
home: STAINED_GLASS home: STAINED_GLASS
invitealt: STAINED_GLASS
kickalt: STAINED_GLASS
# Same dummy items format as above # Same dummy items format as above
dummy-items: dummy-items:
'0': '0':