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

450 lines
9.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.missions.Mission;
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;
import com.massivecraft.factions.zcore.frame.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 {
String getMemberRoleId();
void setMemberRoleId(String roleId);
String getGuildId();
void setGuildId(String id);
String getWallNotifyChannelId();
void setWallNotifyChannelId(String channelId);
String getBufferNotifyChannelId();
void setBufferNotifyChannelId(String channelId);
String getWeeWooChannelId();
void setWeeWooChannelId(String channelId);
String getNotifyFormat();
void setNotifyFormat(String format);
String getWeeWooFormat();
void setWeeWooFormat(String format);
String getFactionChatChannelId();
void setFactionChatChannelId(String channelId);
2019-09-21 19:02:51 +02:00
String getDiscord();
void setDiscord(String link);
void checkPerms();
2019-09-16 00:08:36 +02:00
double getReinforcedArmor();
void setReinforcedArmor(double percent);
int getWarpsLimit();
void setWarpsLimit(int limit);
int getTntBankLimit();
void setTntBankLimit(int limit);
int getWallCheckMinutes();
void setWallCheckMinutes(int minutes);
int getBufferCheckMinutes();
void setBufferCheckMinutes(int minutes);
Map<Long, String> getChecks();
Map<UUID, Integer> getPlayerBufferCheckCount();
Map<UUID, Integer> getPlayerWallCheckCount();
boolean isWeeWoo();
void setWeeWoo(boolean weeWoo);
boolean altInvited(FPlayer fplayer);
Map<String, Mission> getMissions();
List<String> getCompletedMissions();
void deinviteAlt(FPlayer alt);
void deinviteAllAlts();
void altInvite(FPlayer fplayer);
boolean addAltPlayer(FPlayer fplayer);
2014-04-04 20:55:21 +02:00
boolean removeAltPlayer(FPlayer fplayer);
Set<FPlayer> getAltPlayers();
HashMap<String, List<String>> getAnnouncements();
ConcurrentHashMap<String, LazyLocation> getWarps();
LazyLocation getWarp(String name);
2017-12-19 11:10:52 +01:00
void setWarp(String name, LazyLocation loc);
2017-12-19 11:10:52 +01:00
boolean isWarp(String name);
2017-12-19 11:10:52 +01:00
boolean hasWarpPassword(String warp);
boolean isWarpPassword(String warp, String password);
void setWarpPassword(String warp, String password);
boolean removeWarp(String name);
void clearWarps();
int getMaxVaults();
2014-04-04 20:55:21 +02:00
void setMaxVaults(int value);
2014-04-04 20:55:21 +02:00
void addAnnouncement(FPlayer fPlayer, String msg);
2014-04-04 20:55:21 +02:00
void sendUnreadAnnouncements(FPlayer fPlayer);
2018-11-22 08:09:58 +01:00
void removeAnnouncements(FPlayer fPlayer);
2018-11-22 08:09:58 +01:00
Set<String> getInvites();
String getFocused();
void setFocused(String setFocused);
String getId();
2018-03-26 23:43:15 +02:00
void setId(String id);
2018-03-26 23:43:15 +02:00
void invite(FPlayer fplayer);
2014-04-04 20:55:21 +02:00
void deinvite(FPlayer fplayer);
void setUpgrade(UpgradeType upgrade, int level);
int getUpgrade(UpgradeType upgrade);
2019-07-01 05:22:28 +02:00
boolean isInvited(FPlayer fplayer);
2019-07-01 05:22:28 +02:00
void ban(FPlayer target, FPlayer banner);
2019-05-15 04:07:59 +02:00
int getPoints();
2019-05-15 04:07:59 +02:00
void setPoints(int points);
int getStrikes();
void setStrikes(int strikes);
2018-03-26 23:43:15 +02:00
void unban(FPlayer player);
2018-03-26 23:43:15 +02:00
boolean isBanned(FPlayer player);
2018-03-26 23:43:15 +02:00
Set<BanInfo> getBannedPlayers();
2018-03-26 23:43:15 +02:00
HashMap<Integer, String> getRulesMap();
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();
2011-02-06 13:36:11 +01:00
void setVault(Location vaultLocation);
2011-02-06 13:36:11 +01:00
Inventory getChestInventory();
2014-04-04 20:55:21 +02:00
void setChestSize(int chestSize);
2014-04-04 20:55:21 +02:00
void setBannerPattern(ItemStack banner);
2014-04-04 20:55:21 +02: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);
boolean getOpen();
void setOpen(boolean isOpen);
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);
2014-04-04 20:55:21 +02:00
String getComparisonTag();
2014-04-04 20:55:21 +02:00
String getDescription();
2014-04-04 20:55:21 +02:00
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);
2020-03-25 05:56:39 +01:00
void deleteHome();
long getFoundedDate();
void setFoundedDate(long newDate);
void confirmValidHome();
String getAccountId();
Integer getPermanentPower();
void setPermanentPower(Integer permanentPower);
boolean hasPermanentPower();
double getPowerBoost();
void setPowerBoost(double powerBoost);
boolean noPvPInTerritory();
boolean noMonstersInTerritory();
boolean isNormal();
2014-04-04 20:55:21 +02:00
boolean isSystemFaction();
@Deprecated
boolean isNone();
boolean isWilderness();
boolean isSafeZone();
boolean isWarZone();
boolean isPlayerFreeType();
boolean isPowerFrozen();
void setLastDeath(long time);
int getKills();
2018-02-06 04:46:53 +01:00
int getDeaths();
Access getAccess(Permissable permissable, PermissableAction permissableAction);
Access getAccess(FPlayer player, PermissableAction permissableAction);
2014-04-04 20:55:21 +02:00
boolean setPermission(Permissable permissable, PermissableAction permissableAction, Access access);
void resetPerms();
2014-04-04 20:55:21 +02:00
void setDefaultPerms();
2014-04-04 20:55:21 +02:00
void disband(Player disbander);
2014-04-04 20:55:21 +02:00
void disband(Player disbander, PlayerDisbandReason reason);
2014-04-04 20:55:21 +02:00
// -------------------------------
// Relation and relation colors
// -------------------------------
Map<Permissable, Map<PermissableAction, Access>> getPermissions();
@Override
String describeTo(RelationParticipator that, boolean ucfirst);
@Override
String describeTo(RelationParticipator that);
@Override
Relation getRelationTo(RelationParticipator rp);
@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);
2014-04-04 20:55:21 +02:00
// ----------------------------------------------//
// Power
// ----------------------------------------------//
double getPower();
2014-04-04 20:55:21 +02:00
double getPowerMax();
int getPowerRounded();
int getPowerMaxRounded();
int getLandRounded();
int getLandRoundedInWorld(String worldName);
2015-01-03 01:33:34 +01:00
// -------------------------------
// FPlayers
// -------------------------------
boolean hasLandInflation();
// maintain the reference list of FPlayers in this faction
void refreshFPlayers();
2018-03-05 02:40:36 +01:00
boolean addFPlayer(FPlayer fplayer);
boolean removeFPlayer(FPlayer fplayer);
2018-12-24 01:20:54 +01:00
int getSize();
Set<FPlayer> getFPlayers();
Set<FPlayer> getFPlayersWhereOnline(boolean online);
Set<FPlayer> getFPlayersWhereOnline(boolean online, FPlayer viewer);
FPlayer getFPlayerAdmin();
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();
2014-04-04 20:55:21 +02:00
void promoteNewLeader(boolean autoLeave);
Role getDefaultRole();
2014-04-04 20:55:21 +02:00
void setDefaultRole(Role role);
// ----------------------------------------------//
// Messages
// ----------------------------------------------//
void msg(String message, Object... args);
void sendMessage(String message);
// ----------------------------------------------//
// 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();
boolean doesLocationHaveOwnersSet(FLocation loc);
boolean isPlayerInOwnerList(FPlayer player, FLocation loc);
void setPlayerAsOwner(FPlayer player, FLocation loc);
2018-09-21 08:29:28 +02:00
void removePlayerAsOwner(FPlayer player, FLocation loc);
2018-09-21 08:29:28 +02:00
Set<String> getOwnerList(FLocation loc);
String getOwnerListString(FLocation loc);
boolean playerHasOwnershipRights(FPlayer fplayer, FLocation loc);
// ----------------------------------------------//
// Persistance and entity management
// ----------------------------------------------//
void remove();
Set<FLocation> getAllClaims();
String getPaypal();
void paypalSet(String paypal);
// -------------------------------
// Shields
// -------------------------------
2011-02-06 13:36:11 +01:00
}