Temporary Guilds invite nullpointer fix while mmocore 2.0 is still in development.

This commit is contained in:
Joshua 2021-05-26 16:34:58 -05:00
parent 06b5826df7
commit 801752c9bb

View File

@ -32,8 +32,17 @@ public class GuildInvite extends Request {
public void accept() {
guild.removeLastInvite(getCreator().getPlayer());
guild.getMembers().forEach(member -> MMOCore.plugin.configManager.getSimpleMessage("guild-joined-other", "player", target.getPlayer().getName()).send(Bukkit.getPlayer(member)));
MMOCore.plugin.configManager.getSimpleMessage("guild-joined", "owner", Bukkit.getPlayer(guild.getOwner()).getName()).send(target.getPlayer());
guild.getMembers().forEach(member -> {
if(Bukkit.getPlayer(member) != null) {
MMOCore.plugin.configManager.getSimpleMessage("guild-joined-other", "player",
target.getPlayer().getName()).send(Bukkit.getPlayer(member));
MMOCore.plugin.configManager.getSimpleMessage("guild-joined", "owner",
Bukkit.getPlayer(guild.getOwner()).getName()).send(target.getPlayer());
}}
);
guild.addMember(target.getUniqueId());
InventoryManager.GUILD_VIEW.newInventory(target).open();
MMOCore.plugin.requestManager.unregisterRequest(getUniqueId());