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

334 lines
7.8 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;
2011-09-24 12:04:49 +02:00
import com.massivecraft.factions.struct.ChatMode;
2011-07-18 22:06:02 +02:00
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
2015-05-25 06:42:31 +02:00
import com.massivecraft.factions.util.WarmUpUtil;
2018-02-11 00:59:21 +01:00
import mkremins.fanciful.FancyMessage;
2014-04-04 20:55:21 +02:00
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
2014-04-04 20:55:21 +02:00
import org.bukkit.entity.Player;
2014-11-06 01:36:47 +01:00
import java.util.List;
2011-02-06 13:36:11 +01:00
/**
2014-04-04 20:55:21 +02:00
* Logged in players always have exactly one FPlayer instance. Logged out players may or may not have an FPlayer
* instance. They will always have one if they are part of a faction. This is because only players with a faction are
* saved to disk (in order to not waste disk space).
* <p/>
2011-03-23 12:00:38 +01:00
* The FPlayer is linked to a minecraft player using the player name.
2014-04-04 20:55:21 +02:00
* <p/>
* The same instance is always returned for the same player. This means you can use the == operator. No .equals method
* necessary.
*/
2014-11-06 01:36:47 +01:00
public interface FPlayer extends EconomyParticipator {
public void login();
public void logout();
public Faction getFaction();
public String getFactionId();
public boolean hasFaction();
public void setFaction(Faction faction);
public boolean willAutoLeave();
public void setAutoLeave(boolean autoLeave);
public long getLastFrostwalkerMessage();
public void setLastFrostwalkerMessage();
public void setMonitorJoins(boolean monitor);
public boolean isMonitoringJoins();
public Role getRole();
public void setRole(Role role);
2018-03-05 02:27:48 +01:00
public boolean shouldTakeFallDamage();
public void setTakeFallDamage(boolean fallDamage);
public double getPowerBoost();
public void setPowerBoost(double powerBoost);
public Faction getAutoClaimFor();
public void setAutoClaimFor(Faction faction);
public boolean isAutoSafeClaimEnabled();
2014-04-04 20:55:21 +02:00
public void setIsAutoSafeClaimEnabled(boolean enabled);
2014-04-04 20:55:21 +02:00
public boolean isAutoWarClaimEnabled();
2014-04-04 20:55:21 +02:00
public void setIsAutoWarClaimEnabled(boolean enabled);
2014-04-04 20:55:21 +02:00
public boolean isAdminBypassing();
2014-04-04 20:55:21 +02:00
public boolean isVanished();
public void setIsAdminBypassing(boolean val);
2014-04-04 20:55:21 +02:00
public void setChatMode(ChatMode chatMode);
2014-04-04 20:55:21 +02:00
public ChatMode getChatMode();
2014-04-04 20:55:21 +02:00
2015-02-25 15:38:03 +01:00
public void setIgnoreAllianceChat(boolean ignore);
public boolean isIgnoreAllianceChat();
public void setSpyingChat(boolean chatSpying);
2014-04-04 20:55:21 +02:00
public boolean isSpyingChat();
2014-04-04 20:55:21 +02:00
public boolean showScoreboard();
public void setShowScoreboard(boolean show);
2014-04-04 20:55:21 +02:00
// FIELD: account
public String getAccountId();
2014-04-04 20:55:21 +02:00
public void resetFactionData(boolean doSpoutUpdate);
public void resetFactionData();
public long getLastLoginTime();
public void setLastLoginTime(long lastLoginTime);
public boolean isMapAutoUpdating();
2014-04-04 20:55:21 +02:00
public void setMapAutoUpdating(boolean mapAutoUpdating);
2014-04-04 20:55:21 +02:00
public boolean hasLoginPvpDisabled();
2014-04-04 20:55:21 +02:00
public FLocation getLastStoodAt();
2014-04-04 20:55:21 +02:00
public void setLastStoodAt(FLocation flocation);
2014-04-04 20:55:21 +02:00
public String getTitle();
public void setTitle(CommandSender sender, String title);
public String getName();
public String getTag();
2014-04-04 20:55:21 +02:00
// Base concatenations:
public String getNameAndSomething(String something);
2014-04-04 20:55:21 +02:00
public String getNameAndTitle();
2014-04-04 20:55:21 +02:00
public String getNameAndTag();
2014-04-04 20:55:21 +02:00
// Colored concatenations:
// These are used in information messages
public String getNameAndTitle(Faction faction);
public String getNameAndTitle(FPlayer fplayer);
2014-04-04 20:55:21 +02:00
// Chat Tag:
// These are injected into the format of global chat messages.
public String getChatTag();
2014-04-04 20:55:21 +02:00
// Colored Chat Tag
public String getChatTag(Faction faction);
2014-04-04 20:55:21 +02:00
public String getChatTag(FPlayer fplayer);
2014-04-04 20:55:21 +02:00
public int getKills();
public int getDeaths();
public void takeMoney(int amt);
public boolean hasMoney(int amt);
//inspect Stuff
public boolean isInspectMode();
public void setInspectMode(boolean status);
// Fly Checks
public Boolean canflyinWilderness();
public Boolean canflyinWarzone();
public Boolean canflyinSafezone();
public Boolean canflyinEnemy();
public Boolean canflyinAlly();
public Boolean canflyinTruce();
public Boolean canflyinNeutral();
2014-04-04 20:55:21 +02:00
// -------------------------------
// Relation and relation colors
// -------------------------------
@Override
public String describeTo(RelationParticipator that, boolean ucfirst);
2014-04-04 20:55:21 +02:00
@Override
public String describeTo(RelationParticipator that);
2014-04-04 20:55:21 +02:00
@Override
public Relation getRelationTo(RelationParticipator rp);
2014-04-04 20:55:21 +02:00
@Override
public Relation getRelationTo(RelationParticipator rp, boolean ignorePeaceful);
2014-04-04 20:55:21 +02:00
public Relation getRelationToLocation();
2014-04-04 20:55:21 +02:00
@Override
public ChatColor getColorTo(RelationParticipator rp);
2014-04-04 20:55:21 +02:00
public String getRolePrefix();
2014-04-04 20:55:21 +02:00
//----------------------------------------------//
// Health
//----------------------------------------------//
public void heal(int amnt);
2014-04-04 20:55:21 +02:00
//----------------------------------------------//
// Power
//----------------------------------------------//
public double getPower();
public void alterPower(double delta);
public double getPowerMax();
public double getPowerMin();
public int getPowerRounded();
public int getPowerMaxRounded();
public int getPowerMinRounded();
public void updatePower();
public void losePowerFromBeingOffline();
public void onDeath();
2014-04-04 20:55:21 +02:00
//----------------------------------------------//
// Territory
//----------------------------------------------//
public boolean isInOwnTerritory();
public boolean isInOthersTerritory();
public boolean isInAllyTerritory();
public boolean isInNeutralTerritory();
public boolean isInEnemyTerritory();
public void sendFactionHereMessage(Faction from);
2014-04-04 20:55:21 +02:00
// -------------------------------
// Actions
// -------------------------------
public void leave(boolean makePay);
2014-04-04 20:55:21 +02:00
public boolean canClaimForFaction(Faction forFaction);
public boolean canClaimForFactionAtLocation(Faction forFaction, Location location, boolean notifyFailure);
public boolean canClaimForFactionAtLocation(Faction forFaction, FLocation location, boolean notifyFailure);
public boolean attemptClaim(Faction forFaction, Location location, boolean notifyFailure);
public boolean attemptClaim(Faction forFaction, FLocation location, boolean notifyFailure);
2018-03-26 23:43:15 +02:00
public void setInVault(boolean status);
public boolean isInVault();
public void msg(String str, Object... args);
public String getId();
public Player getPlayer();
public boolean isOnline();
public void sendMessage(String message);
public void sendMessage(List<String> messages);
2018-02-11 00:59:21 +01:00
public void sendFancyMessage(FancyMessage message);
public void sendFancyMessage(List<FancyMessage> message);
public int getMapHeight();
public void setMapHeight(int height);
2018-02-11 00:59:21 +01:00
public boolean isOnlineAndVisibleTo(Player me);
public void remove();
public boolean isOffline();
public void setId(String id);
2015-05-25 06:42:31 +02:00
2018-03-04 23:13:32 +01:00
public boolean isFlying();
public void setFlying(boolean fly);
public void setFFlying(boolean fly, boolean damage);
public boolean canFlyAtLocation();
public boolean canFlyAtLocation(FLocation location);
2018-03-26 23:43:15 +02:00
public boolean isEnteringPassword();
public void setEnteringPassword(boolean toggle, String warp);
public String getEnteringWarp();
public boolean checkIfNearbyEnemies();
2015-05-25 06:42:31 +02:00
// -------------------------------
// Warmups
// -------------------------------
public boolean isWarmingUp();
public WarmUpUtil.Warmup getWarmupType();
public void addWarmup(WarmUpUtil.Warmup warmup, int taskId);
public void stopWarmup();
public void clearWarmup();
2018-03-26 23:43:15 +02:00
}