Skip to content

Commit

Permalink
fixed bug when items which don't fit in the player's inventory upon
Browse files Browse the repository at this point in the history
respawn drop at the wrong location
  • Loading branch information
Bone008 committed Jan 2, 2012
1 parent a5c8632 commit 084ffec
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/bone008/bukkit/deathcontrol/DeathControlPlayerListener.java
Expand Up @@ -15,12 +15,19 @@ public DeathControlPlayerListener(DeathControl plugin){

@Override
public void onPlayerRespawn(PlayerRespawnEvent event){
Player ply = event.getPlayer();
final Player ply = event.getPlayer();

DeathManager m = plugin.managers.get(ply);
if(m != null){
m.respawned();
}
// delay this for the next tick to make sure the player fully respawned to get the correct location
// don't use getRespawnLocation(), because it might still be changed by another plugin - this way is safer
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
@Override
public void run() {
DeathManager m = plugin.managers.get(ply);
if(m != null){
m.respawned();
}
}
});
}


Expand Down

0 comments on commit 084ffec

Please sign in to comment.