Spawner Perm issue fix, and Warbanners now functional again ( was broken in 1.4-BETA-1 )
This commit is contained in:
parent
cb947404f6
commit
1df8faf488
@ -73,9 +73,12 @@ public class FactionsBlockListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer());
|
FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer());
|
||||||
|
if (!fme.hasFaction()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (event.getBlock().getType() == Material.MOB_SPAWNER) {
|
if (event.getBlock().getType() == Material.MOB_SPAWNER) {
|
||||||
Access access = fme.getFaction().getAccess(fme, PermissableAction.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");
|
fme.msg(TL.GENERIC_NOPERMISSION, "mine spawners");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
|||||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.util.NumberConversions;
|
import org.bukkit.util.NumberConversions;
|
||||||
@ -506,11 +507,21 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
if (P.p.mc17) {
|
if (P.p.mc17) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.getItemInHand().getType() == Material.BANNER){
|
if (e.getItemInHand().getType() == Material.BANNER){
|
||||||
ItemStack bannerInHand = e.getItemInHand();
|
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"));
|
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
|
||||||
if (warBanner.isSimilar(bannerInHand)){
|
ItemStack warBanner = fme.getFaction().getBanner();
|
||||||
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
|
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()){
|
if (fme.getFaction().isWilderness()){
|
||||||
fme.msg(TL.WARBANNER_NOFACTION);
|
fme.msg(TL.WARBANNER_NOFACTION);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
@ -881,9 +881,9 @@ fupgrades:
|
|||||||
Chest:
|
Chest:
|
||||||
Chest-Size:
|
Chest-Size:
|
||||||
# This is rows
|
# This is rows
|
||||||
level-1: 1
|
level-1: 2
|
||||||
level-2: 2
|
level-2: 3
|
||||||
level-3: 3
|
level-3: 4
|
||||||
Cost:
|
Cost:
|
||||||
level-1: 1000000
|
level-1: 1000000
|
||||||
level-2: 2000000
|
level-2: 2000000
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: Factions
|
name: Factions
|
||||||
version: ${project.version}-1.4-STABLE
|
version: ${project.version}-1.4-BETA-2
|
||||||
main: com.massivecraft.factions.P
|
main: com.massivecraft.factions.P
|
||||||
authors: [Olof Larsson, Brett Flannigan, drtshock, ProSavage]
|
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]
|
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]
|
||||||
|
Loading…
Reference in New Issue
Block a user