diff --git a/src/main/java/com/massivecraft/factions/cmd/FCommand.java b/src/main/java/com/massivecraft/factions/cmd/FCommand.java index 72b8903b..ca8fe648 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FCommand.java +++ b/src/main/java/com/massivecraft/factions/cmd/FCommand.java @@ -4,6 +4,8 @@ import com.massivecraft.factions.*; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.zcore.MCommand; +import org.bukkit.Bukkit; +import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -203,9 +205,12 @@ public abstract class FCommand extends MCommand
{
// Next we match player names
if (faction == null) {
- FPlayer fplayer = FPlayers.i.getBestIdMatch(name);
- if (fplayer != null) {
- faction = fplayer.getFaction();
+ OfflinePlayer player = Bukkit.getOfflinePlayer(name);
+ if (player.getName() != null) {
+ FPlayer fplayer = FPlayers.i.get(player);
+ if (fplayer != null) {
+ faction = fplayer.getFaction();
+ }
}
}
diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/PlayerEntityCollection.java b/src/main/java/com/massivecraft/factions/zcore/persist/PlayerEntityCollection.java
index 84d6ac80..3d54982b 100644
--- a/src/main/java/com/massivecraft/factions/zcore/persist/PlayerEntityCollection.java
+++ b/src/main/java/com/massivecraft/factions/zcore/persist/PlayerEntityCollection.java
@@ -1,6 +1,7 @@
package com.massivecraft.factions.zcore.persist;
import org.bukkit.Bukkit;
+import org.bukkit.OfflinePlayer;
import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
import org.bukkit.entity.Player;
@@ -24,7 +25,7 @@ public abstract class PlayerEntityCollection