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

373 lines
7.7 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
import com.massivecraft.factions.event.FactionDisbandEvent.PlayerDisbandReason;
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;
2019-05-25 01:30:37 +02:00
import com.massivecraft.factions.zcore.fupgrades.UpgradeType;
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 {
boolean altInvited(FPlayer fplayer);
void deinviteAlt(FPlayer alt);
void deinviteAllAlts();
void altInvite(FPlayer fplayer);
boolean addAltPlayer(FPlayer fplayer);
boolean removeAltPlayer(FPlayer fplayer);
Set<FPlayer> getAltPlayers();
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 getFocused();
2018-11-22 08:09:58 +01:00
void setFocused(String setFocused);
2018-11-22 08:09:58 +01:00
String getId();
void setId(String id);
void invite(FPlayer fplayer);
void deinvite(FPlayer fplayer);
2018-03-26 23:43:15 +02:00
2019-05-25 01:30:37 +02:00
void setUpgrade(UpgradeType upgrade, int level);
2018-03-26 23:43:15 +02:00
2019-05-25 01:30:37 +02:00
int getUpgrade(UpgradeType upgrade);
2014-04-04 20:55:21 +02:00
boolean isInvited(FPlayer fplayer);
void ban(FPlayer target, FPlayer banner);
2019-07-01 05:22:28 +02:00
int getPoints();
void setPoints(int points);
2019-05-15 04:07:59 +02:00
int getStrikes();
void setStrikes(int strikes);
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 getChestInventory();
2018-03-26 23:43:15 +02:00
void setChestSize(int chestSize);
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();
boolean isSystemFaction();
@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 setDefaultPerms();
void disband(Player disbander);
void disband(Player disbander, PlayerDisbandReason reason);
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);
@Override
ChatColor getColorTo(RelationParticipator rp);
Relation getRelationWish(Faction otherFaction);
void setRelationWish(Faction otherFaction, Relation relation);
int getRelationCount(Relation relation);
// ----------------------------------------------//
// Power
// ----------------------------------------------//
double getPower();
double getPowerMax();
int getPowerRounded();
int getPowerMaxRounded();
int getLandRounded();
2014-04-04 20:55:21 +02:00
int getLandRoundedInWorld(String worldName);
2014-04-04 20:55:21 +02:00
// -------------------------------
// FPlayers
// -------------------------------
boolean hasLandInflation();
// maintain the reference list of FPlayers in this faction
void refreshFPlayers();
boolean addFPlayer(FPlayer fplayer);
boolean removeFPlayer(FPlayer fplayer);
2015-01-03 01:33:34 +01:00
int getSize();
Set<FPlayer> getFPlayers();
Set<FPlayer> getFPlayersWhereOnline(boolean online);
2018-03-05 02:40:36 +01:00
Set<FPlayer> getFPlayersWhereOnline(boolean online, FPlayer viewer);
FPlayer getFPlayerAdmin();
2018-12-24 01:20:54 +01:00
FPlayer getFPlayerLeader();
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();
void promoteNewLeader(boolean autoLeave);
Role getDefaultRole();
void setDefaultRole(Role role);
// ----------------------------------------------//
// Messages
// ----------------------------------------------//
void msg(String message, Object... args);
void sendMessage(String message);
2014-04-04 20:55:21 +02:00
// ----------------------------------------------//
// Ownership of specific claims
// ----------------------------------------------//
void sendMessage(List<String> messages);
2014-04-04 20:55:21 +02:00
Map<FLocation, Set<String>> getClaimOwnership();
void clearAllClaimOwnership();
void clearClaimOwnership(FLocation loc);
void clearClaimOwnership(FPlayer player);
int getCountOfClaimsWithOwners();
2014-04-04 20:55:21 +02:00
boolean doesLocationHaveOwnersSet(FLocation loc);
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();
2018-09-21 08:29:28 +02:00
Set<FLocation> getAllClaims();
2018-09-21 08:29:28 +02:00
String getPaypal();
void paypalSet(String paypal);
2018-11-22 08:09:58 +01:00
2011-02-06 13:36:11 +01:00
}