TF-EssentialsX/Essentials/src/com/earth2me/essentials/IUser.java

151 lines
3.3 KiB
Java
Raw Normal View History

package com.earth2me.essentials;
import com.earth2me.essentials.commands.IEssentialsCommand;
import net.ess3.api.ITeleport;
import net.ess3.api.MaxMoneyException;
import org.bukkit.Location;
import org.bukkit.entity.Player;
2015-04-15 04:06:16 +00:00
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface IUser {
boolean isAuthorized(String node);
2015-04-15 04:06:16 +00:00
boolean isAuthorized(IEssentialsCommand cmd);
2015-04-15 04:06:16 +00:00
boolean isAuthorized(IEssentialsCommand cmd, String permissionPrefix);
2015-04-15 04:06:16 +00:00
void healCooldown() throws Exception;
2015-04-15 04:06:16 +00:00
void giveMoney(BigDecimal value) throws MaxMoneyException;
2015-04-15 04:06:16 +00:00
void giveMoney(final BigDecimal value, final CommandSource initiator) throws MaxMoneyException;
2015-04-15 04:06:16 +00:00
void payUser(final User reciever, final BigDecimal value) throws Exception;
2015-04-15 04:06:16 +00:00
void takeMoney(BigDecimal value);
2015-04-15 04:06:16 +00:00
void takeMoney(final BigDecimal value, final CommandSource initiator);
2015-04-15 04:06:16 +00:00
boolean canAfford(BigDecimal value);
2015-04-15 04:06:16 +00:00
Boolean canSpawnItem(final int itemId);
2015-04-15 04:06:16 +00:00
void setLastLocation();
2015-04-15 04:06:16 +00:00
void setLogoutLocation();
2015-04-15 04:06:16 +00:00
void requestTeleport(final User player, final boolean here);
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
ITeleport getTeleport();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
BigDecimal getMoney();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
void setMoney(final BigDecimal value) throws MaxMoneyException;
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
void setAfk(final boolean set);
2015-04-15 04:06:16 +00:00
/**
* 'Hidden' Represents when a player is hidden from others. This status includes when the player is hidden via other
* supported plugins. Use isVanished() if you want to check if a user is vanished by Essentials.
*
* @return If the user is hidden or not
*
* @see isVanished
*/
boolean isHidden();
2015-04-15 04:06:16 +00:00
void setHidden(boolean vanish);
2015-04-15 04:06:16 +00:00
boolean isGodModeEnabled();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
String getGroup();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
boolean inGroup(final String group);
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
boolean canBuild();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
long getTeleportRequestTime();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
void enableInvulnerabilityAfterTeleport();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
void resetInvulnerabilityAfterTeleport();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
boolean hasInvulnerabilityAfterTeleport();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
/**
* 'Vanished' Represents when a player is hidden from others by Essentials. This status does NOT include when the
* player is hidden via other plugins. Use isHidden() if you want to check if a user is vanished by any supported
* plugin.
*
* @return If the user is vanished or not
*
* @see isHidden
*/
boolean isVanished();
2015-04-15 04:06:16 +00:00
void setVanished(boolean vanish);
2015-04-15 04:06:16 +00:00
boolean isIgnoreExempt();
2015-06-03 20:11:56 +00:00
void sendMessage(String message);
2015-04-15 04:06:16 +00:00
/*
* UserData
*/
Location getHome(String name) throws Exception;
2015-04-15 04:06:16 +00:00
Location getHome(Location loc) throws Exception;
2015-04-15 04:06:16 +00:00
List<String> getHomes();
2015-04-15 04:06:16 +00:00
void setHome(String name, Location loc);
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
void delHome(String name) throws Exception;
2015-04-15 04:06:16 +00:00
boolean hasHome();
2015-04-15 04:06:16 +00:00
Location getLastLocation();
2015-04-15 04:06:16 +00:00
Location getLogoutLocation();
2015-04-15 04:06:16 +00:00
long getLastTeleportTimestamp();
2013-07-14 11:41:27 +00:00
2015-04-15 04:06:16 +00:00
void setLastTeleportTimestamp(long time);
2015-04-15 04:06:16 +00:00
String getJail();
2015-04-15 04:06:16 +00:00
void setJail(String jail);
2015-04-15 04:06:16 +00:00
List<String> getMails();
2015-04-15 04:06:16 +00:00
void addMail(String mail);
2015-04-15 04:06:16 +00:00
boolean isAfk();
2015-07-29 01:45:33 +00:00
void setIgnoreMsg(boolean ignoreMsg);
boolean isIgnoreMsg();
2015-04-15 04:06:16 +00:00
void setConfigProperty(String node, Object object);
2015-04-15 04:06:16 +00:00
Set<String> getConfigKeys();
2015-04-15 04:06:16 +00:00
Map<String, Object> getConfigMap();
2015-04-15 04:06:16 +00:00
Map<String, Object> getConfigMap(String node);
2015-04-15 04:06:16 +00:00
/*
* PlayerExtension
*/
Player getBase();
2015-04-15 04:06:16 +00:00
CommandSource getSource();
2015-06-03 20:11:56 +00:00
String getName();
}