Skip to content
This repository was archived by the owner on Nov 25, 2019. It is now read-only.

Commit 33863c3

Browse files
committed
streamline getTeamsInventory
1 parent a10f8e4 commit 33863c3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

PGM/src/main/java/tc/oc/pgm/mutation/types/kit/TeamChestMutation.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,8 @@ private boolean isBlacklistedItem(ItemStack item) {
123123
}
124124

125125
private Optional<Inventory> getTeamsInventory(Player bukkitPlayer) {
126-
MatchPlayer player = match().getPlayer(bukkitPlayer);
127-
Party team = player.getParty();
128-
129-
if (!team.isParticipating()) return Optional.empty();
130-
131-
return Optional.of(teamChests.get(team));
126+
return match().participant((Entity) bukkitPlayer)
127+
.map(matchPlayer -> teamChests.get(matchPlayer.getParty()));
132128
}
133129

134130
private Kit getKitForPlayer(MatchPlayer player) {

0 commit comments

Comments
 (0)