adding new stuff

This commit is contained in:
Naman 2018-03-26 16:43:15 -05:00
parent 382f4c4b0c
commit 44b3de91dd
84 changed files with 1830 additions and 481 deletions

View File

@ -36,7 +36,8 @@ public class Conf {
public static double powerOfflineLossLimit = 0.0; // players will no longer lose power from being offline once their power drops to this amount or less
public static double powerFactionMax = 0.0; // if greater than 0, the cap on how much power a faction can have (additional power from players beyond that will act as a "buffer" of sorts)
public static String prefixAdmin = "**";
public static String prefixAdmin = "***";
public static String prefixCoLeader = "**";
public static String prefixMod = "*";
public static String prefixRecruit = "-";
public static String prefixNormal = "+";
@ -73,7 +74,6 @@ public class Conf {
public static boolean chatTagPadBefore = false;
public static boolean chatTagPadAfter = true;
public static String chatTagFormat = "%s" + ChatColor.WHITE;
public static boolean alwaysShowChatTag = true;
public static String factionChatFormat = "%s:" + ChatColor.WHITE + " %s";
public static String allianceChatFormat = ChatColor.LIGHT_PURPLE + "%s:" + ChatColor.WHITE + " %s";
public static String truceChatFormat = ChatColor.DARK_PURPLE + "%s:" + ChatColor.WHITE + " %s";
@ -160,12 +160,6 @@ public class Conf {
public static Set<String> warzoneDenyCommands = new LinkedHashSet<>();
public static Set<String> wildernessDenyCommands = new LinkedHashSet<>();
public static boolean defaultFlyPermEnemy = false;
public static boolean defaultFlyPermNeutral = false;
public static boolean defaultFlyPermTruce = false;
public static boolean defaultFlyPermAlly = true;
public static boolean defaultFlyPermMember = true;
public static boolean territoryDenyBuild = true;
public static boolean territoryDenyBuildWhenOffline = true;
public static boolean territoryPainBuild = false;

View File

@ -237,6 +237,10 @@ public interface FPlayer extends EconomyParticipator {
public boolean attemptClaim(Faction forFaction, FLocation location, boolean notifyFailure);
public void setInVault(boolean status);
public boolean isInVault();
public void msg(String str, Object... args);
public String getId();
@ -275,6 +279,15 @@ public interface FPlayer extends EconomyParticipator {
public boolean canFlyAtLocation(FLocation location);
public boolean isEnteringPassword();
public void setEnteringPassword(boolean toggle, String warp);
public String getEnteringWarp();
public boolean checkIfNearbyEnemies();
// -------------------------------
// Warmups
// -------------------------------

View File

@ -12,6 +12,7 @@ import com.massivecraft.factions.zcore.fperms.PermissableAction;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@ -55,6 +56,10 @@ public interface Faction extends EconomyParticipator {
public void deinvite(FPlayer fplayer);
public void setUpgrades(String key, int level);
public int getUpgrade(String key);
public boolean isInvited(FPlayer fplayer);
public void ban(FPlayer target, FPlayer banner);
@ -65,6 +70,32 @@ public interface Faction extends EconomyParticipator {
public Set<BanInfo> getBannedPlayers();
public HashMap<Integer,String> getRulesMap();
public void setRule(int index, String rule);
public void addRule(String rule);
public void removeRule(int index);
public void clearRules();
public void setCheckpoint(Location location);
public Location getCheckpoint();
public void addTnt(int amt);
public void takeTnt(int amt);
public Location getVault();
public void setVault(Location vaultLocation);
public int getTnt();
public String getRule(int index);
public boolean getOpen();
public void setOpen(boolean isOpen);

View File

@ -1,6 +1,5 @@
package com.massivecraft.factions;
import com.earth2me.essentials.IEssentials;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.massivecraft.factions.cmd.CmdAutoHelp;
@ -16,25 +15,32 @@ import com.massivecraft.factions.zcore.MPlugin;
import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.Permissable;
import com.massivecraft.factions.zcore.fperms.PermissableAction;
import com.massivecraft.factions.zcore.fupgrades.CropUpgrades;
import com.massivecraft.factions.zcore.fupgrades.EXPUpgrade;
import com.massivecraft.factions.zcore.fupgrades.FUpgradesGUI;
import com.massivecraft.factions.zcore.fupgrades.SpawnerUpgrades;
import com.massivecraft.factions.zcore.util.TextUtil;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.*;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import java.io.IOException;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.logging.Level;
public class P extends MPlugin {
// Our single plugin instance.
@ -55,7 +61,29 @@ public class P extends MPlugin {
}
private Integer AutoLeaveTask = null;
public void playSoundForAll(String sound) {
for (Player pl : Bukkit.getOnlinePlayers()) {
playSound(pl, sound);
}
}
public void playSoundForAll(List<String> sounds) {
for (Player pl : Bukkit.getOnlinePlayers()) {
playSound(pl, sounds);
}
}
public void playSound(Player p, List<String> sounds) {
for (String sound : sounds) {
playSound(p, sound);
}
}
public void playSound(Player p, String sound) {
float pitch = Float.valueOf(sound.split(":")[1]);
sound = sound.split(":")[0];
p.playSound(p.getLocation(), Sound.valueOf(sound), pitch, 5.0F);
}
// Commands
public FCmdRoot cmdBase;
public CmdAutoHelp cmdAutoHelp;
@ -68,6 +96,7 @@ public class P extends MPlugin {
p = this;
}
public boolean mc17 = false;
@Override
public void onEnable() {
if (!preEnable()) {
@ -78,19 +107,8 @@ public class P extends MPlugin {
// Load Conf from disk
Conf.load();
// Check for Essentials
IEssentials ess = Essentials.setup();
// We set the option to TRUE by default in the config.yml for new users,
// BUT we leave it set to false for users updating that haven't added it to their config.
if (ess != null && getConfig().getBoolean("delete-ess-homes", false)) {
P.p.log(Level.INFO, "Found Essentials. We'll delete player homes in their old Faction's when kicked.");
getServer().getPluginManager().registerEvents(new EssentialsListener(ess), this);
}
Essentials.setup();
hookedPlayervaults = setupPlayervaults();
FPlayers.getInstance().load();
Factions.getInstance().load();
for (FPlayer fPlayer : FPlayers.getInstance().getAllFPlayers()) {
@ -122,13 +140,22 @@ public class P extends MPlugin {
// start up task which runs the autoLeaveAfterDaysOfInactivity routine
startAutoLeaveTask(false);
//Massive stats
MassiveStats update = new MassiveStats(this, 60);
mc17 = Bukkit.getServer().getClass().getPackage().getName().contains("1.7");
// Register Event Handlers
getServer().getPluginManager().registerEvents(new FactionsPlayerListener(this), this);
getServer().getPluginManager().registerEvents(new FactionsChatListener(this), this);
getServer().getPluginManager().registerEvents(new FactionsEntityListener(this), this);
getServer().getPluginManager().registerEvents(new FactionsExploitListener(), this);
getServer().getPluginManager().registerEvents(new FactionsBlockListener(this), this);
getServer().getPluginManager().registerEvents(new FUpgradesGUI(), this);
getServer().getPluginManager().registerEvents(new EXPUpgrade(),this);
getServer().getPluginManager().registerEvents(new CropUpgrades(),this);
getServer().getPluginManager().registerEvents(new SpawnerUpgrades(),this);
// since some other plugins execute commands directly through this command interface, provide it
this.getCommand(this.refCommand).setExecutor(this);
@ -186,8 +213,7 @@ public class P extends MPlugin {
Type accessTypeAdatper = new TypeToken<Map<Permissable, Map<PermissableAction, Access>>>() {
}.getType();
return new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().enableComplexMapKeySerialization().excludeFieldsWithModifiers(Modifier.TRANSIENT, Modifier.VOLATILE).registerTypeAdapter(accessTypeAdatper, new PermissionsMapTypeAdapter()).registerTypeAdapter(LazyLocation.class, new MyLocationTypeAdapter()).registerTypeAdapter(mapFLocToStringSetType, new MapFLocToStringSetTypeAdapter()).registerTypeAdapterFactory(EnumTypeAdapter.ENUM_FACTORY);
}
return new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().enableComplexMapKeySerialization().excludeFieldsWithModifiers(Modifier.TRANSIENT, Modifier.VOLATILE).registerTypeAdapter(accessTypeAdatper, new PermissionsMapTypeAdapter()).registerTypeAdapter(LazyLocation.class, new MyLocationTypeAdapter()).registerTypeAdapter(mapFLocToStringSetType, new MapFLocToStringSetTypeAdapter()).registerTypeAdapterFactory(EnumTypeAdapter.ENUM_FACTORY); }
@Override
public void onDisable() {
@ -222,7 +248,29 @@ public class P extends MPlugin {
//Board.getInstance().forceSave(); Not sure why this was there as it's called after the board is already saved.
Conf.save();
}
public ItemStack createItem(Material material, int amount, short datavalue, String name, List<String> lore) {
ItemStack item = new ItemStack(material, amount, datavalue);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(color(name));
meta.setLore(colorList(lore));
item.setItemMeta(meta);
return item;
}
public ItemStack createLazyItem(Material material, int amount, short datavalue, String name, String lore) {
ItemStack item = new ItemStack(material, amount, datavalue);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(color(P.p.getConfig().getString(name)));
meta.setLore(colorList(P.p.getConfig().getStringList(lore)));
item.setItemMeta(meta);
return item;
}
public Economy getEcon() {
RegisteredServiceProvider<Economy> rsp = P.p.getServer().getServicesManager().getRegistration(Economy.class);
Economy econ = rsp.getProvider();
return econ;
}
@Override
public boolean logPlayerCommands() {
return Conf.logPlayerCommands;
@ -244,6 +292,24 @@ public class P extends MPlugin {
return handleCommand(sender, cmd + " " + TextUtil.implode(Arrays.asList(split), " "), false);
}
public void createTimedHologram(final Location location, String text, Long timeout){
ArmorStand as = (ArmorStand) location.add(0.5,1,0.5).getWorld().spawnEntity(location, EntityType.ARMOR_STAND); //Spawn the ArmorStand
as.setVisible(false); //Makes the ArmorStand invisible
as.setGravity(false); //Make sure it doesn't fall
as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it
as.setCustomName(P.p.color(text)); //Set this to the text you want
as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not
final ArmorStand armorStand = as;
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
@Override
public void run() {
Bukkit.broadcastMessage("removing stand");
armorStand.remove();
}
},timeout*20);
}
// -------------------------------------------- //
// Functions for other plugins to hook into
@ -336,6 +402,19 @@ public class P extends MPlugin {
return me.getTitle().trim();
}
public String color(String line) {
line = ChatColor.translateAlternateColorCodes('&', line);
return line;
}
//colors a string list
public List<String> colorList(List<String> lore) {
for (int i = 0; i <= lore.size()-1;i++){
lore.set(i,color(lore.get(i)));
}
return lore;
}
// Get a list of all faction tags (names)
public Set<String> getFactionTags() {
return Factions.getInstance().getFactionTags();

View File

@ -36,7 +36,10 @@ public class CmdAdmin extends FCommand {
if (fyou == null) {
return;
}
if (fme.getRole() == Role.ADMIN){
fme.msg(TL.COMMAND_ADMIN_NOTADMIN);
return;
}
boolean permAny = Permission.ADMIN_ANY.has(sender, false);
Faction targetFaction = fyou.getFaction();
@ -44,17 +47,20 @@ public class CmdAdmin extends FCommand {
msg(TL.COMMAND_ADMIN_NOTMEMBER, fyou.describeTo(fme, true));
return;
}
if ((fyou == fme && fme.getRole() == Role.COLEADER) || (fme.getRole() == Role.COLEADER && fyou.getRole() == Role.ADMIN)){
msg(TL.COMMAND_ADMIN_NOTADMIN);
return;
}
if (fme != null && fme.getRole() != Role.ADMIN && !permAny) {
msg(TL.COMMAND_ADMIN_NOTADMIN);
return;
}
if (fyou == fme && !permAny) {
msg(TL.COMMAND_ADMIN_TARGETSELF);
return;
}
// only perform a FPlayerJoinEvent when newLeader isn't actually in the faction
if (fyou.getFaction() != targetFaction) {
FPlayerJoinEvent event = new FPlayerJoinEvent(FPlayers.getInstance().getByPlayer(me), targetFaction, FPlayerJoinEvent.PlayerJoinReason.LEADER);
@ -64,19 +70,23 @@ public class CmdAdmin extends FCommand {
}
}
FPlayer admin = targetFaction.getFPlayerAdmin();
FPlayer admin = targetFaction.getFPlayerAdmin();
// if target player is currently admin, demote and replace him
if (fyou == admin && fyou.getFaction().getSize() == 1){
msg(TL.COMMAND_ADMIN_NOMEMBERS);
return;
}
if (fyou == admin) {
targetFaction.promoteNewLeader();
msg(TL.COMMAND_ADMIN_DEMOTES, fyou.describeTo(fme, true));
fyou.msg(TL.COMMAND_ADMIN_DEMOTED, senderIsConsole ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(fyou, true));
return;
}
// promote target player, and demote existing admin if one exists
if (admin != null) {
admin.setRole(Role.MODERATOR);
admin.setRole(Role.COLEADER);
}
fyou.setRole(Role.ADMIN);
msg(TL.COMMAND_ADMIN_PROMOTES, fyou.describeTo(fme, true));

View File

@ -22,7 +22,8 @@ public class CmdAnnounce extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = true;
senderMustBeModerator = false;
senderMustBeColeader = false;
}
@Override

View File

@ -27,6 +27,7 @@ public class CmdBan extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -42,6 +42,11 @@ public class CmdBanlist extends FCommand {
return;
}
if (target == null) {
sender.sendMessage(TL.COMMAND_BANLIST_INVALID.format(argAsString(0)));
return;
}
List<String> lines = new ArrayList<>();
lines.add(TL.COMMAND_BANLIST_HEADER.format(target.getBannedPlayers().size(), target.getTag(myFaction)));
int i = 1;

View File

@ -20,7 +20,8 @@ public class CmdBoom extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = true;
senderMustBeModerator = false;
senderMustBeColeader = true;
senderMustBeAdmin = false;
}

View File

@ -19,6 +19,7 @@ public class CmdBypass extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.Conf;
import com.massivecraft.factions.struct.ChatMode;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
public class CmdChat extends FCommand {
@ -21,6 +22,7 @@ public class CmdChat extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}
@ -36,7 +38,7 @@ public class CmdChat extends FCommand {
if (modeString != null) {
modeString = modeString.toLowerCase();
if (modeString.startsWith("m")) {
if (modeString.startsWith("m")){
modeTarget = ChatMode.MOD;
} else if (modeString.startsWith("p")) {
modeTarget = ChatMode.PUBLIC;
@ -54,9 +56,10 @@ public class CmdChat extends FCommand {
fme.setChatMode(modeTarget);
if (fme.getChatMode() == ChatMode.MOD) {
if (fme.getChatMode() == ChatMode.MOD)
{
msg(TL.COMMAND_CHAT_MODE_MOD);
} else if (fme.getChatMode() == ChatMode.PUBLIC) {
}else if (fme.getChatMode() == ChatMode.PUBLIC) {
msg(TL.COMMAND_CHAT_MODE_PUBLIC);
} else if (fme.getChatMode() == ChatMode.ALLIANCE) {
msg(TL.COMMAND_CHAT_MODE_ALLIANCE);

View File

@ -18,6 +18,7 @@ public class CmdChatSpy extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -24,6 +24,7 @@ public class CmdClaim extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -20,6 +20,7 @@ public class CmdClaimAt extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -28,6 +28,7 @@ public class CmdClaimLine extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -32,6 +32,7 @@ public class CmdConfig extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -27,6 +27,7 @@ public class CmdCreate extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}
@ -55,6 +56,13 @@ public class CmdCreate extends FCommand {
return;
}
// trigger the faction creation event (cancellable)
FactionCreateEvent createEvent = new FactionCreateEvent(me, tag);
Bukkit.getServer().getPluginManager().callEvent(createEvent);
if (createEvent.isCancelled()) {
return;
}
// then make 'em pay (if applicable)
if (!payForCommand(Conf.econCostCreate, TL.COMMAND_CREATE_TOCREATE, TL.COMMAND_CREATE_FORCREATE)) {
return;
@ -80,10 +88,6 @@ public class CmdCreate extends FCommand {
fme.setRole(Role.ADMIN);
fme.setFaction(faction);
// trigger the faction creation event
FactionCreateEvent createEvent = new FactionCreateEvent(me, tag, faction);
Bukkit.getServer().getPluginManager().callEvent(createEvent);
for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
follower.msg(TL.COMMAND_CREATE_CREATED, fme.describeTo(follower, true), faction.getTag(follower));
}

View File

@ -24,6 +24,7 @@ public class CmdDeinvite extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = true;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -23,7 +23,8 @@ public class CmdDescription extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = true;
senderMustBeModerator = false;
senderMustBeColeader = true;
senderMustBeAdmin = false;
}

View File

@ -26,6 +26,7 @@ public class CmdDisband extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -1,14 +1,25 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.*;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.util.Particle.ParticleEffect;
import com.massivecraft.factions.util.WarmUpUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import java.sql.BatchUpdateException;
import java.util.*;
public class CmdFly extends FCommand {
public static HashMap<String,Boolean> flyMap = new HashMap<String,Boolean>();
public int id = -1;
public int flyid = -1;
public CmdFly() {
super();
this.aliases.add("fly");
@ -22,28 +33,233 @@ public class CmdFly extends FCommand {
@Override
public void perform() {
// Disabled by default.
if (!P.p.getConfig().getBoolean("enable-faction-flight", false)) {
fme.msg(TL.COMMAND_FLY_DISABLED);
return;
}
FLocation myfloc = new FLocation(me.getLocation());
Faction toFac = Board.getInstance().getFactionAt(myfloc);
if (Board.getInstance().getFactionAt(myfloc) != fme.getFaction()){
if (!me.hasPermission("factions.fly.wilderness") && toFac.isWilderness()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
}
if (!me.hasPermission("factions.fly.safezone") && toFac.isSafeZone()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
}
if (!me.hasPermission("factions.fly.warzone") && toFac.isWarZone()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
}
if (!me.hasPermission("factions.fly.enemy") && toFac.getRelationTo(myFaction)== Relation.ENEMY){
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
}
if (!me.hasPermission("factions.fly.ally") && toFac.getRelationTo(myFaction)== Relation.ALLY){
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
}
if (!me.hasPermission("factions.fly.truce") && toFac.getRelationTo(myFaction)== Relation.TRUCE){
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
}
if (!me.hasPermission("factions.fly.neutral") && toFac.getRelationTo(myFaction) == Relation.NEUTRAL) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
}
}
List<Entity> entities = me.getNearbyEntities(16,256,16);
for (int i = 0; i <= entities.size() -1;i++)
{
if (entities.get(i) instanceof Player)
{
Player eplayer = (Player) entities.get(i);
FPlayer efplayer = FPlayers.getInstance().getByPlayer(eplayer);
if (efplayer.getRelationTo(fme) == Relation.ENEMY)
{
fme.msg(TL.COMMAND_FLY_CHECK_ENEMY);
return;
}
}
}
if (args.size() == 0) {
if (!fme.canFlyAtLocation() && !fme.isFlying()) {
Faction factionAtLocation = Board.getInstance().getFactionAt(fme.getLastStoodAt());
fme.msg(TL.COMMAND_FLY_NO_ACCESS, factionAtLocation.getTag(fme));
if (!me.hasPermission("factions.fly.wilderness") && toFac.isWilderness()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.safezone") && toFac.isSafeZone()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.warzone") && toFac.isWarZone()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.enemy") && toFac.getRelationTo(myFaction) == Relation.ENEMY) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.ally") && toFac.getRelationTo(myFaction) == Relation.ALLY) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.truce") && toFac.getRelationTo(myFaction) == Relation.TRUCE) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
} else if (!me.hasPermission("factions.fly.neutral") && toFac.getRelationTo(myFaction) == Relation.NEUTRAL) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
}
toggleFlight(!fme.isFlying());
}
toggleFlight(!fme.isFlying(),me);
} else if (args.size() == 1) {
if (!fme.canFlyAtLocation() && argAsBool(0)) {
Faction factionAtLocation = Board.getInstance().getFactionAt(fme.getLastStoodAt());
fme.msg(TL.COMMAND_FLY_NO_ACCESS, factionAtLocation.getTag(fme));
if (!me.hasPermission("factions.fly.wilderness") && toFac.isWilderness()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.safezone") && toFac.isSafeZone()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.warzone") && toFac.isWarZone()) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.enemy") && toFac.getRelationTo(myFaction) == Relation.ENEMY) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.ally") && toFac.getRelationTo(myFaction) == Relation.ALLY) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
return;
} else if (!me.hasPermission("factions.fly.truce") && toFac.getRelationTo(myFaction) == Relation.TRUCE) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
} else if (!me.hasPermission("factions.fly.neutral") && toFac.getRelationTo(myFaction) == Relation.NEUTRAL) {
fme.msg(TL.COMMAND_FLY_NO_ACCESS, Board.getInstance().getFactionAt(myfloc).getTag(fme));
}
toggleFlight(argAsBool(0));
}
toggleFlight(argAsBool(0),me);
}
}
private void toggleFlight(final boolean toggle) {
public boolean isInFlightChecker(Player player){
if (flyMap.containsKey(player.getName())){
return true;
} else {
return false;
}
}
public void startParticles(){
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
@Override
public void run() {
for(String name : flyMap.keySet()){
Player player = Bukkit.getPlayer(name);
if (player == null){
continue;
}
if (!player.isFlying()){
continue;
}
ParticleEffect.CLOUD.display((float) 0.1,(float) 0.1,(float) 0.1,(float) 0.1,3,player.getLocation(),32);
}
if (flyMap.keySet().size() == 0){
Bukkit.getScheduler().cancelTask(id);
id = -1;
}
}
},20L,40L);
}
public void startFlyCheck(){
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
@Override
public void run() {
for (String name : flyMap.keySet()) {
Player player = Bukkit.getPlayer(name);
if (player == null) { continue;}
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
if (fPlayer == null) { continue; }
if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR){
continue;
}
Faction myFaction = fPlayer.getFaction();
if (myFaction.isWilderness()){
fPlayer.setFlying(false);
flyMap.remove(name);
continue;
}
if(fPlayer.checkIfNearbyEnemies()){
continue;
}
FLocation myFloc = new FLocation(player.getLocation());
Faction toFac = Board.getInstance().getFactionAt(myFloc);
if (Board.getInstance().getFactionAt(myFloc) != myFaction) {
if (!checkBypassPerms(fPlayer,player,toFac)){
fPlayer.setFlying(false);
flyMap.remove(name);
continue;
}
}
checkTaskState();
}
}
},20L,20L);
}
private boolean checkBypassPerms(FPlayer fplayer, Player player,Faction toFac){
if (player.hasPermission("factions.fly.wilderness") && toFac.isWilderness()){
return true;
}
if (player.hasPermission("factions.fly.warzone") && toFac.isWarZone()){
return true;
}
if (player.hasPermission("factions.fly.safezone") && toFac.isSafeZone()){
return true;
}
if (player.hasPermission("factions.fly.enemy") && toFac.getRelationTo(fplayer.getFaction()) == Relation.ENEMY) {
return true;
}
if (player.hasPermission("factions.fly.ally") && toFac.getRelationTo(fplayer.getFaction()) == Relation.ALLY) {
return true;
}
if (player.hasPermission("factions.fly.truce") && toFac.getRelationTo(fplayer.getFaction()) == Relation.TRUCE) {
return true;
}
if (player.hasPermission("factions.fly.neutral") && toFac.getRelationTo(fplayer.getFaction()) == Relation.NEUTRAL) {
return true;
}
return false;
}
public void checkTaskState(){
if (flyMap.keySet().size() == 0) {
Bukkit.getScheduler().cancelTask(flyid);
flyid = -1;
}
}
private void toggleFlight(final boolean toggle, final Player player) {
if (!toggle) {
fme.setFlying(false);
flyMap.remove(player.getName());
return;
}
@ -51,6 +267,15 @@ public class CmdFly extends FCommand {
@Override
public void run() {
fme.setFlying(true);
flyMap.put(player.getName(),true);
if (id == -1){
if (P.p.getConfig().getBoolean("ffly.Particles.Enabled")){
startParticles();
}
}
if (flyid == -1){
startFlyCheck();
}
}
}, this.p.getConfig().getLong("warmups.f-fly", 0));
}

View File

@ -28,6 +28,7 @@ public class CmdHelp extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -31,6 +31,7 @@ public class CmdHome extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -26,6 +26,7 @@ public class CmdInvite extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -21,6 +21,7 @@ public class CmdJoin extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -29,6 +29,7 @@ public class CmdKick extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}
@ -65,6 +66,11 @@ public class CmdKick extends FCommand {
return;
}
if ((fme.getRole() == Role.MODERATOR || fme.getRole() == Role.COLEADER) && toKick.getRole() == Role.ADMIN){
msg(TL.COMMAND_KICK_INSUFFICIENTRANK);
return;
}
// players with admin-level "disband" permission can bypass these requirements
if (!Permission.KICK_ANY.has(sender)) {

View File

@ -18,6 +18,7 @@ public class CmdLeave extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -34,6 +34,7 @@ public class CmdList extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}
@ -50,7 +51,7 @@ public class CmdList extends FCommand {
factionList.remove(Factions.getInstance().getWarZone());
// remove exempt factions
if (!sender.hasPermission("factions.show.bypassexempt")) {
if (!fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
List<String> exemptFactions = P.p.getConfig().getStringList("show-exempt");
Iterator<Faction> factionIterator = factionList.iterator();
while (factionIterator.hasNext()) {

View File

@ -25,6 +25,7 @@ public class CmdLock extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -22,6 +22,7 @@ public class CmdMap extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -27,7 +27,8 @@ public class CmdMod extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = true;
senderMustBeModerator = false;
senderMustBeAdmin = true;
senderMustBeColeader = true;
senderMustBeAdmin = false;
}
@Override

View File

@ -23,6 +23,7 @@ public class CmdModifyPower extends FCommand {
this.senderMustBeAdmin = false;
this.senderMustBePlayer = false;
this.senderMustBeMember = false;
senderMustBeColeader = false;
this.senderMustBeModerator = false;
}

View File

@ -24,6 +24,7 @@ public class CmdMoney extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
this.helpLong.add(p.txt.parseTags(TL.COMMAND_MONEY_LONG.toString()));

View File

@ -1,5 +1,6 @@
package com.massivecraft.factions.cmd;
import com.earth2me.essentials.Console;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
@ -38,8 +39,10 @@ public class CmdMoneyBalance extends FCommand {
return;
}
if (fme != null) {
Econ.sendBalanceInfo(fme, faction);
}
}
@Override
public TL getUsageTranslation() {

View File

@ -24,6 +24,7 @@ public class CmdMoneyDeposit extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -26,6 +26,7 @@ public class CmdMoneyTransferFf extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -25,6 +25,7 @@ public class CmdMoneyTransferFp extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -25,6 +25,7 @@ public class CmdMoneyTransferPf extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -25,6 +25,7 @@ public class CmdMoneyWithdraw extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -20,7 +20,8 @@ public class CmdOpen extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = true;
senderMustBeModerator = false;
senderMustBeColeader = true;
senderMustBeAdmin = false;
}

View File

@ -21,6 +21,7 @@ public class CmdOwner extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -22,6 +22,7 @@ public class CmdOwnerList extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -21,6 +21,7 @@ public class CmdPeaceful extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -28,12 +28,13 @@ public class CmdPerm extends FCommand {
this.optionalArgs.put("action", "action");
this.optionalArgs.put("access", "access");
this.permission = Permission.PERMISSIONS.node;
this.disableOnLock = true;
senderMustBePlayer = true;
senderMustBeMember = true;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = true;
}

View File

@ -23,6 +23,7 @@ public class CmdPermanent extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -19,6 +19,7 @@ public class CmdPermanentPower extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -21,6 +21,7 @@ public class CmdPower extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -22,6 +22,7 @@ public class CmdPowerBoost extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -17,6 +17,7 @@ public class CmdReload extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -24,6 +24,7 @@ public class CmdSafeunclaimall extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -23,6 +23,7 @@ public class CmdSaveAll extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -1,5 +1,6 @@
package com.massivecraft.factions.cmd;
import com.darkblade12.particleeffect.ParticleEffect;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.VisualizeUtil;
@ -9,8 +10,14 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.logging.Level;
public class CmdSeeChunk extends FCommand {
private boolean useParticles;
private int length;
private ParticleEffect effect;
public CmdSeeChunk() {
super();
aliases.add("seechunk");
@ -22,6 +29,16 @@ public class CmdSeeChunk extends FCommand {
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeAdmin = false;
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
this.length = p.getConfig().getInt("see-chunk.length", 10);
String effectName = p.getConfig().getString("see-chunk.particle", "BARRIER");
this.effect = ParticleEffect.fromName(effectName.toUpperCase());
if (this.effect == null) {
this.effect = ParticleEffect.BARRIER;
}
p.log(Level.INFO, "Using %s as the ParticleEffect for /f sc", effect.getName());
}
@Override
@ -51,17 +68,21 @@ public class CmdSeeChunk extends FCommand {
showPillar(me, world, blockX, blockZ);
}
@SuppressWarnings("deprecation")
public static void showPillar(Player player, World world, int blockX, int blockZ) {
private void showPillar(Player player, World world, int blockX, int blockZ) {
for (int blockY = 0; blockY < player.getLocation().getBlockY() + 30; blockY++) {
Location loc = new Location(world, blockX, blockY, blockZ);
if (loc.getBlock().getType() != Material.AIR) {
continue;
}
if (useParticles) {
this.effect.display(0, 0, 0, 10, 1, loc, player);
} else {
int typeId = blockY % 5 == 0 ? Material.REDSTONE_LAMP_ON.getId() : Material.STAINED_GLASS.getId();
VisualizeUtil.addLocation(player, loc, typeId);
}
}
}
@Override
public TL getUsageTranslation() {

View File

@ -17,6 +17,7 @@ public class CmdSetDefaultRole extends FCommand {
this.senderMustBeAdmin = true;
this.senderMustBePlayer = true;
senderMustBeColeader = false;
this.permission = Permission.DEFAULTRANK.node;
}

View File

@ -20,6 +20,7 @@ public class CmdSetMaxVaults extends FCommand {
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -24,6 +24,7 @@ public class CmdSethome extends FCommand {
senderMustBePlayer = true;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}

View File

@ -1,13 +1,13 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.P;
import com.massivecraft.factions.*;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TagReplacer;
import com.massivecraft.factions.zcore.util.TagUtil;
import mkremins.fanciful.FancyMessage;
import org.bukkit.Bukkit;
import java.util.ArrayList;
import java.util.List;
@ -19,6 +19,7 @@ public class CmdShow extends FCommand {
public CmdShow() {
this.aliases.add("show");
this.aliases.add("who");
this.aliases.add("f");
// add defaults to /f show in case config doesnt have it
defaults.add("{header}");
@ -47,6 +48,7 @@ public class CmdShow extends FCommand {
@Override
public void perform() {
Faction faction = myFaction;
if (this.argIsSet(0)) {
faction = this.argAsFaction(0);
}
@ -54,6 +56,11 @@ public class CmdShow extends FCommand {
return;
}
if (!fme.hasFaction() && fme.getFaction() == faction){
fme.msg(TL.COMMAND_SHOW_NEEDFACTION);
return;
}
if (fme != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")
&& P.p.getConfig().getStringList("show-exempt").contains(faction.getTag())) {
msg(TL.COMMAND_SHOW_EXEMPT);
@ -69,6 +76,65 @@ public class CmdShow extends FCommand {
if (show == null || show.isEmpty()) {
show = defaults;
}
/* for (int i = 0; i <= show.size()-1; i ++){
if (show.get(i).contains("{description}")){
show.set(i,show.get(i).replace("{description}",faction.getDescription()));
}
if (show.get(i).contains("{online-list}")){
String message = "";
StringBuilder string = new StringBuilder(message);
for (FPlayer fPlayer : faction.getFPlayers()){
Bukkit.broadcastMessage(fPlayer.getTag());
if (fPlayer.getPlayer().isOnline()){
String prefix = "";
if (fPlayer.getRole() == Role.ADMIN){
prefix = Conf.prefixAdmin;
}
if (fPlayer.getRole() == Role.COLEADER){
prefix = Conf.prefixCoLeader;
}
if (fPlayer.getRole() == Role.MODERATOR){
prefix = Conf.prefixMod;
}
if (fPlayer.getRole() == Role.NORMAL){
prefix = Conf.prefixNormal;
}
if (fPlayer.getRole() == Role.RECRUIT){
prefix = Conf.prefixRecruit;
}
string.append(prefix + fPlayer.getName() + ",");
}
if (string.toString().equals("")) { continue; }
show.set(i,show.get(i).replace("{online-list}",string.toString()));
}
}
if (show.get(i).contains("{offline-list}")){
String message = "";
StringBuilder string = new StringBuilder(message);
for (FPlayer fPlayer : faction.getFPlayers()){
if (!fPlayer.getPlayer().isOnline()){
String prefix = "";
if (fPlayer.getRole() == Role.ADMIN){
prefix = Conf.prefixAdmin;
}
if (fPlayer.getRole() == Role.COLEADER){
prefix = Conf.prefixCoLeader;
}
if (fPlayer.getRole() == Role.MODERATOR){
prefix = Conf.prefixMod;
}
if (fPlayer.getRole() == Role.NORMAL){
prefix = Conf.prefixNormal;
}
if (fPlayer.getRole() == Role.RECRUIT){
prefix = Conf.prefixRecruit;
}
string.append(prefix + fPlayer.getName() + ",");
}
show.set(i,show.get(i).replace("{offline-list}",string.toString()));
}
}
}*/
if (!faction.isNormal()) {
String tag = faction.getTag(fme);
@ -88,11 +154,9 @@ public class CmdShow extends FCommand {
continue; // Due to minimal f show.
}
if (fme != null) {
parsed = TagUtil.parsePlaceholders(fme.getPlayer(), parsed);
}
if (fme != null && TagUtil.hasFancy(parsed)) {
if (TagUtil.hasFancy(parsed)) {
List<FancyMessage> fancy = TagUtil.parseFancy(faction, fme, parsed);
if (fancy != null) {
sendFancyMessage(fancy);

View File

@ -5,11 +5,20 @@ import com.drtshock.playervaults.translations.Lang;
import com.drtshock.playervaults.vaultmanagement.UUIDVaultManager;
import com.drtshock.playervaults.vaultmanagement.VaultOperations;
import com.drtshock.playervaults.vaultmanagement.VaultViewInfo;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Chest;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.inventory.Inventory;
public class CmdVault extends FCommand {
@ -17,7 +26,7 @@ public class CmdVault extends FCommand {
this.aliases.add("vault");
//this.requiredArgs.add("");
this.optionalArgs.put("number", "number");
this.permission = Permission.VAULT.node;
this.disableOnLock = false;
@ -30,49 +39,39 @@ public class CmdVault extends FCommand {
@Override
public void perform() {
/*
/f vault <number>
*/
int number = argAsInt(0, 0); // Default to 0 or show on 0
Player player = me;
if (PlayerVaults.getInstance().getInVault().containsKey(player.getUniqueId().toString())) {
return; // Already in a vault so they must be trying to dupe.
}
int max = myFaction.getMaxVaults();
if (number > max) {
me.sendMessage(TL.COMMAND_VAULT_TOOHIGH.format(number, max));
if (!P.p.getConfig().getBoolean("fvault.Enabled")){
fme.sendMessage("This command is disabled!");
return;
}
// Something like faction-id
String vaultName = String.format(Conf.vaultPrefix, myFaction.getId());
if (number < 1) {
// Message about which vaults that Faction has.
// List the target
YamlConfiguration file = UUIDVaultManager.getInstance().getPlayerVaultFile(vaultName);
if (file == null) {
sender.sendMessage(Lang.TITLE.toString() + Lang.VAULT_DOES_NOT_EXIST.toString());
} else {
StringBuilder sb = new StringBuilder();
for (String key : file.getKeys(false)) {
sb.append(key.replace("vault", "")).append(" ");
}
sender.sendMessage(Lang.TITLE.toString() + Lang.EXISTING_VAULTS.toString().replaceAll("%p", fme.getTag()).replaceAll("%v", sb.toString().trim()));
}
if (fme.isInVault()){
me.closeInventory();
return;
} // end listing vaults.
// Attempt to open vault.
if (VaultOperations.openOtherVault(player, null, String.valueOf(number))) {
// Success
PlayerVaults.getInstance().getInVault().put(player.getUniqueId().toString(), new VaultViewInfo(vaultName, number));
}
fme.setInVault(true);
Location vaultLocation = fme.getFaction().getVault();
if (vaultLocation == null){
fme.msg(TL.COMMAND_VAULT_INVALID);
return;
}
FLocation vaultFLocation = new FLocation(vaultLocation);
if (Board.getInstance().getFactionAt(vaultFLocation) != fme.getFaction()){
fme.getFaction().setVault(null);
fme.msg(TL.COMMAND_VAULT_INVALID);
return;
}
if (vaultLocation.getBlock().getType() != Material.CHEST){
fme.getFaction().setVault(null);
fme.msg(TL.COMMAND_VAULT_INVALID);
return;
}
Chest chest = (Chest) vaultLocation.getBlock().getState();
Inventory chestInv = chest.getBlockInventory();
fme.msg(TL.COMMAND_VAULT_OPENING);
me.openInventory(chestInv);
}
@Override

View File

@ -22,7 +22,6 @@ public class FCmdRoot extends FCommand {
public CmdDeinvite cmdDeinvite = new CmdDeinvite();
public CmdDescription cmdDescription = new CmdDescription();
public CmdDisband cmdDisband = new CmdDisband();
public CmdFly cmdFly = new CmdFly();
public CmdHelp cmdHelp = new CmdHelp();
public CmdHome cmdHome = new CmdHome();
public CmdInvite cmdInvite = new CmdInvite();
@ -82,7 +81,18 @@ public class FCmdRoot extends FCommand {
public CmdBan cmdban = new CmdBan();
public CmdUnban cmdUnban = new CmdUnban();
public CmdBanlist cmdbanlist = new CmdBanlist();
public CmdRules cmdRules = new CmdRules();
public CmdCheckpoint cmdCheckpoint = new CmdCheckpoint();
public CmdTnt cmdTnt = new CmdTnt();
public CmdNear cmdNear = new CmdNear();
public CmdUpgrades cmdUpgrades = new CmdUpgrades();
public CmdVault cmdVault = new CmdVault();
public CmdGetVault cmdGetVault = new CmdGetVault();
public CmdFly cmdFly = new CmdFly();
public CmdColeader cmdColeader = new CmdColeader();
public CmdBanner cmdBanner = new CmdBanner();
public CmdTpBanner cmdTpBanner = new CmdTpBanner();
public CmdKillHolograms cmdKillHolograms = new CmdKillHolograms();
public FCmdRoot() {
super();
this.aliases.addAll(Conf.baseCommandAliases);
@ -117,6 +127,7 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdDeinvite);
this.addSubCommand(this.cmdDescription);
this.addSubCommand(this.cmdDisband);
this.addSubCommand(this.cmdHelp);
this.addSubCommand(this.cmdHome);
this.addSubCommand(this.cmdInvite);
@ -174,6 +185,24 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdban);
this.addSubCommand(this.cmdUnban);
this.addSubCommand(this.cmdbanlist);
this.addSubCommand(this.cmdRules);
this.addSubCommand(this.cmdCheckpoint);
this.addSubCommand(this.cmdTnt);
this.addSubCommand(this.cmdNear);
this.addSubCommand(this.cmdUpgrades);
this.addSubCommand(this.cmdVault);
this.addSubCommand(this.cmdGetVault);
this.addSubCommand(this.cmdColeader);
this.addSubCommand(this.cmdBanner);
this.addSubCommand(this.cmdTpBanner);
this.addSubCommand(this.cmdKillHolograms);
if (P.p.getConfig().getBoolean("enable-faction-flight", false)) {
this.addSubCommand(this.cmdFly);
return;
}
if (Bukkit.getServer().getPluginManager().isPluginEnabled("FactionsTop")) {
P.p.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
} else {
@ -181,17 +210,11 @@ public class FCmdRoot extends FCommand {
}
if (P.p.isHookedPlayervaults()) {
P.p.log("Found playervaults hook, adding /f vault and /f setmaxvault commands.");
this.addSubCommand(new CmdSetMaxVaults());
this.addSubCommand(new CmdVault());
// this.addSubCommand(new CmdSetMaxVaults());
// this.addSubCommand(new CmdVault());
}else{
// this.addSubCommand(new CmdVault());
}
if (P.p.getConfig().getBoolean("enable-faction-flight", false)) {
this.addSubCommand(this.cmdFly);
P.p.log(Level.INFO, "Enabling /f fly command");
} else {
P.p.log(Level.WARNING, "Faction flight set to false in config.yml. Not enabling /f fly command.");
}
}
@Override

View File

@ -24,6 +24,7 @@ public abstract class FCommand extends MCommand<P> {
public boolean senderMustBeMember;
public boolean senderMustBeModerator;
public boolean senderMustBeAdmin;
public boolean senderMustBeColeader;
public boolean isMoneyCommand;
@ -38,6 +39,7 @@ public abstract class FCommand extends MCommand<P> {
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeColeader = false;
senderMustBeAdmin = false;
}
@ -80,7 +82,7 @@ public abstract class FCommand extends MCommand<P> {
return false;
}
if (!(this.senderMustBeMember || this.senderMustBeModerator || this.senderMustBeAdmin)) {
if (!(this.senderMustBeMember || this.senderMustBeModerator || this.senderMustBeAdmin || this.senderMustBeColeader)) {
return true;
}
@ -98,11 +100,18 @@ public abstract class FCommand extends MCommand<P> {
return false;
}
if (this.senderMustBeColeader && !fme.getRole().isAtLeast(Role.COLEADER)){
sender.sendMessage(p.txt.parse("<b>Only faction coleaders can %s.", this.getHelpShort()));
return false;
}
if (this.senderMustBeAdmin && !fme.getRole().isAtLeast(Role.ADMIN)) {
sender.sendMessage(p.txt.parse("<b>Only faction admins can %s.", this.getHelpShort()));
return false;
}
return true;
}
@ -257,8 +266,19 @@ public abstract class FCommand extends MCommand<P> {
return true;
}
if (you.getRole().equals(Role.ADMIN)) {
if (you.getRole().equals(Role.ADMIN))
{
i.sendMessage(p.txt.parse("<b>Only the faction admin can do that."));
}
else if ((you.getRole().equals(Role.COLEADER)))
{
if (i == you){
return true;
} else {
i.sendMessage(p.txt.parse("<b>Coleaders can't control each other..."));
}
} else if (i.getRole().equals(Role.MODERATOR)) {
if (i == you) {
return true; //Moderators can control themselves

View File

@ -6,6 +6,7 @@ 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;
import org.bukkit.Bukkit;
public class FPromoteCommand extends FCommand {
@ -27,22 +28,30 @@ public class FPromoteCommand extends FCommand {
@Override
public void perform() {
FPlayer target = this.argAsBestFPlayerMatch(0);
if (target == null) {
msg(TL.GENERIC_NOPLAYERFOUND, this.argAsString(0));
return;
}
if (!target.getFaction().equals(myFaction)) {
msg(TL.COMMAND_PROMOTE_WRONGFACTION, target.getName());
return;
}
Access access = myFaction.getAccess(fme.getRole(), PermissableAction.PROMOTE);
if (fme.getRole() == Role.COLEADER && target.getRole() == Role.ADMIN){
fme.msg(TL.COMMAND_PROMOTE_COLEADER_ADMIN);
return;
}
// Well this is messy.
if (access == null || access == Access.UNDEFINED) {
if (!assertMinRole(Role.MODERATOR)) {
if (!assertMinRole(Role.COLEADER)) {
return;
}
} else if (access == Access.DENY) {
@ -50,6 +59,8 @@ public class FPromoteCommand extends FCommand {
return;
}
Role current = target.getRole();
Role promotion = Role.getRelative(current, +relative);
if (promotion == null) {
@ -57,8 +68,14 @@ public class FPromoteCommand extends FCommand {
return;
}
if (fme == target && fme.getRole() == Role.COLEADER){
fme.msg(TL.COMMAND_PROMOTE_COLEADER_ADMIN);
return;
}
String action = relative > 0 ? TL.COMMAND_PROMOTE_PROMOTED.toString() : TL.COMMAND_PROMOTE_DEMOTED.toString();
// Success!
target.setRole(promotion);
if (target.isOnline()) {

View File

@ -2,7 +2,6 @@ package com.massivecraft.factions.event;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
@ -11,34 +10,28 @@ import org.bukkit.event.HandlerList;
/**
* Event called when a Faction is created.
*/
public class FactionCreateEvent extends Event {
public class FactionCreateEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final String factionTag;
private final Player sender;
private final Faction faction;
private String factionTag;
private Player sender;
private boolean cancelled;
public FactionCreateEvent(Player sender, String tag, Faction faction) {
public FactionCreateEvent(Player sender, String tag) {
this.factionTag = tag;
this.sender = sender;
this.faction = faction;
this.cancelled = false;
}
public FPlayer getFPlayer() {
return FPlayers.getInstance().getByPlayer(sender);
}
@Deprecated
public String getFactionTag() {
return factionTag;
}
public Faction getFaction() {
return this.faction;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@ -47,4 +40,13 @@ public class FactionCreateEvent extends Event {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean c) {
this.cancelled = c;
}
}

View File

@ -14,14 +14,11 @@ public class Essentials {
private static IEssentials essentials;
public static IEssentials setup() {
public static void setup() {
Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials");
if (ess != null) {
essentials = (IEssentials) ess;
return essentials;
}
return null;
}
// return false if feature is disabled or Essentials isn't available

View File

@ -4,6 +4,8 @@ import com.massivecraft.factions.*;
import com.massivecraft.factions.struct.ChatMode;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.WarmUpUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@ -30,6 +32,20 @@ public class FactionsChatListener implements Listener {
String msg = event.getMessage();
FPlayer me = FPlayers.getInstance().getByPlayer(talkingPlayer);
ChatMode chat = me.getChatMode();
// Is the player entering a password for a warp?
if (me.isEnteringPassword()) {
event.setCancelled(true);
me.sendMessage(ChatColor.DARK_GRAY + event.getMessage().replaceAll("(?s).", "*"));
if (me.getFaction().isWarpPassword(me.getEnteringWarp(), event.getMessage())) {
doWarmup(me.getEnteringWarp(), me);
} else {
// Invalid Password
me.msg(TL.COMMAND_FWARP_INVALID_PASSWORD);
}
me.setEnteringPassword(false, "");
return;
}
//Is it a MOD chat
if (chat == ChatMode.MOD) {
Faction myFaction = me.getFaction();
@ -119,7 +135,7 @@ public class FactionsChatListener implements Listener {
String msg = event.getMessage();
String eventFormat = event.getFormat();
FPlayer me = FPlayers.getInstance().getByPlayer(talkingPlayer);
int InsertIndex = Conf.chatTagInsertIndex;
int InsertIndex;
if (!Conf.chatTagReplaceString.isEmpty() && eventFormat.contains(Conf.chatTagReplaceString)) {
// we're using the "replace" method of inserting the faction tags
@ -136,9 +152,13 @@ public class FactionsChatListener implements Listener {
} else if (!Conf.chatTagInsertBeforeString.isEmpty() && eventFormat.contains(Conf.chatTagInsertBeforeString)) {
// we're using the "insert before string" method
InsertIndex = eventFormat.indexOf(Conf.chatTagInsertBeforeString);
} else if (!Conf.alwaysShowChatTag){
} else {
// we'll fall back to using the index place method
InsertIndex = Conf.chatTagInsertIndex;
if (InsertIndex > eventFormat.length()) {
return;
}
}
String formatStart = eventFormat.substring(0, InsertIndex) + ((Conf.chatTagPadBefore && !me.getChatTag().isEmpty()) ? " " : "");
String formatEnd = ((Conf.chatTagPadAfter && !me.getChatTag().isEmpty()) ? " " : "") + eventFormat.substring(InsertIndex);
@ -173,4 +193,18 @@ public class FactionsChatListener implements Listener {
event.setFormat(nonColoredMsgFormat);
}
}
private void doWarmup(final String warp, final FPlayer fme) {
WarmUpUtil.process(fme, WarmUpUtil.Warmup.WARP, TL.WARMUPS_NOTIFY_TELEPORT, warp, new Runnable() {
@Override
public void run() {
Player player = Bukkit.getPlayer(fme.getPlayer().getUniqueId());
if (player != null) {
player.teleport(fme.getFaction().getWarp(warp).getLocation());
fme.msg(TL.COMMAND_FWARP_WARPED, warp);
}
}
}, P.p.getConfig().getLong("warmups.f-warp", 0));
}
}

View File

@ -567,6 +567,43 @@ public class FactionsEntityListener implements Listener {
}
}
@EventHandler
public void onHit(EntityDamageByEntityEvent e) {
if (e.getDamager() instanceof Player) {
if (e.getEntity() instanceof Player) {
Player victim = (Player) e.getEntity();
Player attacker = (Player) e.getDamager();
FPlayer fvictim = FPlayers.getInstance().getByPlayer(victim);
FPlayer fattacker = FPlayers.getInstance().getByPlayer(attacker);
if (fattacker.getRelationTo(fvictim) == Relation.TRUCE) {
fattacker.msg(TL.PLAYER_PVP_CANTHURT, fvictim.describeTo(fattacker));
e.setCancelled(true);
}
}
}
}
@EventHandler
public void onBowHit(EntityDamageByEntityEvent e){
if (e.getDamager() instanceof Projectile){
if (e.getEntity() instanceof Player){
Player damager = (Player) ((Projectile) e.getDamager()).getShooter();
Player victim = (Player) e.getEntity();
FPlayer fdamager = FPlayers.getInstance().getByPlayer(damager);
FPlayer fvictim = FPlayers.getInstance().getByPlayer(victim);
if (fvictim.getRelationTo(fdamager) == Relation.TRUCE){
fdamager.msg(TL.PLAYER_PVP_CANTHURT, fvictim.describeTo(fdamager));
e.setCancelled(true);
}
if (fvictim.getRelationTo(fdamager) == Relation.ENEMY) {
if (fvictim.isFlying()) {
fvictim.setFFlying(false, true);
}
}
}
}
}
private boolean stopEndermanBlockManipulation(Location loc) {
if (loc == null) {
return false;

View File

@ -1,6 +1,8 @@
package com.massivecraft.factions.listeners;
import com.massivecraft.factions.*;
import com.massivecraft.factions.cmd.CmdFly;
import com.massivecraft.factions.event.FPlayerEnteredFactionEvent;
import com.massivecraft.factions.event.FPlayerJoinEvent;
import com.massivecraft.factions.event.FPlayerLeaveEvent;
import com.massivecraft.factions.scoreboards.FScoreboard;
@ -9,31 +11,35 @@ import com.massivecraft.factions.scoreboards.sidebar.FDefaultSidebar;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.FactionGUI;
import com.massivecraft.factions.util.Particle.ParticleEffect;
import com.massivecraft.factions.util.VisualizeUtil;
import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.PermissableAction;
import com.massivecraft.factions.util.FactionGUI;
import com.massivecraft.factions.zcore.persist.MemoryFPlayer;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TextUtil;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import com.sun.org.apache.xerces.internal.xs.StringList;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
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.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.NumberConversions;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import java.util.logging.Level;
public class FactionsPlayerListener implements Listener {
@ -47,6 +53,52 @@ public class FactionsPlayerListener implements Listener {
}
}
@EventHandler
public void onVaultPlace(BlockPlaceEvent e) {
if (e.getItemInHand().getType() == Material.CHEST) {
ItemStack vault = P.p.createItem(Material.CHEST, 1, (short) 0, P.p.color(P.p.getConfig().getString("fvault.Item.Name")), P.p.colorList(P.p.getConfig().getStringList("fvault.Item.Lore")));
if (e.getItemInHand().equals(vault)) {
FPlayer fme = FPlayers.getInstance().getByPlayer(e.getPlayer());
if (fme.getFaction().getVault() != null) {
fme.msg(TL.COMMAND_GETVAULT_ALREADYSET);
e.setCancelled(true);
return;
}
FLocation flocation = new FLocation(e.getBlockPlaced().getLocation());
if (Board.getInstance().getFactionAt(flocation) != fme.getFaction()) {
fme.msg(TL.COMMAND_GETVAULT_INVALIDLOCATION);
e.setCancelled(true);
return;
}
Block start = e.getBlockPlaced();
int radius = 1;
for (double x = start.getLocation().getX() - radius; x <= start.getLocation().getX() + radius; x++) {
for (double y = start.getLocation().getY() - radius; y <= start.getLocation().getY() + radius; y++) {
for (double z = start.getLocation().getZ() - radius; z <= start.getLocation().getZ() + radius; z++) {
Location blockLoc = new Location(e.getPlayer().getWorld(), x, y, z);
if (blockLoc.getX() == start.getLocation().getX() && blockLoc.getY() == start.getLocation().getY() && blockLoc.getZ() == start.getLocation().getZ()) {
continue;
}
if (blockLoc.getBlock().getType() == Material.CHEST) {
e.setCancelled(true);
fme.msg(TL.COMMAND_GETVAULT_CHESTNEAR);
return;
}
}
}
}
fme.msg(TL.COMMAND_GETVAULT_SUCCESS);
fme.getFaction().setVault(e.getBlockPlaced().getLocation());
}
}
}
HashMap<Player, Boolean> fallMap = new HashMap<>();
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerJoin(PlayerJoinEvent event) {
initPlayer(event.getPlayer());
@ -90,6 +142,18 @@ public class FactionsPlayerListener implements Listener {
}
}
fallMap.put(me.getPlayer(), false);
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
@Override
public void run() {
if (fallMap.containsKey(me.getPlayer())) {
fallMap.remove(me.getPlayer());
}
}
}, 180L);
if (me.isSpyingChat() && !player.hasPermission(Permission.CHATSPY.node)) {
me.setSpyingChat(false);
P.p.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName());
@ -100,11 +164,26 @@ public class FactionsPlayerListener implements Listener {
P.p.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName());
}
// If they have the permission, don't let them autoleave. Bad inverted setter :\
me.setAutoLeave(!player.hasPermission(Permission.AUTO_LEAVE_BYPASS.node));
me.setTakeFallDamage(true);
}
@EventHandler
public void onPlayerFall(EntityDamageEvent e) {
if (e.getEntity() instanceof Player) {
if (e.getCause() == EntityDamageEvent.DamageCause.FALL) {
Player player = (Player) e.getEntity();
if (fallMap.containsKey(player)) {
e.setCancelled(true);
fallMap.remove(player);
}
}
}
}
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerQuit(PlayerQuitEvent event) {
FPlayer me = FPlayers.getInstance().getByPlayer(event.getPlayer());
@ -139,6 +218,18 @@ public class FactionsPlayerListener implements Listener {
FScoreboard.remove(me);
}
public String parseAllPlaceholders(String string, Faction faction) {
string = string.replace("{Faction}", faction.getTag())
.replace("{online}", faction.getOnlinePlayers().size() + "")
.replace("{offline}", faction.getFPlayers().size() - faction.getOnlinePlayers().size() + "")
.replace("{chunks}", faction.getAllClaims().size() + "")
.replace("{power}", faction.getPower() + "")
.replace("{leader}", faction.getFPlayerAdmin() + "");
return string;
}
// Holds the next time a player can have a map shown.
private HashMap<UUID, Long> showTimes = new HashMap<>();
@ -177,12 +268,36 @@ public class FactionsPlayerListener implements Listener {
Faction factionFrom = Board.getInstance().getFactionAt(from);
Faction factionTo = Board.getInstance().getFactionAt(to);
boolean changedFaction = (factionFrom != factionTo);
if (changedFaction) {
Bukkit.getServer().getPluginManager().callEvent(new FPlayerEnteredFactionEvent(factionTo,factionFrom,me));
if (P.p.getConfig().getBoolean("Title.Show-Title")) {
String title = P.p.getConfig().getString("Title.Format.Title");
title = title.replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
title = parseAllPlaceholders(title, factionTo);
String subTitle = P.p.getConfig().getString("Title.Format.Subtitle").replace("{Description}", factionTo.getDescription()).replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag());
subTitle = parseAllPlaceholders(subTitle, factionTo);
me.getPlayer().sendTitle(P.p.color(title), P.p.color(subTitle));
}
// enable fly :)
if (me.hasFaction()) {
if (factionTo == me.getFaction()) {
if (P.p.getConfig().getBoolean("ffly.AutoEnable")) {
CmdFly Fly = new CmdFly();
me.setFlying(true);
Fly.flyMap.put(player.getName(), true);
if (Fly.id == -1) {
if (P.p.getConfig().getBoolean("ffly.Particles.Enabled")) {
Fly.startParticles();
}
}
if (Fly.flyid == -1) {
Fly.startFlyCheck();
}
}
}
}
}
if (p.getConfig().getBoolean("enable-faction-flight", false) && changedFaction) {
if (!me.canFlyAtLocation() && me.isFlying()) {
me.setFlying(false);
}
}
if (me.isMapAutoUpdating()) {
if (showTimes.containsKey(player.getUniqueId()) && (showTimes.get(player.getUniqueId()) > System.currentTimeMillis())) {
@ -237,6 +352,117 @@ public class FactionsPlayerListener implements Listener {
}
}
@EventHandler
public void onClose(InventoryCloseEvent e) {
FPlayer fme = FPlayers.getInstance().getById(e.getPlayer().getUniqueId().toString());
if (fme.isInVault()) {
fme.setInVault(false);
}
}
HashMap<String,Boolean> bannerCooldownMap = new HashMap<>();
public static HashMap<String,Location> bannerLocations = new HashMap<>();
@EventHandler
public void onBannerPlace(BlockPlaceEvent e){
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());
if (fme.getFaction().isWilderness()){
fme.msg(TL.WARBANNER_NOFACTION);
e.setCancelled(true);
return;
}
int bannerTime = P.p.getConfig().getInt("fbanners.Banner-Time")*20;
Location placedLoc = e.getBlockPlaced().getLocation();
FLocation fplacedLoc = new FLocation(placedLoc);
if (Board.getInstance().getFactionAt(fplacedLoc).isWarZone() || fme.getFaction().getRelationTo(Board.getInstance().getFactionAt(fplacedLoc)) == Relation.ENEMY){
if (bannerCooldownMap.containsKey(fme.getTag())){
fme.msg(TL.WARBANNER_COOLDOWN);
e.setCancelled(true);
return;
}
for (FPlayer fplayer : fme.getFaction().getFPlayers()){
// if (fplayer == fme) { continue; } //Idk if I wanna not send the title to the player
fplayer.getPlayer().sendTitle(P.p.color(fme.getTag() + " Placed A WarBanner!"),P.p.color("&7use &c/f tpbanner&7 to tp to the banner!"));
}
bannerCooldownMap.put(fme.getTag(),true);
bannerLocations.put(fme.getTag(),e.getBlockPlaced().getLocation());
int bannerCooldown = P.p.getConfig().getInt("fbanners.Banner-Place-Cooldown");
final ArmorStand as = (ArmorStand) e.getBlockPlaced().getLocation().add(0.5,1,0.5).getWorld().spawnEntity(e.getBlockPlaced().getLocation().add(0.5,1,0.5), EntityType.ARMOR_STAND); //Spawn the ArmorStand
as.setVisible(false); //Makes the ArmorStand invisible
as.setGravity(false); //Make sure it doesn't fall
as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it
as.setCustomName(P.p.color(P.p.getConfig().getString("fbanners.BannerHolo").replace("{Faction}",fme.getTag()))); //Set this to the text you want
as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not
final ArmorStand armorStand = as;
final String tag = fme.getTag();
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
@Override
public void run() {
bannerCooldownMap.remove(tag);
}
}, Long.parseLong(bannerCooldown + ""));
final Block banner = e.getBlockPlaced();
final Material bannerType = banner.getType();
final Faction bannerFaction = fme.getFaction();
banner.getWorld().strikeLightningEffect(banner.getLocation());
// e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.ENTITY_LIGHTNING_IMPACT,2.0F,0.5F);
final int radius = P.p.getConfig().getInt("fbanners.Banner-Effect-Radius");
final List<String> effects = P.p.getConfig().getStringList("fbanners.Effects");
final int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
@Override
public void run() {
for (Entity e : banner.getLocation().getWorld().getNearbyEntities(banner.getLocation(),radius,255,radius)){
if (e instanceof Player){
Player player = (Player) e;
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
if (fplayer.getFaction() == bannerFaction){
for (String effect : effects){
String[] components = effect.split(":");
player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(components[0]),100,Integer.parseInt(components[1])));
}
ParticleEffect.FLAME.display(1,1,1,1,10,banner.getLocation(),16);
ParticleEffect.LAVA.display(1,1,1,1,10,banner.getLocation(),16);
if (banner.getType() != bannerType){
banner.setType(bannerType);
}
}
}
}
}
},0L,20L);
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
@Override
public void run() {
banner.setType(Material.AIR);
as.remove();
banner.getWorld().strikeLightningEffect(banner.getLocation());
Bukkit.getScheduler().cancelTask(affectorTask);
bannerLocations.remove(bannerFaction.getTag());
}
},Long.parseLong(bannerTime + ""));
}
else {
fme.msg(TL.WARBANNER_INVALIDLOC);
e.setCancelled(true);
}
}
}
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
// only need to check right-clicks and physical as of MC 1.4+; good performance boost
@ -252,7 +478,6 @@ public class FactionsPlayerListener implements Listener {
}
if (!canPlayerUseBlock(player, block, false)) {
System.out.println("Cancelling " + player.getName() + " " + block.getType().name());
event.setCancelled(true);
if (Conf.handleExploitInteractionSpam) {
String name = player.getName();
@ -362,14 +587,10 @@ public class FactionsPlayerListener implements Listener {
return false;
}
Access access = otherFaction.getAccess(me, PermissableAction.ITEM);
if (access != null && access != Access.UNDEFINED) {
return access == Access.ALLOW;
}
Faction myFaction = me.getFaction();
Relation rel = myFaction.getRelationTo(otherFaction);
// Cancel if we are not in our own territory
if (rel.confDenyUseage()) {
if (!justCheck) {
@ -378,6 +599,11 @@ public class FactionsPlayerListener implements Listener {
return false;
}
Access access = otherFaction.getAccess(me, PermissableAction.ITEM);
if (access != null && access != Access.UNDEFINED) {
// TODO: Update this once new access values are added other than just allow / deny.
return access == Access.ALLOW;
}
// Also cancel if player doesn't have ownership rights for this claim
if (Conf.ownedAreasEnabled && Conf.ownedAreaDenyUseage && !otherFaction.playerHasOwnershipRights(me, loc)) {
@ -414,6 +640,23 @@ public class FactionsPlayerListener implements Listener {
return true;
}
// Dupe fix.
Faction myFaction = me.getFaction();
Relation rel = myFaction.getRelationTo(otherFaction);
if (!rel.isMember() || !otherFaction.playerHasOwnershipRights(me, loc) && player.getItemInHand() != null) {
switch (player.getItemInHand().getType()) {
case CHEST:
case SIGN_POST:
case TRAPPED_CHEST:
case SIGN:
case WOOD_DOOR:
case IRON_DOOR:
return false;
default:
break;
}
}
PermissableAction action = null;
switch (block.getType()) {
@ -455,23 +698,6 @@ public class FactionsPlayerListener implements Listener {
return false;
}
// Dupe fix.
Faction myFaction = me.getFaction();
Relation rel = myFaction.getRelationTo(otherFaction);
if (!rel.isMember() || !otherFaction.playerHasOwnershipRights(me, loc) && player.getItemInHand() != null) {
switch (player.getItemInHand().getType()) {
case CHEST:
case SIGN_POST:
case TRAPPED_CHEST:
case SIGN:
case WOOD_DOOR:
case IRON_DOOR:
return false;
default:
break;
}
}
// We only care about some material types.
if (otherFaction.hasPlayersOnline()) {
if (!Conf.territoryProtectedMaterials.contains(material)) {
@ -519,18 +745,6 @@ public class FactionsPlayerListener implements Listener {
}
}
@EventHandler
public void onTeleport(PlayerTeleportEvent event) {
FPlayer me = FPlayers.getInstance().getByPlayer(event.getPlayer());
FLocation to = new FLocation(event.getTo());
// Check the location they're teleporting to and check if they can fly there.
if (!me.isAdminBypassing() && me.isFlying() && !me.canFlyAtLocation(to)) {
me.setFFlying(false, false);
}
}
// For some reason onPlayerInteract() sometimes misses bucket events depending on distance (something like 2-3 blocks away isn't detected),
// but these separate bucket events below always fire without fail
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)

View File

@ -43,7 +43,9 @@ public enum Permission {
MAP("map"),
MAPHEIGHT("mapheight"),
MOD("mod"),
COLEADER("coleader"),
MOD_ANY("mod.any"),
COLEADER_ANY("coleader.any"),
MODIFY_POWER("modifypower"),
MONEY_BALANCE("money.balance"),
MONEY_BALANCE_ANY("money.balance.any"),
@ -76,6 +78,7 @@ public enum Permission {
STATUS("status"),
STUCK("stuck"),
TAG("tag"),
TNT("tnt"),
TITLE("title"),
TITLE_COLOR("title.color"),
TOGGLE_ALLIANCE_CHAT("togglealliancechat"),
@ -87,7 +90,14 @@ public enum Permission {
SETWARP("setwarp"),
TOP("top"),
VAULT("vault"),
GETVAULT("getvault"),
SETMAXVAULTS("setmaxvaults"),
RULES("rules"),
CHECKPOINT("checkpoint"),
UPGRADES("upgrades"),
BANNER("banner"),
TPBANNER("tpbanner"),
KILLHOLOS("killholos"),
WARP("warp");
public final String node;

View File

@ -7,7 +7,6 @@ import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@ -216,7 +215,6 @@ public enum Relation implements Permissable {
itemMeta.setDisplayName(displayName);
itemMeta.setLore(lore);
itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
item.setItemMeta(itemMeta);
return item;

View File

@ -15,7 +15,8 @@ import java.util.ArrayList;
import java.util.List;
public enum Role implements Permissable {
ADMIN(3, TL.ROLE_ADMIN),
ADMIN(4, TL.ROLE_ADMIN),
COLEADER(3,TL.ROLE_COLEADER),
MODERATOR(2, TL.ROLE_MODERATOR),
NORMAL(1, TL.ROLE_NORMAL),
RECRUIT(0, TL.ROLE_RECRUIT);
@ -52,6 +53,8 @@ public enum Role implements Permissable {
case 2:
return MODERATOR;
case 3:
return COLEADER;
case 4:
return ADMIN;
}
@ -62,6 +65,8 @@ public enum Role implements Permissable {
switch (check.toLowerCase()) {
case "admin":
return ADMIN;
case "coleader":
return COLEADER;
case "mod":
case "moderator":
return MODERATOR;
@ -89,7 +94,9 @@ public enum Role implements Permissable {
if (this == Role.ADMIN) {
return Conf.prefixAdmin;
}
if (this == Role.COLEADER) {
return Conf.prefixCoLeader;
}
if (this == Role.MODERATOR) {
return Conf.prefixMod;
}

View File

@ -50,30 +50,30 @@ public class AsciiCompass {
}
}
public static AsciiCompass.Point getCompassPointForDirection(double inDegrees) {
public static Point getCompassPointForDirection(double inDegrees) {
double degrees = (inDegrees - 180) % 360;
if (degrees < 0) {
degrees += 360;
}
if (0 <= degrees && degrees < 22.5) {
return AsciiCompass.Point.N;
return Point.N;
} else if (22.5 <= degrees && degrees < 67.5) {
return AsciiCompass.Point.NE;
return Point.NE;
} else if (67.5 <= degrees && degrees < 112.5) {
return AsciiCompass.Point.E;
return Point.E;
} else if (112.5 <= degrees && degrees < 157.5) {
return AsciiCompass.Point.SE;
return Point.SE;
} else if (157.5 <= degrees && degrees < 202.5) {
return AsciiCompass.Point.S;
return Point.S;
} else if (202.5 <= degrees && degrees < 247.5) {
return AsciiCompass.Point.SW;
return Point.SW;
} else if (247.5 <= degrees && degrees < 292.5) {
return AsciiCompass.Point.W;
return Point.W;
} else if (292.5 <= degrees && degrees < 337.5) {
return AsciiCompass.Point.NW;
return Point.NW;
} else if (337.5 <= degrees && degrees < 360.0) {
return AsciiCompass.Point.N;
return Point.N;
} else {
return null;
}

View File

@ -85,6 +85,7 @@ public class MiscUtil {
public static Iterable<FPlayer> rankOrder(Iterable<FPlayer> players) {
List<FPlayer> admins = new ArrayList<>();
List<FPlayer> coleaders = new ArrayList<>();
List<FPlayer> moderators = new ArrayList<>();
List<FPlayer> normal = new ArrayList<>();
List<FPlayer> recruit = new ArrayList<>();
@ -102,6 +103,10 @@ public class MiscUtil {
admins.add(player);
break;
case COLEADER:
admins.add(player);
break;
case MODERATOR:
moderators.add(player);
break;
@ -118,6 +123,7 @@ public class MiscUtil {
List<FPlayer> ret = new ArrayList<>();
ret.addAll(admins);
ret.addAll(coleaders);
ret.addAll(moderators);
ret.addAll(normal);
ret.addAll(recruit);

View File

@ -98,4 +98,3 @@ public class PermissionsMapTypeAdapter implements JsonDeserializer<Map<Permissab
}
}

View File

@ -36,7 +36,7 @@ public class WarmUpUtil {
}
public enum Warmup {
HOME, WARP, FLIGHT;
HOME, WARP, FLIGHT, BANNER;
}
}

View File

@ -104,7 +104,17 @@ public class WarpGUI implements InventoryHolder, FactionGUI {
doWarmup(warp);
}
} else {
fme.setEnteringPassword(true, warp);
fme.msg(TL.COMMAND_FWARP_PASSWORD_REQUIRED);
Bukkit.getScheduler().runTaskLater(P.p, new Runnable() {
@Override
public void run() {
if (fme.isEnteringPassword()) {
fme.msg(TL.COMMAND_FWARP_PASSWORD_TIMEOUT);
fme.setEnteringPassword(false, "");
}
}
}, P.p.getConfig().getInt("fwarp-gui.password-timeout", 5)*20);
}
}
}

View File

@ -13,6 +13,7 @@ import com.massivecraft.factions.zcore.util.Persist;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TextUtil;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

View File

@ -82,7 +82,7 @@ public enum PermissableAction {
return new ItemStack(Material.AIR);
}
String displayName = replacePlaceholers(section.getString("placeholder-item.name"), fme, permissable);
String displayName = replacePlaceholders(section.getString("placeholder-item.name"), fme, permissable);
List<String> lore = new ArrayList<>();
if (section.getString("materials." + name().toLowerCase().replace('_', '-')) == null) {
@ -111,7 +111,7 @@ public enum PermissableAction {
}
for (String loreLine : section.getStringList("placeholder-item.lore")) {
lore.add(replacePlaceholers(loreLine, fme, permissable));
lore.add(replacePlaceholders(loreLine, fme, permissable));
}
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
@ -122,7 +122,7 @@ public enum PermissableAction {
return item;
}
public String replacePlaceholers(String string, FPlayer fme, Permissable permissable) {
public String replacePlaceholders(String string, FPlayer fme, Permissable permissable) {
// Run Permissable placeholders
string = permissable.replacePlaceholders(string);

View File

@ -62,6 +62,9 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
for (String key : section.getConfigurationSection("slots").getKeys(false)) {
int slot = section.getInt("slots." + key);
if (slot == -1) {
continue;
}
if (slot + 1 > guiSize || slot < 0) {
P.p.log(Level.WARNING, "Invalid slot for: " + key.toUpperCase());
continue;
@ -191,7 +194,9 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI {
}
backButtonMeta.setLore(lore);
if (!P.p.mc17){
backButtonMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
}
backButton.setItemMeta(backButtonMeta);

View File

@ -285,8 +285,7 @@ public abstract class MemoryBoard extends Board {
Relation relation = fplayer.getRelationTo(factionHere);
if (factionHere.isWilderness()) {
row.then("-").color(Conf.colorWilderness);
// Check for claimat permission and if so, let them claim at ;D
// TODO: TEMP DISABLED UNTIL FIXED PROPERLY :(
// Check for claimat position and if so, let them claim at ;D //TODO: Fix this
if (false) { //fplayer.getPlayer().hasPermission(Permission.CLAIMAT.node)) {
row.tooltip(TL.CLAIM_CLICK_TO_CLAIM.format(dx, dz))
.command(String.format("/f claimat %s %d %d", flocation.getWorldName(), dx, dz));

View File

@ -1,7 +1,9 @@
package com.massivecraft.factions.zcore.persist;
import com.massivecraft.factions.*;
import com.massivecraft.factions.cmd.CmdFly;
import com.massivecraft.factions.event.FPlayerLeaveEvent;
import com.massivecraft.factions.event.FPlayerStoppedFlying;
import com.massivecraft.factions.event.LandClaimEvent;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.iface.RelationParticipator;
@ -22,12 +24,10 @@ import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.*;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.*;
/**
@ -64,6 +64,8 @@ public abstract class MemoryFPlayer implements FPlayer {
protected boolean willAutoLeave = true;
protected int mapHeight = 8; // default to old value
protected boolean isFlying = false;
protected boolean enteringPassword = false;
protected String enteringPasswordWarp = "";
protected transient FLocation lastStoodAt = new FLocation(); // Where did this player stand the last time we checked?
protected transient boolean mapAutoUpdating;
@ -594,24 +596,7 @@ public abstract class MemoryFPlayer implements FPlayer {
public void sendFactionHereMessage(Faction from) {
Faction toShow = Board.getInstance().getFactionAt(getLastStoodAt());
boolean showTitle = P.p.getConfig().getBoolean("enter-titles.enabled", true);
boolean showChat = true;
Player player = getPlayer();
if (showTitle && player != null) {
int in = P.p.getConfig().getInt("enter-titles.fade-in", 10);
int stay = P.p.getConfig().getInt("enter-titles.stay", 70);
int out = P.p.getConfig().getInt("enter-titles.fade-out", 20);
String title = TL.FACTION_ENTER_TITLE.format(this);
String sub = TL.FACTION_ENTER_SUBTITLE.format(toShow.getTag(this));
// We send null instead of empty because Spigot won't touch the title if it's null, but clears if empty.
// We're just trying to be as unintrusive as possible.
player.sendTitle(title, sub, in, stay, out);
showChat = P.p.getConfig().getBoolean("enter-titles.also-show-chat", true);
}
if (showInfoBoard(toShow)) {
FScoreboard.get(this).setTemporarySidebar(new FInfoSidebar(toShow));
showChat = P.p.getConfig().getBoolean("scoreboard.also-send-chat", true);
@ -924,6 +909,7 @@ public abstract class MemoryFPlayer implements FPlayer {
// If leaving fly mode, don't let them take fall damage for x seconds.
if (!fly) {
int cooldown = P.p.getConfig().getInt("fly-falldamage-cooldown", 3);
CmdFly.flyMap.remove(player.getName());
// If the value is 0 or lower, make them take fall damage.
// Otherwise, start a timer and have this cancel after a few seconds.
@ -942,45 +928,47 @@ public abstract class MemoryFPlayer implements FPlayer {
isFlying = fly;
}
public boolean inVault = false;
public boolean isInVault(){
return inVault;
}
public void setInVault(boolean status){
inVault = status;
}
public boolean canFlyAtLocation() {
return canFlyAtLocation(lastStoodAt);
}
public boolean canFlyAtLocation(FLocation location) {
Faction faction = Board.getInstance().getFactionAt(location);
if (faction.isWilderness() || faction.isSafeZone() || faction.isWarZone()) {
if ((!faction.isWilderness() && getPlayer().hasPermission("factions.fly.wilderness")) || (faction.isSafeZone() && getPlayer().hasPermission("factions.fly.safezone") )|| (faction.isWarZone() && getPlayer().hasPermission("factions.fly.warzone"))) {
return false;
}
// Admins can always fly in their territory.
// admin bypass (ops) can fly as well.
if (isAdminBypassing || (faction == getFaction() && getRole() == Role.ADMIN)) {
if (!getPlayer().hasPermission("factions.fly.ally") && getRelationToLocation() == Relation.ALLY) {
return false;
}
if (!getPlayer().hasPermission("factions.fly.truce") && getRelationToLocation() == Relation.TRUCE) {
return false;
}
if (!getPlayer().hasPermission("factions.fly.neutral") && getRelationToLocation() == Relation.NEUTRAL) {
return false;
}
if (faction == getFaction() && getRole() == Role.ADMIN) {
return true;
}
Access access = faction.getAccess(this, PermissableAction.FLY);
if (access == null || access == Access.UNDEFINED) {
// If access is null or undefined, we'll default to the conf.json
switch (faction.getRelationTo(getFaction())) {
case ENEMY:
return Conf.defaultFlyPermEnemy;
case ALLY:
return Conf.defaultFlyPermAlly;
case NEUTRAL:
return Conf.defaultFlyPermNeutral;
case TRUCE:
return Conf.defaultFlyPermTruce;
case MEMBER:
return Conf.defaultFlyPermMember;
default:
return false; // should never reach.
}
}
return access == Access.ALLOW;
return access == null || access == Access.UNDEFINED || access == Access.ALLOW;
}
public boolean shouldTakeFallDamage() {
@ -991,6 +979,19 @@ public abstract class MemoryFPlayer implements FPlayer {
this.shouldTakeFallDamage = fallDamage;
}
public boolean isEnteringPassword() {
return enteringPassword;
}
public void setEnteringPassword(boolean toggle, String warp) {
enteringPassword = toggle;
enteringPasswordWarp = warp;
}
public String getEnteringWarp() {
return enteringPasswordWarp;
}
// -------------------------------------------- //
// Message Sending Helpers
// -------------------------------------------- //
@ -1102,4 +1103,26 @@ public abstract class MemoryFPlayer implements FPlayer {
this.warmup = warmup;
this.warmupTask = taskId;
}
@Override
public boolean checkIfNearbyEnemies(){
Player me = this.getPlayer();
for (Entity e : me.getNearbyEntities(16, 255, 16)) {
if (e == null) { continue; }
if (e instanceof Player) {
Player eplayer = (((Player) e).getPlayer());
if (eplayer == null) { continue; }
FPlayer efplayer = FPlayers.getInstance().getByPlayer(eplayer);
if (efplayer == null) { continue; }
if (this.getRelationTo(efplayer).equals(Relation.ENEMY)) {
this.setFlying(false);
this.msg(TL.COMMAND_FLY_ENEMY_NEAR);
Bukkit.getServer().getPluginManager().callEvent(new FPlayerStoppedFlying(this));
return true;
}
}
}
return false;
}
}

View File

@ -15,11 +15,11 @@ import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.Permissable;
import com.massivecraft.factions.zcore.fperms.PermissableAction;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import java.util.*;
import java.util.Map.Entry;
@ -178,6 +178,84 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return this.bans;
}
public HashMap<Integer,String> rules = new HashMap<Integer, String>();
public String getRule(int index){
if (rules.size() == 0) return null;
return rules.get(index);
}
public HashMap<Integer,String> getRulesMap(){
return rules;
}
public void setRule(int index,String rule) {
rules.put(index,rule);
}
public void removeRule(int index){
HashMap<Integer,String> newRule = rules;
newRule.remove(index);
rules = newRule;
}
public int tnt;
public void addTnt(int amt){
tnt += amt;
}
public void takeTnt(int amt){
tnt -=amt;
}
public int getTnt() { return tnt; }
public Location checkpoint;
public LazyLocation vault;
public Location getVault() {
if (vault == null){
return null;
}
return vault.getLocation();
}
public void setVault(Location vaultLocation){
if (vaultLocation == null){
vault = null;
return;
}
LazyLocation newlocation = new LazyLocation(vaultLocation);
vault = newlocation;
}
public HashMap<String,Integer> upgrades = new HashMap<>();
public int getUpgrade(String key){
if (upgrades.keySet().contains(key)) { return upgrades.get(key);}
return 0;
}
public void setUpgrades(String key,int level){ upgrades.put(key,level); }
public void setCheckpoint(Location location){
checkpoint = location;
}
public Location getCheckpoint(){
return checkpoint;
}
public void clearRules(){
rules.clear();
}
public void addRule(String rule){
rules.put(rules.size(),rule);
}
public boolean getOpen() {
return open;
}
@ -243,6 +321,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
this.tag = str;
}
public String getComparisonTag() {
return MiscUtil.getComparisonString(this.tag);
}
@ -299,6 +378,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return aid;
}
public Integer getPermanentPower() {
return this.permanentPower;
}
@ -397,6 +477,8 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return Access.UNDEFINED;
}
public void setPermission(Permissable permissable, PermissableAction permissableAction, Access access) {
Map<PermissableAction, Access> accessMap = permissions.get(permissable);
if (accessMap == null) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 drtshock
* Copyright (C) 2018 ProSavage
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -50,7 +50,66 @@ public enum TL {
/**
* Command translations
*/
COMMAND_ADMIN_NOTMEMBER("%1$s<i> is not a member in your faction."),
/**
* Messsges for /f help
*/
COMMAND_HELP_NEXTCREATE("<i>Learn how to create a faction on the next page."),
COMMAND_HELP_INVITATIONS("command.help.invitations", "<i>You might want to close it and use invitations:"),
COMMAND_HELP_HOME("<i>And don't forget to set your home:"),
COMMAND_HELP_404("&c&l» &7This page does &cnot &7exist"),
COMMAND_HELP_BANK_1("<i>Your faction has a bank which is used to pay for certain"), //Move to last /f help page
COMMAND_HELP_BANK_2("<i>things, so it will need to have money deposited into it."), //Move to last /f help page
COMMAND_HELP_BANK_3("<i>To learn more, use the money command."), //Move to last /f help page
COMMAND_HELP_PLAYERTITLES("<i>Player titles are just for fun. No rules connected to them."), //Move to last /f help page
COMMAND_HELP_OWNERSHIP_1("<i>Claimed land with ownership set is further protected so"), //Move to last /f help page
COMMAND_HELP_OWNERSHIP_2("<i>that only the owner(s), faction admin, and possibly the"), //Move to last /f help page
COMMAND_HELP_OWNERSHIP_3("<i>faction moderators have full access."), //Move to last /f help page
COMMAND_HELP_RELATIONS_1("<i>Set the relation you WISH to have with another faction."), //Move to last /f help page
COMMAND_HELP_RELATIONS_2("<i>Your default relation with other factions will be neutral."), //Move to last /f help page
COMMAND_HELP_RELATIONS_3("<i>If BOTH factions choose \"ally\" you will be allies."), //Move to last /f help page
COMMAND_HELP_RELATIONS_4("<i>If ONE faction chooses \"enemy\" you will be enemies."), //Move to last /f help page
COMMAND_HELP_RELATIONS_5("<i>You can never hurt members or allies."), //Move to last /f help page
COMMAND_HELP_RELATIONS_6("<i>You can not hurt neutrals in their own territory."), //Move to last /f help page
COMMAND_HELP_RELATIONS_7("<i>You can always hurt enemies and players without faction."), //Move to last /f help page
COMMAND_HELP_RELATIONS_8(""),
COMMAND_HELP_RELATIONS_9("<i>Damage from enemies is reduced in your own territory."), //Move to last /f help page
COMMAND_HELP_RELATIONS_10("<i>When you die you lose power. It is restored over time."), //Move to last /f help page
COMMAND_HELP_RELATIONS_11("<i>The power of a faction is the sum of all member power."), //Move to last /f help page
COMMAND_HELP_RELATIONS_12("<i>The power of a faction determines how much land it can hold."), //Move to last /f help page
COMMAND_HELP_RELATIONS_13("<i>You can claim land from factions with too little power."), //Move to last /f help page
COMMAND_HELP_PERMISSIONS_1("<i>Only faction members can build and destroy in their own"), //Move to last /f help page
COMMAND_HELP_PERMISSIONS_2("<i>territory. Usage of the following items is also restricted:"), //Move to last /f help page
COMMAND_HELP_PERMISSIONS_3("<i>Door, Chest, Furnace, Dispenser, Diode."), //Move to last /f help page
COMMAND_HELP_PERMISSIONS_4(""),
COMMAND_HELP_PERMISSIONS_5("<i>Make sure to put pressure plates in front of doors for your"), //Move to last /f help page
COMMAND_HELP_PERMISSIONS_6("<i>guest visitors. Otherwise they can't get through. You can"), //Move to last /f help page
COMMAND_HELP_PERMISSIONS_7("<i>also use this to create member only areas."), //Move to last /f help page
COMMAND_HELP_PERMISSIONS_8("<i>As dispensers are protected, you can create traps without"), //Move to last /f help page
COMMAND_HELP_PERMISSIONS_9("<i>worrying about those arrows getting stolen."), //Move to last /f help page
COMMAND_HELP_ADMIN_1("&a&l» &a/f claim safezone \n &7claim land for the Safe Zone"),
COMMAND_HELP_ADMIN_2("&a&l» &a/f claim warzone \n &7claim land for the War Zone"),
COMMAND_HELP_ADMIN_3("&a&l» &a/f autoclaim [safezone|warzone] \n &7take a guess"),
COMMAND_HELP_MOAR_1("Finally some commands for the server admins:"),
COMMAND_HELP_MOAR_2("<i>More commands for server admins:"),
COMMAND_HELP_MOAR_3("<i>Even more commands for server admins:"),
COMMAND_HELP_DESCRIPTION("\n &a&l» &7Display a &ahelp &7page"),
COMMAND_NEAR_DESCRIPTION("Get nearby faction players in a radius."),
COMMAND_NEAR_DISABLED_MSG("&cThis command is disabled!"),
COMMAND_NEAR_FORMAT("{playername} &c({distance}m)"),
COMMAND_NEAR_USE_MSG("&cFaction members nearby"),
/**
* Messsges for Faction Admins/Mods
*/
COMMAND_UPGRADES_DESCRIPTION("&cOpen the Upgrades Menu"),
COMMAND_UPGRADES_MONEYTAKE("&c{amount} has been taken from your account."),
COMMAND_UPGRADES_NOTENOUGHMONEY("&cYou dont have enough money!"),
COMMAND_ADMIN_NOTMEMBER("%1$s<i> is not a&c member in your faction."),
COMMAND_ADMIN_NOTADMIN("<b>You are not the faction admin."),
COMMAND_ADMIN_TARGETSELF("<b>The target player musn't be yourself."),
COMMAND_ADMIN_DEMOTES("<i>You have demoted %1$s<i> from the position of faction admin."),
@ -58,6 +117,7 @@ public enum TL {
COMMAND_ADMIN_PROMOTES("<i>You have promoted %1$s<i> to the position of faction admin."),
COMMAND_ADMIN_PROMOTED("%1$s<i> gave %2$s<i> the leadership of %3$s<i>."),
COMMAND_ADMIN_DESCRIPTION("Hand over your admin rights"),
COMMAND_ADMIN_NOMEMBERS("No one else to promote, please disband faction."),
COMMAND_AHOME_DESCRIPTION("Send a player to their f home no matter what."),
COMMAND_AHOME_NOHOME("%1$s doesn't have an f home."),
@ -67,6 +127,13 @@ public enum TL {
COMMAND_ANNOUNCE_DESCRIPTION("Announce a message to players in faction."),
COMMAND_FREECAM_ENEMYINRADIUS("Freecam disabled, An enemy is closeby!"),
COMMAND_FREECAM_OUTSIDEFLIGHT("Please dont leave the flight radius!"),
COMMAND_FREECAM_ENABLED("Freecam is now enabled!"),
COMMAND_FREECAM_DISABLED("Freecam is now disabled"),
COMMAND_FREECAM_DESCRIPTION("Go into spectator mode"),
COMMAND_AUTOCLAIM_ENABLED("<i>Now auto-claiming land for <h>%1$s<i>."),
COMMAND_AUTOCLAIM_DISABLED("<i>Auto-claiming of land disabled."),
COMMAND_AUTOCLAIM_REQUIREDRANK("<b>You must be <h>%1$s<b> to claim land."),
@ -85,6 +152,7 @@ public enum TL {
COMMAND_BANLIST_HEADER("&6There are &c%d&6 bans for %s"),
COMMAND_BANLIST_ENTRY("&7%d. &c%s &r- &a%s &r- &e%s"),
COMMAND_BANLIST_NOFACTION("&4You are not in a Faction."),
COMMAND_BANLIST_INVALID("We couldn't find a Faction by the name %s"),
COMMAND_BOOM_PEACEFULONLY("<b>This command is only usable by factions which are specifically designated as peaceful."),
COMMAND_BOOM_TOTOGGLE("to toggle explosions"),
@ -92,12 +160,24 @@ public enum TL {
COMMAND_BOOM_ENABLED("%1$s<i> has %2$s explosions in your faction's territory."),
COMMAND_BOOM_DESCRIPTION("Toggle explosions (peaceful factions only)"),
COMMAND_BYPASS_ENABLE("<i>You have enabled admin bypass mode. You will be able to build or destroy anywhere."),
COMMAND_BYPASS_ENABLELOG(" has ENABLED admin bypass mode."),
COMMAND_BYPASS_DISABLE("<i>You have disabled admin bypass mode."),
COMMAND_BYPASS_DISABLELOG(" has DISABLED admin bypass mode."),
COMMAND_BYPASS_DESCRIPTION("Enable admin bypass mode"),
COMMAND_BANNER_DESCRIPTION("Turn a held banner into a war banner"),
COMMAND_BANNER_NOTENOUGHMONEY("&cYou do not have enough money"),
COMMAND_BANNER_MONEYTAKE("&c{amount} has been taken from your account."),
COMMAND_BANNER_WRONGITEM("&cYou need to be holding a banner to use this!"),
COMMAND_BANNER_SUCCESS("&cYou have created a war banner!"),
COMMAND_TPBANNER_NOTSET("&cYour faction does not have a banner placed!"),
COMMAND_TPBANNER_SUCCESS("&cTeleporting to Faction Banner"),
COMMAND_TPBANNER_DESCRIPTION("Teleport to your faction banner"),
COMMAND_CHAT_DISABLED("<b>The built in chat channels are disabled on this server."),
COMMAND_CHAT_INVALIDMODE("<b>Unrecognised chat mode. <i>Please enter either 'a','f' or 'p'"),
COMMAND_CHAT_DESCRIPTION("Change chat mode"),
@ -151,6 +231,13 @@ public enum TL {
COMMAND_CONVERT_BACKEND_INVALID("Invalid backend"),
COMMAND_CONVERT_DESCRIPTION("Convert the plugin backend"),
COMMAND_CHECKPOINT_DISABLED("You cannot use checkpoint while disabled!"),
COMMAND_CHECKPOINT_SET("&cYou have set the faction checkpoint at your Location."),
COMMAND_CHECKPOINT_GO("&cTeleporting to faction checkpoint"),
COMMAND_CHECKPOINT_NOT_SET("&cYou have to set the faction checkpoint first."),
COMMAND_CHECKPOINT_CLAIMED("&cYour current faction checkpoint is claimed, set a new one!"),
COMMAND_CHECKPOINT_DESCRIPTION("Set or go to your faction checkpoint!"),
COMMAND_CREATE_MUSTLEAVE("<b>You must leave your current faction first."),
COMMAND_CREATE_INUSE("<b>That tag is already in use."),
COMMAND_CREATE_TOCREATE("to create a new faction"),
@ -193,6 +280,8 @@ public enum TL {
COMMAND_FLY_CHANGE("&eFaction flight &d%1$s"),
COMMAND_FLY_DAMAGE("&eFaction flight &ddisabled&e due to entering combat"),
COMMAND_FLY_NO_ACCESS("&cCannot fly in territory of %1$s"),
COMMAND_FLY_ENEMY_NEAR("&cFlight has been disabled an enemy is nearby"),
COMMAND_FLY_CHECK_ENEMY("&cCannot fly here, an enemy is nearby"),
COMMAND_FWARP_CLICKTOWARP("Click to warp!"),
COMMAND_FWARP_COMMANDFORMAT("<i>/f warp <warpname> [password]"),
@ -203,48 +292,8 @@ public enum TL {
COMMAND_FWARP_WARPS("Warps: "),
COMMAND_FWARP_DESCRIPTION("Teleport to a faction warp"),
COMMAND_FWARP_INVALID_PASSWORD("&4Invalid password!"),
COMMAND_FWARP_PASSWORD_REQUIRED("&cThis faction warp requires a password, use command instead"),
COMMAND_HELP_404("<b>This page does not exist"),
COMMAND_HELP_NEXTCREATE("<i>Learn how to create a faction on the next page."),
COMMAND_HELP_INVITATIONS("command.help.invitations", "<i>You might want to close it and use invitations:"),
COMMAND_HELP_HOME("<i>And don't forget to set your home:"),
COMMAND_HELP_BANK_1("<i>Your faction has a bank which is used to pay for certain"),
COMMAND_HELP_BANK_2("<i>things, so it will need to have money deposited into it."),
COMMAND_HELP_BANK_3("<i>To learn more, use the money command."),
COMMAND_HELP_PLAYERTITLES("<i>Player titles are just for fun. No rules connected to them."),
COMMAND_HELP_OWNERSHIP_1("<i>Claimed land with ownership set is further protected so"),
COMMAND_HELP_OWNERSHIP_2("<i>that only the owner(s), faction admin, and possibly the"),
COMMAND_HELP_OWNERSHIP_3("<i>faction moderators have full access."),
COMMAND_HELP_RELATIONS_1("<i>Set the relation you WISH to have with another faction."),
COMMAND_HELP_RELATIONS_2("<i>Your default relation with other factions will be neutral."),
COMMAND_HELP_RELATIONS_3("<i>If BOTH factions choose \"ally\" you will be allies."),
COMMAND_HELP_RELATIONS_4("<i>If ONE faction chooses \"enemy\" you will be enemies."),
COMMAND_HELP_RELATIONS_5("<i>You can never hurt members or allies."),
COMMAND_HELP_RELATIONS_6("<i>You can not hurt neutrals in their own territory."),
COMMAND_HELP_RELATIONS_7("<i>You can always hurt enemies and players without faction."),
COMMAND_HELP_RELATIONS_8(""),
COMMAND_HELP_RELATIONS_9("<i>Damage from enemies is reduced in your own territory."),
COMMAND_HELP_RELATIONS_10("<i>When you die you lose power. It is restored over time."),
COMMAND_HELP_RELATIONS_11("<i>The power of a faction is the sum of all member power."),
COMMAND_HELP_RELATIONS_12("<i>The power of a faction determines how much land it can hold."),
COMMAND_HELP_RELATIONS_13("<i>You can claim land from factions with too little power."),
COMMAND_HELP_PERMISSIONS_1("<i>Only faction members can build and destroy in their own"),
COMMAND_HELP_PERMISSIONS_2("<i>territory. Usage of the following items is also restricted:"),
COMMAND_HELP_PERMISSIONS_3("<i>Door, Chest, Furnace, Dispenser, Diode."),
COMMAND_HELP_PERMISSIONS_4(""),
COMMAND_HELP_PERMISSIONS_5("<i>Make sure to put pressure plates in front of doors for your"),
COMMAND_HELP_PERMISSIONS_6("<i>guest visitors. Otherwise they can't get through. You can"),
COMMAND_HELP_PERMISSIONS_7("<i>also use this to create member only areas."),
COMMAND_HELP_PERMISSIONS_8("<i>As dispensers are protected, you can create traps without"),
COMMAND_HELP_PERMISSIONS_9("<i>worrying about those arrows getting stolen."),
COMMAND_HELP_ADMIN_1("<c>/f claim safezone <i>claim land for the Safe Zone"),
COMMAND_HELP_ADMIN_2("<c>/f claim warzone <i>claim land for the War Zone"),
COMMAND_HELP_ADMIN_3("<c>/f autoclaim [safezone|warzone] <i>take a guess"),
COMMAND_HELP_MOAR_1("Finally some commands for the server admins:"),
COMMAND_HELP_MOAR_2("<i>More commands for server admins:"),
COMMAND_HELP_MOAR_3("<i>Even more commands for server admins:"),
COMMAND_HELP_DESCRIPTION("Display a help page"),
COMMAND_FWARP_PASSWORD_REQUIRED("&a&lWarp Password:"),
COMMAND_FWARP_PASSWORD_TIMEOUT("&cWarp password canceled"),
COMMAND_HOME_DISABLED("<b>Sorry, Faction homes are disabled on this server."),
COMMAND_HOME_TELEPORTDISABLED("<b>Sorry, the ability to teleport to Faction homes is disabled on this server."),
@ -280,7 +329,7 @@ public enum TL {
COMMAND_JOIN_JOINED("<i>%1$s joined your faction."),
COMMAND_JOIN_JOINEDLOG("%1$s joined the faction %2$s."),
COMMAND_JOIN_MOVEDLOG("%1$s moved the player %2$s into the faction %3$s."),
COMMAND_JOIN_DESCRIPTION("Join a faction"),
COMMAND_JOIN_DESCRIPTION("\\n &a&l» &7Join a faction"),
COMMAND_JOIN_BANNED("&cYou are banned from %1$s &c:("),
COMMAND_KICK_CANDIDATES("Players you can kick: "),
@ -301,7 +350,7 @@ public enum TL {
COMMAND_LIST_TOLIST("to list the factions"),
COMMAND_LIST_FORLIST("for listing the factions"),
COMMAND_LIST_ONLINEFACTIONLESS("Online factionless: "),
COMMAND_LIST_DESCRIPTION("See a list of the factions"),
COMMAND_LIST_DESCRIPTION("\n &a&l» &7See a list of the factions"),
COMMAND_LOCK_LOCKED("<i>Factions is now locked"),
COMMAND_LOCK_UNLOCKED("<i>Factions in now unlocked"),
@ -332,6 +381,18 @@ public enum TL {
COMMAND_MOD_PROMOTED("<i>You have promoted %1$s<i> to moderator."),
COMMAND_MOD_DESCRIPTION("Give or revoke moderator rights"),
COMMAND_COLEADER_CANDIDATES("Players you can promote: "),
COMMAND_COLEADER_CLICKTOPROMOTE("Click to promote "),
COMMAND_COLEADER_NOTMEMBER("%1$s<b> is not a member in your faction."),
COMMAND_COLEADER_NOTADMIN("<b>You are not the faction admin."),
COMMAND_COLEADER_SELF("<b>The target player musn't be yourself."),
COMMAND_COLEADER_TARGETISADMIN("<b>The target player is a faction admin. Demote them first."),
COMMAND_COLEADER_REVOKES("<i>You have removed coleader status from %1$s<i>."),
COMMAND_COLEADER_REVOKED("%1$s<i> is no longer coleader in your faction."),
COMMAND_COLEADER_PROMOTES("%1$s<i> was promoted to coleader in your faction."),
COMMAND_COLEADER_PROMOTED("<i>You have promoted %1$s<i> to coleader."),
COMMAND_COLEADER_DESCRIPTION("Give or revoke coleader rights"),
COMMAND_MODIFYPOWER_ADDED("<i>Added <a>%1$f <i>power to <a>%2$s. <i>New total rounded power: <a>%3$d"),
COMMAND_MODIFYPOWER_DESCRIPTION("Modify the power of a faction/player"),
@ -376,6 +437,8 @@ public enum TL {
COMMAND_OWNER_ADDED("<i>You have added %1$s<i> to the owner list for this claimed land."),
COMMAND_OWNER_DESCRIPTION("Set ownership of claimed land"),
COMMAND_KILLHOLOGRAMS_DESCRIPTION("Kill holograms in a radius, admin command"),
COMMAND_OWNERLIST_DISABLED("<b>Sorry, but owned areas are disabled on this server."),//dup->
COMMAND_OWNERLIST_WRONGFACTION("<b>This land is not claimed by your faction."),//eq
COMMAND_OWNERLIST_NOTCLAIMED("<i>This land is not claimed by any faction, thus no owners."),//eq
@ -393,7 +456,7 @@ public enum TL {
COMMAND_PERM_INVALID_RELATION("Invalid relation defined. Try something like 'ally'"),
COMMAND_PERM_INVALID_ACCESS("Invalid access defined. Try something like 'allow'"),
COMMAND_PERM_INVALID_ACTION("Invalid action defined. Try something like 'build'"),
COMMAND_PERM_SET("&aSet permission &e%1$s &ato &b%2$s &afor relation &c%3$s"),
COMMAND_PERM_SET("Set permission %1$s to %2$s for relation %3$s"),
COMMAND_PERM_TOP("RCT MEM OFF ALLY TRUCE NEUT ENEMY"),
COMMAND_PERMANENT_DESCRIPTION("Toggles a faction's permanence"), //TODO: Real word?
@ -405,6 +468,7 @@ public enum TL {
COMMAND_PROMOTE_SUCCESS("You successfully %1$s %2$s to %3$s"),
COMMAND_PROMOTE_PROMOTED("promoted"),
COMMAND_PROMOTE_DEMOTED("demoted"),
COMMAND_PROMOTE_COLEADER_ADMIN("&cColeaders cant promote players to Admin!"),
COMMAND_PERMANENTPOWER_DESCRIPTION("Toggle faction power permanence"), //TODO: This a real word?
COMMAND_PERMANENTPOWER_GRANT("added permanentpower status to"),
@ -420,10 +484,10 @@ public enum TL {
COMMAND_POWER_TOSHOW("to show player power info"),
COMMAND_POWER_FORSHOW("for showing player power info"),
COMMAND_POWER_POWER("%1$s<a> - Power / Maxpower: <i>%2$d / %3$d %4$s"),
COMMAND_POWER_POWER("%1$s &a&l» &7Power &a/ &7Maxpower&a: &a%2$d &7/&a%3$d %4$s"),
COMMAND_POWER_BONUS(" (bonus: "),
COMMAND_POWER_PENALTY(" (penalty: "),
COMMAND_POWER_DESCRIPTION("Show player power info"),
COMMAND_POWER_DESCRIPTION("\\n &a&l» &7Show player &apower &7info"),
COMMAND_POWERBOOST_HELP_1("<b>You must specify \"p\" or \"player\" to target a player or \"f\" or \"faction\" to target a faction."),
COMMAND_POWERBOOST_HELP_2("<b>ex. /f powerboost p SomePlayer 0.5 -or- /f powerboost f SomeFaction -5"),
@ -485,8 +549,17 @@ public enum TL {
COMMAND_SETMAXVAULTS_DESCRIPTION("Set max vaults for a Faction."),
COMMAND_SETMAXVAULTS_SUCCESS("&aSet max vaults for &e%s &ato &b%d"),
COMMAND_VAULT_DESCRIPTION("/f vault <number> to open one of your Faction's vaults."),
COMMAND_VAULT_TOOHIGH("&cYou tried to open vault %d but your Faction only has %d vaults."),
COMMAND_VAULT_DESCRIPTION("Open your placed faction vault!"),
COMMAND_VAULT_INVALID("&cYour vault was either claimed, broken, or has not been placed yet."),
COMMAND_VAULT_OPENING("&cOpening faction vault."),
COMMAND_GETVAULT_ALREADYSET("&cVault has already been set!"),
COMMAND_GETVAULT_ALREADYHAVE("&cYou already have a vault in your inventory!"),
COMMAND_GETVAULT_CHESTNEAR("&cThere is a chest nearby"),
COMMAND_GETVAULT_SUCCESS("&cSucessfully set vault."),
COMMAND_GETVAULT_INVALIDLOCATION("&cVault can only be placed in faction land!"),
COMMAND_GETVAULT_DESCRIPTION("Get the faction vault item!"),
COMMAND_GETVAULT_RECEIVE("&cYou have recieved a faction vault!"),
COMMAND_SHOW_NOFACTION_SELF("You are not in a faction"),
COMMAND_SHOW_NOFACTION_OTHER("That's not a faction"),
@ -512,6 +585,7 @@ public enum TL {
COMMAND_SHOW_COMMANDDESCRIPTION("Show faction information"),
COMMAND_SHOW_DEATHS_TIL_RAIDABLE("<i>DTR: %1$d"),
COMMAND_SHOW_EXEMPT("<b>This faction is exempt and cannot be seen."),
COMMAND_SHOW_NEEDFACTION("&cYou need to join a faction to view your own!"),
COMMAND_SHOWINVITES_PENDING("Players with pending invites: "),
COMMAND_SHOWINVITES_CLICKTOREVOKE("Click to revoke invite for %1$s"),
@ -555,6 +629,16 @@ public enum TL {
COMMAND_TOP_LINE("%d. &6%s: &c%s"), // Rank. Faction: Value
COMMAND_TOP_INVALID("Could not sort by %s. Try balance, online, members, power or land."),
COMMAND_TNT_DISABLED_MSG("&cThis command is disabled!"),
COMMAND_TNT_INVALID_NUM("The amount needs to be a number!"),
COMMAND_TNT_DEPOSIT_SUCCESS("&cSuccessfully deposited tnt."),
COMMAND_TNT_WIDTHDRAW_SUCCESS("&cSuccessfully withdrew tnt."),
COMMAND_TNT_WIDTHDRAW_NOTENOUGH("&cNot enough tnt in inventory."),
COMMAND_TNT_DEPOSIT_NOTENOUGH("&cNot enough tnt in tnt bank."),
COMMAND_TNT_AMOUNT("&cYour faction has {amount} tnt in the tnt bank."),
COMMAND_TNT_POSITIVE("&cPlease use positive numbers!"),
COMMAND_TNT_DESCRIPTION("add/widthraw from faction's tnt bank"),
COMMAND_UNBAN_DESCRIPTION("Unban someone from your Faction"),
COMMAND_UNBAN_NOTBANNED("&7%s &cisn't banned. Not doing anything."),
COMMAND_UNBAN_UNBANNED("&e%1$s &cunbanned &7%2$s"),
@ -586,6 +670,17 @@ public enum TL {
COMMAND_WARUNCLAIMALL_SUCCESS("<i>You unclaimed ALL war zone land."),
COMMAND_WARUNCLAIMALL_LOG("%1$s unclaimed all war zones."),
COMMAND_RULES_DISABLED_MSG("&cThis command is disabled!"),
COMMAND_RULES_DESCRIPTION("set/remove/add rules!"),
COMMAND_RULES_ADD_INVALIDARGS("Please include a rule!"),
COMMAND_RULES_SET_INVALIDARGS("Please include a line number & rule!"),
COMMAND_RULES_REMOVE_INVALIDARGS("Please include a line number!"),
COMMAND_RULES_ADD_SUCCESS("&cRule added successfully!"),
COMMAND_RULES_REMOVE_SUCCESS("&cRule removed successfully!"),
COMMAND_RULES_SET_SUCCESS("&cRule set successfully!"),
COMMAND_RULES_CLEAR_SUCCESS("&cRule cleared successfully!"),
/**
* Leaving - This is accessed through a command, and so it MAY need a COMMAND_* slug :s
@ -597,7 +692,7 @@ public enum TL {
LEAVE_LEFT("%s<i> left faction %s<i>."),
LEAVE_DISBANDED("<i>%s<i> was disbanded."),
LEAVE_DISBANDEDLOG("The faction %s (%s) was disbanded due to the last player (%s) leaving."),
LEAVE_DESCRIPTION("Leave your faction"),
LEAVE_DESCRIPTION("\\n &a&l» &7Leave your faction"),
/**
* Claiming - Same as above basically. No COMMAND_* because it's not in a command class, but...
@ -650,7 +745,7 @@ public enum TL {
GENERIC_SERVERADMIN("A server admin"),
GENERIC_DISABLED("disabled"),
GENERIC_ENABLED("enabled"),
GENERIC_INFINITY(""),
GENERIC_INFINITY("∞"),
GENERIC_CONSOLEONLY("This command cannot be run as a player."),
GENERIC_PLAYERONLY("<b>This command can only be used by ingame players."),
GENERIC_ASKYOURLEADER("<i> Ask your leader to:"),
@ -664,6 +759,11 @@ public enum TL {
GENERIC_FACTIONTAG_ALPHANUMERIC("<i>Faction tag must be alphanumeric. \"<h>%s<i>\" is not allowed."),
GENERIC_PLACEHOLDER("<This is a placeholder for a message you should not see>"),
WARBANNER_NOFACTION("&cYou need a faction to use a warbanner!"),
WARBANNER_COOLDOWN("&cThe warbanner is on cooldown for your faction!"),
WARBANNER_INVALIDLOC("&cYou can only use warbanners in enemy land or the warzone"),
/**
* ASCII compass (for chat map)
*/
@ -706,6 +806,7 @@ public enum TL {
* Roles
*/
ROLE_ADMIN("admin"),
ROLE_COLEADER("coleader"),
ROLE_MODERATOR("moderator"),
ROLE_NORMAL("normal member"),
ROLE_RECRUIT("recruit"),
@ -772,8 +873,6 @@ public enum TL {
SAFEZONE_DESCRIPTION("safezone-description", "Free from pvp and monsters."),
TOGGLE_SB("toggle-sb", "You now have scoreboards set to {value}"),
FACTION_LEAVE("faction-leave", "<a>Leaving %1$s, <a>Entering %2$s"),
FACTION_ENTER_TITLE("faction-enter-title", ""),
FACTION_ENTER_SUBTITLE("faction-enter-subtitle", "%s"),
FACTIONS_ANNOUNCEMENT_TOP("faction-announcement-top", "&d--Unread Faction Announcements--"),
FACTIONS_ANNOUNCEMENT_BOTTOM("faction-announcement-bottom", "&d--Unread Faction Announcements--"),
DEFAULT_PREFIX("default-prefix", "{relationcolor}[{faction}] &r"),

View File

@ -20,12 +20,6 @@ findfactionsexploit:
cooldown: 2000 # in miliseconds. 2000 = 2 seconds.
log: false
# Essentials Hook
# Should we delete player homes that they set via Essentials when they leave a Faction if they have homes set in that
# Faction's territory?
delete-ess-homes: true
### Hard Core Settings ###
# Many of the features that are / are to come in this section have been requested by
# people in relation to HCF servers. All settings are set to the normal Factions
@ -67,6 +61,13 @@ warp-cost:
# Faction Fly
# Enable Faction Fly:
enable-faction-flight: true
fly-falldamage-cooldown: 10
ffly:
Particles:
Enabled: true
AutoEnable: true #If set to true, fly will automatically enable when walking into your own chunk.
# If a player leaves fly (out of territory or took damage)
# how long should they not take fall damage for?
@ -78,18 +79,6 @@ fly-falldamage-cooldown: 3
# http://i.gyazo.com/6a1a31222e58a5d60ff341c13f6a8404.gif
disable-pistons-in-territory: false
# Should we send titles when players enter Factions?
# This is the same as finfo.titles and can be shown in conjunction with scoreboard and chat if necessary.
# If you only want to show titles when entering territory,
# leave this true and set scoreboard.finfo.titles and scoreboard.alsosendchat to false.
enter-titles:
enabled: true
fade-in: 10
stay: 70
fade-out: 20
also-show-chat: false
# ToolTips
# This section is to configure tooltips for things like /f list
tooltips:
@ -99,12 +88,10 @@ tooltips:
# It will not sure up for factionless of course, just actual factions.
# You can use color codes here.
list:
- "&6Leader: &f{leader}"
- "&6Claimed: &f{chunks}"
- "&6Raidable: &f{raidable}"
- "&6Warps: &f{warps}"
- "&6Power: &f{power}/{maxPower}"
- "&6Members: &f{online}/{members}"
- "&6&l* &eLeader: &7{leader}"
- "&6&l* &eClaims: &7{chunks}"
- "&6&l* &ePower: &7{power}/{maxPower}"
- "&6&l* &eMembers: &7{online}/{members}"
# Show
# This shows up when someone does /f show.
@ -113,10 +100,11 @@ tooltips:
# {balance} will show their balance if you have vault installed.
# {lastSeen} will show human readable info on when the player was last seen, or online.
show:
- "&6Last Seen: &f{lastSeen}"
- "&6Power: &f{power}"
- "&6Rank: &f{group}"
- "&6Balance: &a${balance}"
- "&6&l* &eUsername: &7{name}"
- "&6&l* &eRank: &7{group}"
- "&6&l* &eBalance: &7${balance}"
- "&6&l* &eLast Seen:&7 {lastSeen}"
- "&6&l* &ePower: &7{power}/{maxPower}"
# Configuration section for Scoreboards
# This will allow you to completely customize how your scoreboards look.
@ -138,7 +126,7 @@ scoreboard:
# {warps} - the number of warps that a faction has set.
# The title of the scoreboard will be the Faction's tag and colored according to the relation with the player's Faction.
# Commenting this section out will cause the info to appear in chat as the plugin originally did.
finfo-enabled: false # Default to false to keep original functionality.
finfo-enabled: false
# SUPPORTS PLACEHOLDERS
finfo:
@ -158,8 +146,8 @@ scoreboard:
# {maxPower} - player's max power.
# {powerBoost} - player's powerboost.
default-enabled: false # Default to false to keep original functionality.
default-title: "i love drt" # Can use any of the values from above but this won't update once it's set (so don't set {balance}).
default-enabled: true # Default to false to keep original functionality.
default-title: "&cSavageFactions" # Can use any of the values from above but this won't update once it's set (so don't set {balance}).
default-update-interval: 2 # in seconds.
# This will show faction prefixes colored based on relation on nametags and in the tab.
@ -167,28 +155,49 @@ scoreboard:
default-prefixes: true
# SUPPORTS PLACEHOLDERS
default:
- "&6Your Faction"
- "{faction}"
- "&3Your Power"
- "{power}"
- "&aBalance"
- "${balance}"
factionless-enabled: false
default:
- "&7&m--------------------------"
- "&4&lFaction Info &8»"
- " &8> &cLeader&7: &f{leader}"
- " &8> &cMembers&7: &f{online}&7/&f{members}"
- " &8> &cPower&7: &f{power}&7/&f{maxPower}"
- "&m"
- "&4&lFaction Stats &8»"
- " &8> &cKills&7: &f{faction-kills}"
- " &8> &cDeaths&7: &f{faction-deaths}"
- " &8> &cBalance&7: &f{faction-balance}"
- ""
- " &8> &cYour Balance&7: &f{balance}"
- "&7&m---------------------------"
factionless-enabled: true
factionless:
- "Make a new Faction"
- "Use /f create"
- "&7&m--------------------------"
- "&4&lInformation &8»"
- " &8> &cPlayer&7: &f{name}"
- " &8> &cRank&7: &f{group}"
- " &8> &cBalance&7: &f${balance}"
- "&m"
- "&4&lServer Info &8» "
- " &8» &cIFaction: &fN/A"
- " &8» &cOnline Players&7: &f{total-online}"
- "&7&m---------------------------"
# Configration section for warmups.
# Warmup times are in seconds - if a value of 0 is set, there is no warmup.
warmups:
# Delay for /f home
f-home: 0
f-home: 15
# Delay for /f warp
f-warp: 0
f-warp: 10
# Delay for /f fly
f-fly: 0
f-fly: 10
#Delay for /f checkpoint's teleport
f-checkpoint: 10
#Delay for /f tpbanner
f-banner: 10
######################################################
#################### HCF Features ####################
@ -203,11 +212,11 @@ warmups:
# It is advised that you set the default relation to -1 so they can always go back to that.
# Otherwise Factions could be stuck with not being able to unenemy other Factions.
max-relations:
enabled: false
ally: 10
truce: 10
enabled: true
ally: 1
truce: 0
neutral: -1
enemy: 10
enemy: -1
# WorldBorder support
# A buffer of 0 means faction claims can go right up to the border of the world.
@ -265,26 +274,25 @@ hcf:
# SUPPORTS PLACEHOLDERS
show:
# First line can be {header} for default header, or any string (we recommend &m for smooth lines ;p)
- '{header}'
- '<a>Description: <i>{description}'
- '<a>Joining: <i>{joining} {peaceful}'
- '<a>Land / Power / Maxpower: <i> {chunks}/{power}/{maxPower}'
- '<a>Founded: <i>{create-date}'
- '<a>This faction is permanent, remaining even with no members.' # only shows if faction is permanent
- '<a>Land value: <i>{land-value} {land-refund}'
- '<a>Balance: <i>{faction-balance}'
- '<a>Bans: <i>{faction-bancount}'
- '<a>Allies(<i>{allies}<a>/<i>{max-allies}<a>): {allies-list} '
- '<a>Online: (<i>{online}<a>/<i>{members}<a>): {online-list}'
- '<a>Offline: (<i>{offline}<a>/<i>{members}<a>): {offline-list}'
- '&8&m--------------&7 &8<&e{faction}&8> &8&m--------------'
- '&6 * &eOwner &7{leader}'
- '&6 * &eDescription &7{description}'
- '&6 * &eLand / Power / Max Power: &7{chunks} &8/ &7{power} &8/ &7{maxPower}'
- '&6 * &eFounded &7{create-date}'
- '&6 * &eBalance &f{faction-balance}'
- '&6 * &eAllies &c{allies-list}'
- '&6 * &eEnemies &c{enemies-list}'
- '&6 * &eOnline Members &8(&7{online}/{members}&8) &7{online-list}'
- '&6 * &eOffline Members &8(&7{offline}/{members}&8) &7{offline-list}'
- '&6 * &eBans &7{faction-bancount}'
- '&8&m----------------------------------------'
# For a /f show that does not display fancy messages that are essentially empty, use minimal-show
minimal-show: false
# Factions that should be exempt from /f show, case sensitive, useful for a
# serverteam faction, since the command shows vanished players otherwise
show-exempt:
- Put_faction_tag_here
- Wilderness
# THIS IS FOR /f map tool tips.
@ -293,17 +301,13 @@ show-exempt:
# Lines that arent defined wont be sent (home not set, faction not peaceful / permanent, dtr freeze)
map:
# First line can be {header} for default header, or any string (we recommend &m for smooth lines ;p)
- '{header}'
- '<a>Description: <i>{description}'
- '<a>Joining: <i>{joining} {peaceful}'
- '<a>Land / Power / Maxpower: <i> {chunks}/{power}/{maxPower}'
- '<a>Founded: <i>{create-date}'
- '<a>This faction is permanent, remaining even with no members.' # only shows if faction is permanent
- '<a>Land value: <i>{land-value} {land-refund}'
- '<a>Balance: <i>{balance}'
- '<a>Allies(<i>{allies}<a>/<i>{max-allies}<a>): {allies-list} '
- '<a>Online: (<i>{online}<a>/<i>{members}<a>): {online-list}'
- '<a>Offline: (<i>{offline}<a>/<i>{members}<a>): {offline-list}'
- '&6* &eFaction &7{faction}'
- '&6* &eOwner &7{leader}'
- '&6* &eLand / Power / Max Power: &7{chunks} &8/ &7{power} &8/ &7{maxPower}'
- '&6* &eAllies &c{allies-list}'
- '&6* &eEnemies &c{enemies-list}'
- '&6* &eOnline Members &8(&7{online}/{members}&8) {online-list}'
- '&6* &eOffline Members &7{offline-list}'
############################################################
# +------------------------------------------------------+ #
@ -313,11 +317,11 @@ map:
list:
# You can only use {pagenumber} and {pagecount} in the header
header: '&e&m----------&r&e[ &2Faction List &9{pagenumber}&e/&9{pagecount} &e]&m----------'
header: '&8&m-----------------&r &8< &eFaction List &8(&7{pagenumber}/{pagecount}&8) &8> &m-----------------'
# You can use any variables here
factionless: '<i>Factionless<i> {factionless} online'
factionless: '&7&o(( There are currently &f{total-online} &7&oPlayers online right now! ))'
# You can use any variable here
entry: '<a>{faction} <i>{online} / {members} online, <a>Land / Power / Maxpower: <i>{chunks}/{power}/{maxPower}'
entry: '{faction} &8(&7{online}/{members}&8) &eLand / Power / Max Power &f{chunks}&7/&f{power}&7/&f{maxPower}'
############################################################
# +------------------------------------------------------+ #
@ -326,42 +330,50 @@ list:
############################################################
# set to true to use legacy factions help
use-old-help: true
use-old-help: false
help:
# You can change the page name to whatever you like
# We use '1' to preserve default functionality of /f help 1
'1':
- '&e&m----------------------------------------------'
- ' &c&lFactions Help '
- '&e&m----------------------------------------------'
- '&3/f create &e>> &7Create your own faction'
- '&3/f who &e>> &7Show factions info'
- '&3/f tag &e>> &7Change faction tag'
- '&3/f join &e>> &7Join faction'
- '&3/f list &e>> &7List all factions'
- '&e&m--------------&r &2/f help 2 for more &e&m--------------'
- '&7&m----------------------------------------------------'
- '&6&lFactions Help &8- &f(1/2) '
- '&7&m----------------------------------------------------'
- '&e/f create &f<name> &8- &7Create your own faction.'
- '&e/f who &f<name> &8- &7Show faction information.'
- '&e/f tag &f<name> &8- &7Change your faction name.'
- '&e/f join &f<name> &8- &7Join to the faction.'
- '&e/f list &8- &7List all factions.'
- '&e/f top &8- &7View the richest factions.'
- '&e/f map &8- &7Map of the surrounding area.'
- '&e/f sethome &8- &7Teleport to faction home.'
- '&e/f home &8- &7Set your faction home.'
- '&e/f ban &8- &7Ban a member from your faction.'
- '&e/f unban &8- &7Unban a member from your faction.'
- '&e/f banlist &8- &7List banned players from your faction.'
- '&7&m--------------------&r &e/f help 2 &7&m-----------------------'
'2':
- '&e&m------------------&r&c&l Page 2 &e&m--------------------'
- '&3/f home &e>> &7Teleport to faction home'
- '&3/f sethome &e>> &7Set your faction home'
- '&3/f leave &e>> &7Leave your faction'
- '&3/f invite &e>> &7Invite a player to your faction'
- '&3/f deinvite &e>> &7Revoke invitation to player'
- '&e&m--------------&r &2/f help 3 for more &e&m--------------'
'3':
- '&e&m------------------&r&c&l Page 3 &e&m--------------------'
- '&3/f claim &e>> &7Claim land'
- '&3/f unclaim &e>> &7Unclaim land'
- '&3/f kick &e>> &7Kick player from your faction'
- '&3/f mod &e>> &7Set player role in faction'
- '&3/f chat &e>> &7Switch to faction chat'
- '&e&m--------------&r &2/f help 4 for more &e&m--------------'
'4':
- '&e&m------------------&r&c&l Page 4 &e&m--------------------'
- '&3/f version &e>> &7Display version information'
- '&e&m--------------&r&2 End of /f help &e&m-----------------'
- '&7&m----------------------------------------------------'
- '&6&lFactions Help &8- &f(2/2) '
- '&7&m----------------------------------------------------'
- '&e/f leave &8- &7Leave your faction.'
- '&e/f invite &f<playerName> &8- &7Invite a player to your faction.'
- '&e/f deinvite &f<playerName> &8- &7Revoke invitation to player.'
- '&e/f claim &8- &7Claim a land for your faction.'
- '&e/f unclaim &8- &7Unclaim land from your faction.'
- '&e/f kick &f<playerName> &8- &7Kick player from your faction.'
- '&e/f mod &f<playerName> &8- &7Set player role in faction.'
- '&e/f chat &f<Faction | Ally | Public> &8- &7Switch to Faction/Ally/Public chat.'
- '&e/f warp &8- &7Opens the warp menu.'
- '&e/f setwarp &8- &7Set a warp.'
- '&e/f perms &8- &7Change what players can do in your claims.'
- '&e/f upgrades &8- &7Upgrade your factions core.'
- '&e/f checkpoint &8- &7Set a faction checkpoint.'
- '&e/f tnt add/take <amount> &8- &7Faction Based TNT Bank.'
- '&e/f version &8- &7Display current faction version.'
- '&7&m--------------------&r &e/f help 3 &7&m-----------------------'
############################################################
# +------------------------------------------------------+ #
# | F Permission GUI | #
@ -389,29 +401,32 @@ help:
fperm-gui:
relation:
# GUI Name
name: 'Factions Permissions'
name: 'Faction Permissions'
# Amount of inventory rows, No larger than 5
rows: 3
rows: 4
# These are the slots where the relations are going to be placed on the first GUI
# Note: Slots start at 0 and end at one less that GUI size
#Setting a slot to -1 will disable it
slots:
recruit: 10
normal: 11
moderator: 12
truce: 13
ally: 14
enemy: 15
neutral: 16
coleader: 13
truce: 21
ally: 20
enemy: 22
neutral: 19
# Material to be displayed
materials:
recruit: WOOD_SWORD
normal: STONE_SWORD
normal: GOLD_SWORD
moderator: IRON_SWORD
coleader: DIAMOND_SWORD
truce: IRON_AXE
ally: DIAMOND_SWORD
ally: GOLD_AXE
enemy: DIAMOND_AXE
neutral: STONE
neutral: WOOD_AXE
# Dummy items using the Items lower down
dummy-items:
'0':
@ -428,13 +443,16 @@ fperm-gui:
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
# This is the item that all relation items are based off of
# Replacing {relation} with relation name eg: Moderator, Ally
# also replaces {relation-color} with relation color eg: Enemy;RED
@ -443,7 +461,7 @@ fperm-gui:
lore:
-
action:
name: 'Factions Permissions'
name: 'Faction Permissions'
rows: 4
# If this field exists colorable materials will be updated
# https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/DyeColor.html
@ -523,20 +541,20 @@ fperm-gui:
# {action-access} Access name eg: Allow, Deny
# {action-access-color} Access color eg: Allow;GREEN
placeholder-item:
name: '&8[&7{action}&8]'
name: '&e&l(!) &ePermission: &6&n{action}'
lore:
- '&8Access:'
- '&8[{action-access-color}{action-access}&8]'
- ''
- '&8Left click to &a&lAllow'
- '&8Right click to &c&lDeny'
- '&8Middle click to &lUndefine'
- '&6&l * &eStatus: &8[{action-access-color}{action-access}&8]'
- ''
- '&7Left click to &a&nAllow&7.'
- '&7Right click to &c&nDeny&7.'
- '&7Middle click to &7&nUndefine&7.'
# Back item will be take you to the previous GUI
back-item:
name: '&8&lBack'
name: '&c&l<- Back'
material: ARROW
lore:
- '&7Back button'
- '&7Click to return to previous menu.'
# Dummy Items
dummy-items:
# Dummy Item id, used to set the slots above
@ -556,6 +574,7 @@ fperm-gui:
fwarp-gui:
name: "Faction Warps"
rows: 3
password-timeout: 5
warp-slots:
- 11
- 12
@ -588,12 +607,16 @@ fwarp-gui:
- 26
warp-item:
material: STONE
name: "&8[&5&l{warp}&8]"
name: "&e&l(!) &eFaction Warp: &6&n{warp}"
# {warp-protected} Warp protection by password, Enabled & Disabled
# {warp-cost} Warp cost
lore:
- "&8Password: &l{warp-protected}"
- "&8Cost: &l{warp-cost}"
- ""
- "&6&l * &ePassword: &7{warp-protected}"
- "&6&l * &eCost: &7{warp-cost}"
- ""
- "&c&lNote: &7You need pay to teleport to"
- "&7a faction warp. Unless it's &nDisabled&7."
# Dummy Items
dummy-items:
# Dummy Item id, used to set the slots above
@ -604,6 +627,223 @@ fwarp-gui:
name: ' '
lore:
-
############################################################
# +------------------------------------------------------+ #
# | Faction Rules | #
# +------------------------------------------------------+ #
############################################################
frules:
Enabled: true
default-rules:
- '&cDefault Faction Rules :('
- '&cUse /f rules add <rule> to add a rule'
############################################################
# +------------------------------------------------------+ #
# | Faction TNT Bank | #
# +------------------------------------------------------+ #
############################################################
ftnt:
Enabled: true
############################################################
# +------------------------------------------------------+ #
# | Faction Checkpoints | #
# +------------------------------------------------------+ #
############################################################
checkpoints:
Enabled: true
############################################################
# +------------------------------------------------------+ #
# | Faction Near | #
# +------------------------------------------------------+ #
############################################################
fnear:
Enabled: true
Radius: 50
############################################################
# +------------------------------------------------------+ #
# | Faction Vault | #
# +------------------------------------------------------+ #
fvault:
Enabled: true
Item:
Name: '&e&l*&f&l*&e&l* &e&lFaction Vault &7(Place) &e&l*&f&l*&e&l*'
Lore:
- '&7Place this vault in your Faction claim, You will'
- '&7then be able to access it.'
- ''
- '&c&lNote: &7Once you have placed your'
- '&7faction vault, Access it by doing /f vault.'
############################################################
# +------------------------------------------------------+ #
# | Faction Upgrades | #
# +------------------------------------------------------+ #
############################################################
fupgrades:
Enabled: true
MainMenu:
Title: '{faction}''s Upgrade Menu'
DummyItem:
Name: '&f'
Type: STAINED_GLASS_PANE
Amount: 1
Damage: 7
Lore:
- ''
rows: 3
slots:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
Crops:
Crop-Boost:
level-1: 10
level-2: 20
level-3: 30
Cost:
level-1: 250000
level-2: 500000
level-3: 750000
CropItem:
Name: '&e&lUpgrade Growth Speed'
Type: WHEAT
Amount: 1
Damage: 0
Lore:
- '&7Increase growth speed of crops in claims.'
- '&7&o(Chance to Grow Two Levels)'
- ''
- '&e&lTier'
- '&f&l* &7Current Level: &n{level}'
- ''
- '&e&lPerks'
- '&f&l* &7Level 1 - &f10% Chance'
- '&7 - Cost: $250,000'
- '&f&l* &7Level 2 - &f20% Chance'
- '&7 - Cost: $500,000'
- '&f&l* &7Level 3 - &f30% Chance'
- '&7 - Cost: $750,000'
- ''
- '&e&lClick to &nUnlock'
slots:
- 10
EXP:
EXP-Boost:
level-1: 1.5
level-2: 2.0
level-3: 2.5
Cost:
level-1: 2000000
level-2: 4000000
level-3: 6000000
EXPItem:
Name: '&e&lUpgrade EXP Drop Rate'
Type: EXP_BOTTLE
Amount: 1
Damage: 0
Lore:
- '&7Increased Vanilla XP gained from monsters.'
- ''
- '&e&lTier'
- '&f&l* &7Current Level: &n{level}'
- ''
- '&e&lPerks'
- '&f&l* &7Level 1 - &f1.5x Multiplier'
- '&7 - Cost: $2,000,000'
- '&f&l* &7Level 2 - &f2.0x Multiplier'
- '&7 - Cost: $4,000,000'
- '&f&l* &7Level 3 - &f2.5x Multiplier'
- '&7 - Cost: $6,000,000'
- ''
- '&e&lClick to &nUnlock'
slots:
- 13
Spawners:
Spawner-Boost:
# This is a Percentage so .10 means 10% lowered spawner delay!
level-1: 0.10
level-2: 0.20
level-3: 0.30
Cost:
level-1: 1000000
level-2: 2000000
level-3: 3000000
SpawnerItem:
Name: '&e&lUpgrade Spawn Rate'
Type: MOB_SPAWNER
Amount: 1
Damage: 0
Lore:
- '&7Decreased mob spawner delay in claims.'
- ''
- '&e&lTier'
- '&f&l* &7Current Level: &n{level}'
- ''
- '&e&lPerks'
- '&f&l* &7Level 1 - &f10% Lower Delay'
- '&7 - Cost: $1,000,000'
- '&f&l* &7Level 2 - &f20% Lower Delay'
- '&7 - Cost: $2,000,000'
- '&f&l* &7Level 3 - &f30% Lower Delay'
- '&7 - Cost: $3,000,000'
- ''
- '&e&lClick to &nUnlock'
slots:
- 16
fbanners:
Item:
Name: '&e&l*&f&l*&e&l* &e&lWar Banner &7(Place) &e&l*&f&l*&e&l*'
Lore:
- '&7Place this banner in the &nWarzone.&7 This'
- '&7will create a &nWarp Point&7 for your faction members.'
- ''
- '&e&lEffects'
- '&e&l* &fStrength II'
- '&e&l* &fSpeed II'
Banner-Cost: 5000 #The amount charged to change a banner into a War Banner
Banner-Time: 60 #IN SECONDS - This is how long the banner will last.
Banner-Place-Cooldown: 300
Banner-Effect-Radius: 16
Effects:
- INCREASE_DAMAGE:2
- SPEED:2
BannerHolo: '&c{Faction}''s War Banner'
#Title when moving between chunks
Title:
Show-Title: true
Format:
Title: '{Faction}'
Subtitle: '{Description}'
############################################################
# +------------------------------------------------------+ #

View File

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

View File

@ -1,7 +1,7 @@
name: Factions
version: ${project.version}-b${build.number}
version: ${project.version}-SF-1.0.17
main: com.massivecraft.factions.P
authors: [Olof Larsson, Brett Flannigan, drtshock]
authors: [Olof Larsson, Brett Flannigan, drtshock, ProSavage]
softdepend: [PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap, FactionsTop]
commands:
factions:
@ -103,6 +103,10 @@ permissions:
factions.mapheight: true
factions.ban: true
factions.fly: true
factions.tnt: true
factions.checkpoint: true
factions.rules: true
factions.setwarp: true
factions.admin:
description: hand over your admin rights
factions.admin.any:
@ -286,3 +290,25 @@ permissions:
description: Ban players from Factions
factions.fly:
description: Allow use of /f fly
factions.rules:
description: add/remove/set rules for your own faction.
factions.checkpoint:
description: set or go to faction checkpoint
factions.tnt:
description: add/take from faction bank
factions.near:
description: get nearby faction members
factions.upgrades:
description: open upgrade menu
factions.freecam:
description: enable/disable freecam
factions.getvault:
description: get faction vault item
factions.coleader:
description: promote member to co leader
factions.tpbanner:
description: teleport to banner
factions.banner:
description: create banner
factions.killholos:
description: kill invisible holograms