This commit is contained in:
drtshock
2014-07-01 15:10:18 -05:00
parent 5066934a95
commit 8a6a97cc90
110 changed files with 3131 additions and 1228 deletions

View File

@@ -15,20 +15,25 @@ public class Essentials {
private static IEssentials essentials;
public static void setup() {
Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials"); if (ess != null) {
Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials");
if (ess != null) {
essentials = (IEssentials) ess;
}
}
// return false if feature is disabled or Essentials isn't available
public static boolean handleTeleport(Player player, Location loc) {
if (!Conf.homesTeleportCommandEssentialsIntegration || essentials == null) { return false; }
if (!Conf.homesTeleportCommandEssentialsIntegration || essentials == null) {
return false;
}
Teleport teleport = (Teleport) essentials.getUser(player).getTeleport();
Trade trade = new Trade(Conf.econCostHome, essentials); try {
Trade trade = new Trade(Conf.econCostHome, essentials);
try {
teleport.teleport(loc, trade);
} catch (Exception e) {
player.sendMessage(ChatColor.RED.toString() + e.getMessage());
} return true;
}
return true;
}
}