Skip to content

Commit

Permalink
Implemented Respawn on Home
Browse files Browse the repository at this point in the history
  • Loading branch information
Joscha1234 committed Jun 19, 2013
1 parent f35b924 commit 8316097
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/com/dre/managerxl/listeners/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerLoginEvent.Result;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;

import com.dre.managerxl.MPlayer;
import com.dre.managerxl.P;
Expand Down Expand Up @@ -73,6 +74,15 @@ public void onPlayerQuit(PlayerQuitEvent event) {

player.setOnline(false);
}

@EventHandler()
public void onPlayerRespawn(PlayerRespawnEvent event) {
MPlayer player = MPlayer.getOrCreate(event.getPlayer().getName());

if(player.getHome()!=null){
event.setRespawnLocation(player.getHome());
}
}

@EventHandler()
public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
Expand Down

0 comments on commit 8316097

Please sign in to comment.