mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-23 11:15:24 +01:00
Fix null in reject invite (#1933)
* remove debug * fix null in reject invite
This commit is contained in:
parent
52cc2a8593
commit
178529adb1
@ -1,6 +1,7 @@
|
||||
package world.bentobox.bentobox.api.commands.island.team;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
@ -40,14 +41,15 @@ public class IslandTeamInviteRejectCommand extends CompositeCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
Optional.ofNullable(itc.getInviter(playerUUID))
|
||||
.map(User::getInstance)
|
||||
.ifPresent(inviter ->
|
||||
inviter.sendMessage("commands.island.team.invite.reject.name-rejected-your-invite", TextVariables.NAME, user.getName())
|
||||
);
|
||||
|
||||
// Remove this player from the global invite list
|
||||
itc.removeInvite(user.getUniqueId());
|
||||
user.sendMessage("commands.island.team.invite.reject.you-rejected-invite");
|
||||
|
||||
User inviter = User.getInstance(itc.getInviter(playerUUID));
|
||||
if (inviter != null) {
|
||||
inviter.sendMessage("commands.island.team.invite.reject.name-rejected-your-invite", TextVariables.NAME, user.getName());
|
||||
}
|
||||
} else {
|
||||
// Someone typed /island reject and had not been invited
|
||||
user.sendMessage("commands.island.team.invite.errors.none-invited-you");
|
||||
|
@ -85,7 +85,6 @@ public class InventoryListener extends FlagListener {
|
||||
checkIsland(e, player, e.getInventory().getLocation(), Flags.CHEST);
|
||||
}
|
||||
else if (!(inventoryHolder instanceof Player)) {
|
||||
BentoBox.getInstance().logDebug(inventoryHolder.getClass().toGenericString());
|
||||
// All other containers
|
||||
checkIsland(e, player, e.getInventory().getLocation(), Flags.CONTAINER);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user