Saber-Factions/src/main/java/com/massivecraft/factions/Faction.java

330 lines
7.3 KiB
Java
Raw Normal View History

2011-07-18 22:06:02 +02:00
package com.massivecraft.factions;
2011-02-06 13:36:11 +01:00
2011-10-12 17:25:01 +02:00
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.iface.RelationParticipator;
import com.massivecraft.factions.struct.BanInfo;
2011-07-18 22:06:02 +02:00
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.LazyLocation;
import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.Permissable;
2018-02-03 21:50:12 +01:00
import com.massivecraft.factions.zcore.fperms.PermissableAction;
2014-04-04 20:55:21 +02:00
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
2018-03-26 23:43:15 +02:00
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
2014-04-04 20:55:21 +02:00
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
2014-04-04 20:55:21 +02:00
public interface Faction extends EconomyParticipator {
HashMap<String, List<String>> getAnnouncements();
2014-04-04 20:55:21 +02:00
ConcurrentHashMap<String, LazyLocation> getWarps();
LazyLocation getWarp(String name);
void setWarp(String name, LazyLocation loc);
boolean isWarp(String name);
boolean hasWarpPassword(String warp);
2017-12-19 11:10:52 +01:00
boolean isWarpPassword(String warp, String password);
2017-12-19 11:10:52 +01:00
void setWarpPassword(String warp, String password);
2017-12-19 11:10:52 +01:00
boolean removeWarp(String name);
void clearWarps();
int getMaxVaults();
void setMaxVaults(int value);
void addAnnouncement(FPlayer fPlayer, String msg);
void sendUnreadAnnouncements(FPlayer fPlayer);
2014-04-04 20:55:21 +02:00
void removeAnnouncements(FPlayer fPlayer);
2014-04-04 20:55:21 +02:00
Set<String> getInvites();
2014-04-04 20:55:21 +02:00
String getId();
void setId(String id);
void invite(FPlayer fplayer);
void deinvite(FPlayer fplayer);
2018-03-26 23:43:15 +02:00
void setUpgrades(String key, int level);
2018-03-26 23:43:15 +02:00
int getUpgrade(String key);
2014-04-04 20:55:21 +02:00
boolean isInvited(FPlayer fplayer);
void ban(FPlayer target, FPlayer banner);
void unban(FPlayer player);
boolean isBanned(FPlayer player);
Set<BanInfo> getBannedPlayers();
2018-03-26 23:43:15 +02:00
HashMap<Integer, String> getRulesMap();
2018-03-26 23:43:15 +02:00
void setRule(int index, String rule);
2018-03-26 23:43:15 +02:00
void addRule(String rule);
2018-03-26 23:43:15 +02:00
void removeRule(int index);
2018-03-26 23:43:15 +02:00
void clearRules();
2018-03-26 23:43:15 +02:00
Location getCheckpoint();
2018-03-26 23:43:15 +02:00
void setCheckpoint(Location location);
2018-03-26 23:43:15 +02:00
void addTnt(int amt);
2018-03-26 23:43:15 +02:00
void takeTnt(int amt);
2018-03-26 23:43:15 +02:00
Location getVault();
2018-03-26 23:43:15 +02:00
void setVault(Location vaultLocation);
2018-03-26 23:43:15 +02:00
Inventory getChest();
2018-03-26 23:43:15 +02:00
void setChest(Inventory inventory);
2011-02-06 13:36:11 +01:00
void setBannerPattern(ItemStack banner);
2011-02-06 13:36:11 +01:00
ItemStack getBanner();
2014-04-04 20:55:21 +02:00
int getTnt();
2014-04-04 20:55:21 +02:00
String getRule(int index);
2014-04-04 20:55:21 +02:00
boolean getOpen();
2014-04-04 20:55:21 +02:00
void setOpen(boolean isOpen);
2014-04-04 20:55:21 +02:00
boolean isPeaceful();
void setPeaceful(boolean isPeaceful);
boolean getPeacefulExplosionsEnabled();
void setPeacefulExplosionsEnabled(boolean val);
boolean noExplosionsInTerritory();
boolean isPermanent();
void setPermanent(boolean isPermanent);
String getTag();
void setTag(String str);
String getTag(String prefix);
String getTag(Faction otherFaction);
String getTag(FPlayer otherFplayer);
String getComparisonTag();
String getDescription();
void setDescription(String value);
2014-04-04 20:55:21 +02:00
boolean hasHome();
2014-04-04 20:55:21 +02:00
Location getHome();
2014-04-04 20:55:21 +02:00
void setHome(Location home);
2014-04-04 20:55:21 +02:00
long getFoundedDate();
2014-04-04 20:55:21 +02:00
void setFoundedDate(long newDate);
2014-04-04 20:55:21 +02:00
void confirmValidHome();
String getAccountId();
Integer getPermanentPower();
void setPermanentPower(Integer permanentPower);
boolean hasPermanentPower();
double getPowerBoost();
void setPowerBoost(double powerBoost);
boolean noPvPInTerritory();
boolean noMonstersInTerritory();
boolean isNormal();
@Deprecated
boolean isNone();
boolean isWilderness();
boolean isSafeZone();
boolean isWarZone();
2014-04-04 20:55:21 +02:00
boolean isPlayerFreeType();
boolean isPowerFrozen();
void setLastDeath(long time);
int getKills();
int getDeaths();
Access getAccess(Permissable permissable, PermissableAction permissableAction);
Access getAccess(FPlayer player, PermissableAction permissableAction);
void setPermission(Permissable permissable, PermissableAction permissableAction, Access access);
void resetPerms();
2018-02-06 04:46:53 +01:00
void disband(Player disbander);
2014-04-04 20:55:21 +02:00
// -------------------------------
// Relation and relation colors
// -------------------------------
Map<Permissable, Map<PermissableAction, Access>> getPermissions();
2014-04-04 20:55:21 +02:00
@Override
String describeTo(RelationParticipator that, boolean ucfirst);
2014-04-04 20:55:21 +02:00
@Override
String describeTo(RelationParticipator that);
2014-04-04 20:55:21 +02:00
@Override
Relation getRelationTo(RelationParticipator rp);
2014-04-04 20:55:21 +02:00
@Override
Relation getRelationTo(RelationParticipator rp, boolean ignorePeaceful);
2014-04-04 20:55:21 +02:00
@Override
ChatColor getColorTo(RelationParticipator rp);
Relation getRelationWish(Faction otherFaction);
void setRelationWish(Faction otherFaction, Relation relation);
int getRelationCount(Relation relation);
// ----------------------------------------------//
2014-04-04 20:55:21 +02:00
// Power
// ----------------------------------------------//
double getPower();
double getPowerMax();
int getPowerRounded();
int getPowerMaxRounded();
int getLandRounded();
int getLandRoundedInWorld(String worldName);
2014-04-04 20:55:21 +02:00
// -------------------------------
// FPlayers
// -------------------------------
boolean hasLandInflation();
2014-04-04 20:55:21 +02:00
// maintain the reference list of FPlayers in this faction
void refreshFPlayers();
boolean addFPlayer(FPlayer fplayer);
boolean removeFPlayer(FPlayer fplayer);
int getSize();
2015-01-03 01:33:34 +01:00
Set<FPlayer> getFPlayers();
Set<FPlayer> getFPlayersWhereOnline(boolean online);
Set<FPlayer> getFPlayersWhereOnline(boolean online, FPlayer viewer);
2018-03-05 02:40:36 +01:00
FPlayer getFPlayerAdmin();
ArrayList<FPlayer> getFPlayersWhereRole(Role role);
ArrayList<Player> getOnlinePlayers();
// slightly faster check than getOnlinePlayers() if you just want to see if
// there are any players online
boolean hasPlayersOnline();
void memberLoggedOff();
// used when current leader is about to be removed from the faction;
// promotes new leader, or disbands faction if no other members left
void promoteNewLeader();
Role getDefaultRole();
void setDefaultRole(Role role);
// ----------------------------------------------//
2014-04-04 20:55:21 +02:00
// Messages
// ----------------------------------------------//
void msg(String message, Object... args);
void sendMessage(String message);
// ----------------------------------------------//
2014-04-04 20:55:21 +02:00
// Ownership of specific claims
// ----------------------------------------------//
2014-04-04 20:55:21 +02:00
void sendMessage(List<String> messages);
Map<FLocation, Set<String>> getClaimOwnership();
2014-04-04 20:55:21 +02:00
void clearAllClaimOwnership();
void clearClaimOwnership(FLocation loc);
void clearClaimOwnership(FPlayer player);
int getCountOfClaimsWithOwners();
boolean doesLocationHaveOwnersSet(FLocation loc);
2014-04-04 20:55:21 +02:00
boolean isPlayerInOwnerList(FPlayer player, FLocation loc);
void setPlayerAsOwner(FPlayer player, FLocation loc);
void removePlayerAsOwner(FPlayer player, FLocation loc);
Set<String> getOwnerList(FLocation loc);
String getOwnerListString(FLocation loc);
boolean playerHasOwnershipRights(FPlayer fplayer, FLocation loc);
// ----------------------------------------------//
// Persistance and entity management
// ----------------------------------------------//
void remove();
Set<FLocation> getAllClaims();
2011-02-06 13:36:11 +01:00
}