Add this.
This commit is contained in:
parent
024336d717
commit
5d50dc9971
@ -15,12 +15,10 @@ import com.massivecraft.factions.zcore.persist.PlayerEntity;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -302,7 +300,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
if(isOnline()) {
|
if (isOnline()) {
|
||||||
return getPlayer().getName();
|
return getPlayer().getName();
|
||||||
}
|
}
|
||||||
/*OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(getId()));
|
/*OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(getId()));
|
||||||
|
@ -13,9 +13,6 @@ import com.massivecraft.factions.util.MapFLocToStringSetTypeAdapter;
|
|||||||
import com.massivecraft.factions.util.MyLocationTypeAdapter;
|
import com.massivecraft.factions.util.MyLocationTypeAdapter;
|
||||||
import com.massivecraft.factions.zcore.MPlugin;
|
import com.massivecraft.factions.zcore.MPlugin;
|
||||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.craftbukkit.libs.com.google.gson.GsonBuilder;
|
import org.bukkit.craftbukkit.libs.com.google.gson.GsonBuilder;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.massivecraft.factions.cmd;
|
package com.massivecraft.factions.cmd;
|
||||||
|
|
||||||
import com.massivecraft.factions.*;
|
import com.massivecraft.factions.*;
|
||||||
|
import com.massivecraft.factions.integration.Essentials;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Relation;
|
import com.massivecraft.factions.struct.Relation;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
@ -107,6 +108,10 @@ public class CmdHome extends FCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if Essentials teleport handling is enabled and available, pass the teleport off to it (for delay and cooldown)
|
||||||
|
if (Essentials.handleTeleport(me, myFaction.getHome())) return;
|
||||||
|
|
||||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||||
if (!payForCommand(Conf.econCostHome, "to teleport to your faction home", "for teleporting to your faction home"))
|
if (!payForCommand(Conf.econCostHome, "to teleport to your faction home", "for teleporting to your faction home"))
|
||||||
return;
|
return;
|
||||||
|
@ -132,7 +132,7 @@ public abstract class FCommand extends MCommand<P> {
|
|||||||
|
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
|
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
|
||||||
if (player.hasPlayedBefore()) {
|
if (player.hasPlayedBefore()) {
|
||||||
FPlayer fplayer = FPlayers.i.get(player);
|
FPlayer fplayer = FPlayers.i.get(player);
|
||||||
if (fplayer != null) {
|
if (fplayer != null) {
|
||||||
ret = fplayer;
|
ret = fplayer;
|
||||||
@ -196,7 +196,7 @@ public abstract class FCommand extends MCommand<P> {
|
|||||||
// Next we match player names
|
// Next we match player names
|
||||||
if (faction == null) {
|
if (faction == null) {
|
||||||
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
|
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
|
||||||
if (player.hasPlayedBefore()) {
|
if (player.hasPlayedBefore()) {
|
||||||
FPlayer fplayer = FPlayers.i.get(player);
|
FPlayer fplayer = FPlayers.i.get(player);
|
||||||
if (fplayer != null) {
|
if (fplayer != null) {
|
||||||
faction = fplayer.getFaction();
|
faction = fplayer.getFaction();
|
||||||
|
@ -16,7 +16,7 @@ public class Essentials {
|
|||||||
|
|
||||||
public static void setup() {
|
public static void setup() {
|
||||||
Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials");
|
Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials");
|
||||||
if(ess != null) {
|
if (ess != null) {
|
||||||
essentials = (IEssentials) ess;
|
essentials = (IEssentials) ess;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class UUIDFetcher implements Callable<Map<String, UUID>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static UUID getUUID(String id) {
|
private static UUID getUUID(String id) {
|
||||||
return UUID.fromString(id.substring(0, 8) + "-" + id.substring(8, 12) + "-" + id.substring(12, 16) + "-" + id.substring(16, 20) + "-" +id.substring(20, 32));
|
return UUID.fromString(id.substring(0, 8) + "-" + id.substring(8, 12) + "-" + id.substring(12, 16) + "-" + id.substring(16, 20) + "-" + id.substring(20, 32));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] toBytes(UUID uuid) {
|
public static byte[] toBytes(UUID uuid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user