mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-26 20:55:54 +01:00
Check for null players on DungeonsXL join
This commit is contained in:
parent
dc45761f17
commit
5f52a5b9d9
@ -27,15 +27,19 @@ public class DungeonsListener implements Listener {
|
||||
public void onPlayerJoinEvent(DPlayerJoinDGroupEvent event) {
|
||||
Player i = event.getDGroup().getCaptain();
|
||||
Player p = event.getDPlayer().getPlayer();
|
||||
i.sendMessage(ChatColor.GREEN + Lang.get(i, "questDungeonsInvite").replace("<player>", p.getName()));
|
||||
p.sendMessage(ChatColor.GREEN + Lang.get(p, "questDungeonsJoin").replace("<player>", i.getName()));
|
||||
if (i != null && p != null) {
|
||||
i.sendMessage(ChatColor.GREEN + Lang.get(i, "questDungeonsInvite").replace("<player>", p.getName()));
|
||||
p.sendMessage(ChatColor.GREEN + Lang.get(p, "questDungeonsJoin").replace("<player>", i.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerLeaveEvent(DPlayerLeaveDGroupEvent event) {
|
||||
Player k = event.getDGroup().getCaptain();
|
||||
Player p = event.getDPlayer().getPlayer();
|
||||
k.sendMessage(ChatColor.RED + Lang.get(k, "questDungeonsKicked").replace("<player>", k.getName()));
|
||||
p.sendMessage(ChatColor.RED + Lang.get(p, "questDungeonsLeave").replace("<player>", p.getName()));
|
||||
if (k != null && p != null) {
|
||||
k.sendMessage(ChatColor.RED + Lang.get(k, "questDungeonsKicked").replace("<player>", k.getName()));
|
||||
p.sendMessage(ChatColor.RED + Lang.get(p, "questDungeonsLeave").replace("<player>", p.getName()));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user