Package com.kamikazejam.kamicommon.util
Class PlayerUtil
java.lang.Object
com.kamikazejam.kamicommon.util.PlayerUtil
Utility class for helping with players
You can give items (which drop near them if they are full), and clean their inventory (with or without armor)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanTakeItems(Player player, ItemStack... itemStacks) static booleanemptyInventory(Player player) If the player's inventory is empty (Includes armor slots in the check)static booleanemptyInventory(Player player, boolean checkArmor) If the player's inventory is emptystatic voidstatic voidstatic booleanisFullyValidPlayer(@Nullable Player player) static @Nullable ItemStackstatic booleanWill try to take the items from the player's inventory
-
Constructor Details
-
PlayerUtil
public PlayerUtil()
-
-
Method Details
-
emptyInventory
If the player's inventory is empty (Includes armor slots in the check)- Parameters:
player- The player to check- Returns:
- If the inventory was empty
-
emptyInventory
If the player's inventory is empty- Parameters:
player- The player to checkcheckArmor- If the armor slots should be included in the check- Returns:
- If the inventory was empty
-
giveItems
-
giveItem
-
stackItem
-
takeItems
Will try to take the items from the player's inventory- Parameters:
enforceQuantities- If we should fail if we cannot take all the items- Returns:
- True IFF all items were taken
-
canTakeItems
-
isFullyValidPlayer
- Returns:
- true IFF (player != null AND player.isOnline() AND player.isValid())
-