Spawner Perm issue fix, and Warbanners now functional again ( was broken in 1.4-BETA-1 )

This commit is contained in:
ProSavage 2018-05-14 10:59:23 -05:00
parent cb947404f6
commit 1df8faf488
4 changed files with 22 additions and 8 deletions

View File

@ -73,9 +73,12 @@ public class FactionsBlockListener implements Listener {
return;
}
FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer());
if (!fme.hasFaction()) {
return;
}
if (event.getBlock().getType() == Material.MOB_SPAWNER) {
Access access = fme.getFaction().getAccess(fme, PermissableAction.SPAWNER);
if (access.equals(Access.DENY) || access.equals(Access.UNDEFINED)) {
if (access.equals(Access.DENY)) {
fme.msg(TL.GENERIC_NOPERMISSION, "mine spawners");
event.setCancelled(true);

View File

@ -42,6 +42,7 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.player.*;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.NumberConversions;
@ -506,11 +507,21 @@ public class FactionsPlayerListener implements Listener {
if (P.p.mc17) {
return;
}
if (e.getItemInHand().getType() == Material.BANNER){
ItemStack bannerInHand = e.getItemInHand();
ItemStack warBanner = P.p.createItem(bannerInHand.getType(),1,bannerInHand.getDurability(),P.p.getConfig().getString("fbanners.Item.Name"),P.p.getConfig().getStringList("fbanners.Item.Lore"));
if (warBanner.isSimilar(bannerInHand)){
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
ItemStack warBanner = fme.getFaction().getBanner();
if (warBanner != null) {
ItemMeta warmeta = warBanner.getItemMeta();
warmeta.setDisplayName(P.p.color(P.p.getConfig().getString("fbanners.Item.Name")));
warmeta.setLore(P.p.colorList(P.p.getConfig().getStringList("fbanners.Item.Lore")));
warBanner.setItemMeta(warmeta);
} else {
warBanner = P.p.createItem(Material.BANNER, 1, (short) 1, P.p.getConfig().getString("fbanners.Item.Name"), P.p.getConfig().getStringList("fbanners.Item.Lore"));
}
if (warBanner.isSimilar(bannerInHand)) {
if (fme.getFaction().isWilderness()){
fme.msg(TL.WARBANNER_NOFACTION);
e.setCancelled(true);

View File

@ -881,9 +881,9 @@ fupgrades:
Chest:
Chest-Size:
# This is rows
level-1: 1
level-2: 2
level-3: 3
level-1: 2
level-2: 3
level-3: 4
Cost:
level-1: 1000000
level-2: 2000000

View File

@ -1,5 +1,5 @@
name: Factions
version: ${project.version}-1.4-STABLE
version: ${project.version}-1.4-BETA-2
main: com.massivecraft.factions.P
authors: [Olof Larsson, Brett Flannigan, drtshock, ProSavage]
softdepend: [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]