Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranhart committed Jan 19, 2023
2 parents ed3053d + 17960f0 commit 9da1623
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/ca/tweetzy/flight/utils/PlayerUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@
*/
@UtilityClass
public final class PlayerUtil {


/**
* Gives an item to a player, or drops on the ground if their inventory is full
*
* @param player The player to give the item to
* @param item The ItemStack to give or drop
*
*/
public void giveItem(@NonNull final Player player, @NonNull final ItemStack item) {
if (player.getInventory().firstEmpty() == -1) {
player.getWorld().dropItemNaturally(player.getLocation(), item);
Expand Down

0 comments on commit 9da1623

Please sign in to comment.