Skip to content

Instantly share code, notes, and snippets.

@inklesspen
Created February 27, 2011 20:53
Show Gist options
  • Select an option

  • Save inklesspen/846528 to your computer and use it in GitHub Desktop.

Select an option

Save inklesspen/846528 to your computer and use it in GitHub Desktop.
@Override
public void onPlayerJoin(PlayerEvent event) {
Player player = event.getPlayer();
Location home = plugin.getPlayerHome(player);
if (home != null) {
player.setCompassTarget(home);
}
}
@Override
public void onPlayerRespawn(PlayerRespawnEvent event) {
Player player = event.getPlayer();
Location home = plugin.getPlayerHome(player);
if (home != null) {
event.setRespawnLocation(home);
player.setCompassTarget(home);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment