I'm trying to write a Teleport plugin, the problem: When I compared the block location directly with the value of a key (e.g. 1), it worked. But I don't want to ask for a key, but look for everyone who is in the hash map (and then get a hit in the if). How do I best do that?
MFG Johannes
Code:
public static location checkPortal () {
for (int i = PortalHashMap.senderloc.size (); i> = -1; i--) {
Location portal = PortalHashMap.senderloc. Get (i);
System.out.println ("Portal:" + portal);
return portal;
}
return null;
}
@EventHandler
public void onPlayerMove (PlayerMoveEvent ev) {
Player p = ev.getPlayer ();
if (p.isSneaking ()) {
if (Blocklocation (p) .equals (checkPortal ({
@EventHandler
public void onPlayerMove (PlayerMoveEvent ev) {
Player p = ev.getPlayer ();
if (! P.isSneaking ())
return;
if (PortalHashMap.senderloc.values (). Contains (Blocklocation (p {
// TO DO
}
}