Created
December 5, 2012 23:07
-
-
Save SuperSpyTX/4220350 to your computer and use it in GitHub Desktop.
Yeah...whatever
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Manager { | |
private Map<String, Boolean> yourmap = new HashMap<String, Boolean>(); | |
// Some dummy function. | |
public void addToMap(String str, Boolean bool) { | |
yourmap.put(str, bool); | |
} | |
} | |
public class Listener { | |
private Manager varmanager; // This part. | |
// This part is important. | |
public Listener(Manager inst) { | |
manager = inst; | |
} | |
@EventHandler | |
public void onPlayerLogin(PlayerLoginEvent e) { | |
varmanager.addToMap(e.getPlayer().getName(), true); // See how varmanager is referenced instead of the class? | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment