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;
|
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
|
|
|
|
2011-03-22 15:45:41 +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.
|
2011-03-22 15:45:41 +01:00
|
|
|
*/
|
|
|
|
|
2014-11-06 01:36:47 +01:00
|
|
|
public interface FPlayer extends EconomyParticipator {
|
2014-10-19 07:37:25 +02:00
|
|
|
public Faction getFaction();
|
|
|
|
|
|
|
|
public String getFactionId();
|
|
|
|
|
|
|
|
public boolean hasFaction();
|
|
|
|
|
|
|
|
public void setFaction(Faction faction);
|
|
|
|
|
|
|
|
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
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public void setIsAutoSafeClaimEnabled(boolean enabled);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public boolean isAutoWarClaimEnabled();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public void setIsAutoWarClaimEnabled(boolean enabled);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public boolean isAdminBypassing();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public void setIsAdminBypassing(boolean val);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public void setChatMode(ChatMode chatMode);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public ChatMode getChatMode();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public void setSpyingChat(boolean chatSpying);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public boolean isSpyingChat();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
// FIELD: account
|
2014-10-19 07:37:25 +02:00
|
|
|
public String getAccountId();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +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
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public void setMapAutoUpdating(boolean mapAutoUpdating);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public boolean hasLoginPvpDisabled();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public FLocation getLastStoodAt();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public void setLastStoodAt(FLocation flocation);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +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:
|
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public String getNameAndSomething(String something);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public String getNameAndTitle();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public String getNameAndTag();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
// Colored concatenations:
|
|
|
|
// These are used in information messages
|
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public String getNameAndTitle(Faction faction);
|
|
|
|
|
|
|
|
public String getNameAndTitle(FPlayer fplayer);
|
2012-03-13 15:48:31 +01:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
// Chat Tag:
|
|
|
|
// These are injected into the format of global chat messages.
|
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public String getChatTag();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
// Colored Chat Tag
|
2014-10-19 07:37:25 +02:00
|
|
|
public String getChatTag(Faction faction);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public String getChatTag(FPlayer fplayer);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
// -------------------------------
|
|
|
|
// Relation and relation colors
|
|
|
|
// -------------------------------
|
|
|
|
|
|
|
|
@Override
|
2014-10-19 07:37:25 +02:00
|
|
|
public String describeTo(RelationParticipator that, boolean ucfirst);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
@Override
|
2014-10-19 07:37:25 +02:00
|
|
|
public String describeTo(RelationParticipator that);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
@Override
|
2014-10-19 07:37:25 +02:00
|
|
|
public Relation getRelationTo(RelationParticipator rp);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
@Override
|
2014-10-19 07:37:25 +02:00
|
|
|
public Relation getRelationTo(RelationParticipator rp, boolean ignorePeaceful);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public Relation getRelationToLocation();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
@Override
|
2014-10-19 07:37:25 +02:00
|
|
|
public ChatColor getColorTo(RelationParticipator rp);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
//----------------------------------------------//
|
|
|
|
// Health
|
|
|
|
//----------------------------------------------//
|
2014-10-19 07:37:25 +02:00
|
|
|
public void heal(int amnt);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------//
|
|
|
|
// Power
|
|
|
|
//----------------------------------------------//
|
2014-10-19 07:37:25 +02:00
|
|
|
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
|
|
|
|
//----------------------------------------------//
|
2014-10-19 07:37:25 +02:00
|
|
|
public boolean isInOwnTerritory();
|
|
|
|
|
|
|
|
public boolean isInOthersTerritory();
|
|
|
|
|
|
|
|
public boolean isInAllyTerritory();
|
|
|
|
|
|
|
|
public boolean isInNeutralTerritory();
|
|
|
|
|
|
|
|
public boolean isInEnemyTerritory();
|
|
|
|
|
|
|
|
public void sendFactionHereMessage();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-09-01 21:56:32 +02:00
|
|
|
/**
|
|
|
|
* Check if the scoreboard should be shown. Simple method to be used by above method.
|
2014-10-18 10:54:45 +02:00
|
|
|
*
|
2014-09-01 21:56:32 +02:00
|
|
|
* @param toShow Faction to be shown.
|
2014-10-18 10:54:45 +02:00
|
|
|
*
|
2014-09-01 21:56:32 +02:00
|
|
|
* @return true if should show, otherwise false.
|
|
|
|
*/
|
2014-10-19 07:37:25 +02:00
|
|
|
public boolean shouldShowScoreboard(Faction toShow);
|
2014-09-01 21:56:32 +02:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
// -------------------------------
|
|
|
|
// Actions
|
|
|
|
// -------------------------------
|
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public void leave(boolean makePay);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +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);
|
2014-10-25 20:22:41 +02:00
|
|
|
}
|