Class LockedItemGroup
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
io.github.thebusybiscuit.slimefun4.api.items.groups.LockedItemGroup
- All Implemented Interfaces:
Keyed
Represents a
ItemGroup that cannot be opened until the parent group(s)
are fully unlocked.
See ItemGroup for the complete documentation.
- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionLockedItemGroup(NamespacedKey key, ItemStack item, int tier, NamespacedKey... parents) The constructor for a LockedItemGroup.LockedItemGroup(NamespacedKey key, ItemStack item, NamespacedKey... parents) The basic constructor for a LockedItemGroup. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a parentItemGroupto thisLockedItemGroup.Gets the list of parent item groups for thisLockedItemGroup.booleanhasUnlocked(Player p, PlayerProfile profile) Checks if thePlayerhas fully unlocked all parent categories.voidregister(SlimefunAddon addon) Registers thisItemGroup.voidremoveParent(ItemGroup group) Removes aItemGroupfrom the parents of thisLockedItemGroup.Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
add, contains, equals, getAddon, getDisplayName, getItem, getItems, getKey, getTier, getUnlocalizedName, hashCode, isAccessible, isCrossAddonItemGroup, isHidden, isRegistered, isVisible, remove, setCrossAddonItemGroup, setTier, toString
-
Constructor Details
-
LockedItemGroup
@ParametersAreNonnullByDefault public LockedItemGroup(NamespacedKey key, ItemStack item, NamespacedKey... parents) The basic constructor for a LockedItemGroup. LikeItemGroup, the default tier is automatically set to 3.- Parameters:
key- A unique identifier for this groupitem- The display item for this groupparents- The parent categories for this group
-
LockedItemGroup
@ParametersAreNonnullByDefault public LockedItemGroup(NamespacedKey key, ItemStack item, int tier, NamespacedKey... parents) The constructor for a LockedItemGroup.- Parameters:
key- A unique identifier for this groupitem- The display item for this grouptier- The tier of this groupparents- The parent categories for this group
-
-
Method Details
-
register
Description copied from class:ItemGroupRegisters thisItemGroup.By default, an
ItemGroupis automatically registered when aSlimefunItemwas added to it.- Overrides:
registerin classItemGroup- Parameters:
addon- TheSlimefunAddonthat wants to register thisItemGroup
-
getParents
Gets the list of parent item groups for thisLockedItemGroup.- Returns:
- the list of parent item groups
- See Also:
-
addParent
Adds a parentItemGroupto thisLockedItemGroup.- Parameters:
group- TheItemGroupto add as a parent- See Also:
-
removeParent
Removes aItemGroupfrom the parents of thisLockedItemGroup.- Parameters:
group- TheItemGroupto remove from the parents of thisLockedItemGroup- See Also:
-
hasUnlocked
Checks if thePlayerhas fully unlocked all parent categories.- Parameters:
p- ThePlayerto checkprofile- ThePlayerProfilethat belongs to the givenPlayer- Returns:
- Whether the
Playerhas fully completed all parent categories, otherwise false
-