mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-12 21:54:04 +01:00
Fix onDeath
This commit is contained in:
parent
56c3e982ba
commit
c98e52a925
@ -24,9 +24,12 @@ public class PlayerDeathListener implements Listener {
|
||||
Player player = event.getEntity();
|
||||
DPlayer dPlayer = DPlayer.get(player);
|
||||
|
||||
DConfig dConfig = GameWorld.get(player.getLocation().getWorld()).config;
|
||||
GameWorld gameWorld = GameWorld.get(player.getLocation().getWorld());
|
||||
if (gameWorld != null) {
|
||||
DConfig dConfig = gameWorld.config;
|
||||
|
||||
if (dPlayer != null) {
|
||||
if (dConfig != null) {
|
||||
if (dConfig.getKeepInventoryOnDeath()) {
|
||||
dPlayer.respawnInventory = event.getEntity().getInventory().getContents();
|
||||
dPlayer.respawnArmor = event.getEntity().getInventory().getArmorContents();
|
||||
@ -35,6 +38,7 @@ public class PlayerDeathListener implements Listener {
|
||||
istack.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (p.lives.containsKey(player)) {
|
||||
lives = p.lives.get(player) - 1;
|
||||
@ -52,3 +56,5 @@ public class PlayerDeathListener implements Listener {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user