Fix /f warp on Java 6 and 7

Covariance on ConcurrentHashMap#keySet() in Java 8 was to blame.
This commit is contained in:
eueln 2014-12-07 21:59:59 -06:00
parent e4bafcf072
commit a6585e6f5c

View File

@ -4,9 +4,12 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.LazyLocation;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
import java.util.Map;
public class CmdFWarp extends FCommand {
public CmdFWarp() {
@ -25,7 +28,8 @@ public class CmdFWarp extends FCommand {
//TODO: check if in combat.
if (args.size() == 0) {
FancyMessage msg = new FancyMessage("Warps: ").color(ChatColor.GOLD);
for (String s : myFaction.getWarps().keySet()) {
Map<String, LazyLocation> warps = myFaction.getWarps();
for (String s : warps.keySet()) {
msg.then(s + " ").tooltip("Click to warp!").command("f warp " + s).color(ChatColor.WHITE);
}
sendFancyMessage(msg);