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

257 lines
6.1 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;
2014-04-04 20:55:21 +02:00
import org.bukkit.ChatColor;
import org.bukkit.Location;
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 void setMonitorJoins(boolean monitor);
public boolean isMonitoringJoins();
public Role getRole();
public void setRole(Role role);
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(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();
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
//----------------------------------------------//
// 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 attemptClaim(Faction forFaction, Location location, boolean notifyFailure);
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);
public boolean isOnlineAndVisibleTo(Player me);
public void remove();
public boolean isOffline();
public void setId(String id);
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();
}