mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-09 20:31:28 +01:00
Fixed NPE in /dxl leave
This commit is contained in:
parent
cabbb35775
commit
2fe1c9d28a
@ -117,12 +117,16 @@ public class DPlayer {
|
||||
p.lives.remove(player);
|
||||
}
|
||||
|
||||
DConfig dConfig = GameWorld.get(world).config;
|
||||
if (this.isFinished) {
|
||||
this.savePlayer.reset(dConfig.getKeepInventoryOnFinish());
|
||||
}
|
||||
else {
|
||||
this.savePlayer.reset(dConfig.getKeepInventoryOnEscape());
|
||||
if (!this.isEditing) {
|
||||
DConfig dConfig = GameWorld.get(world).config;
|
||||
if (this.isFinished) {
|
||||
this.savePlayer.reset(dConfig.getKeepInventoryOnFinish());
|
||||
}
|
||||
else {
|
||||
this.savePlayer.reset(dConfig.getKeepInventoryOnEscape());
|
||||
}
|
||||
} else {
|
||||
this.savePlayer.reset(false);
|
||||
}
|
||||
|
||||
if (this.isEditing) {
|
||||
|
@ -2,7 +2,6 @@ package com.dre.dungeonsxl.game;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -61,6 +61,9 @@ public class GameChest {
|
||||
msg = msg.substring(0, msg.length() - 1);
|
||||
|
||||
P.p.msg(player, P.p.language.get("Player_LootAdded", msg));
|
||||
if (moneyReward != 0) {
|
||||
P.p.msg(player, P.p.language.get("Player_LootAdded", String.valueOf(moneyReward)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -85,7 +88,7 @@ public class GameChest {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else {
|
||||
P.p.msg(P.p.getServer().getPlayer(event.getPlayer().getName()), ChatColor.RED + "Diese Kiste wurde schon geöffnet!");
|
||||
P.p.msg(P.p.getServer().getPlayer(event.getPlayer().getUniqueId()), ChatColor.RED + "Diese Kiste wurde schon geöffnet!");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: DungeonsXL
|
||||
main: com.dre.dungeonsxl.P
|
||||
version: 0.9.6-SNAPSHOT
|
||||
version: 0.9.6
|
||||
author: Frank Baumann
|
||||
authors: [Frank Baumann, Milan Albrecht, Tobias Schmitz, Daniel Saukel]
|
||||
website: http://www.dre2n.ml
|
||||
|
Loading…
Reference in New Issue
Block a user