Release date: 03.04.2021
Small inventory patches:
- Item click listeners now use a
Consumer<KelpClickEvent>
instead of the customClickListener
interface. - You can now use data types other than String to tag a
KelpItem
- Item tags can now be retrieved from
KelpItem
class directly usinggetIntTag(String key)
for example. This fixes issue #50. - Remove
@CreateInventory
annotation. Annotation-based inventories won't be supported. ItemStack
can now be converted toKelpItem
viaKelpItem.from(ItemStack)
as well.KelpInventory
now has aonClose
method that can be overridden if needed to stop things like schedulers when the inventory is closed- Now the
KelpInventory
abstract class is holding all widgets instead of letting this do by each individual implementation. - Add
PlayerInventory
class allowing for better integration ofKelpItem
in player inventories- This allows you to do things like
KelpPlayer#getInventory()#setItem(slot, KelpItem)
- You can add normal
Widgets
to a player inventory and create a pagination of lobby servers like that for example - Fix duplication bug when item click was canceled inside a creative inventory
- This allows you to do things like
- Fix bug that converting a bukkit
ItemStack
toKelpItem
did not convert item tags as well. - Change inventory state management:
- Remove
SimpleStatelessInventory
as Kelp does now not focus on completely stateless inventories anymore. It is considered more useful to only make specific widgets stateless and exclude them from the update process. - Replace
ItemWidget
withStatelessItemWidget
(static content) andStatefulItemWidget
(updatable content) - Every widget now has
isStateful()
method indicating if it contains updatable content. When an inventory is updated, not all slots are cleared and replaced anymore, but only those of stateful widgets.
- Remove
- You can now check if a player has a
KelpInventory
open usingKelpPlayer#hasKelpInventory()
- Write an implementation for
SimpleInventory
, which can now finally be used just asAnimatedInventory
- Add properties to
KelpMaterial
: You can now check whether a specific material is an item or a block and if so which blast resistance and which hardness it has, etc.- Add item groups such as armor, tools, melee weapons, etc.
- Add
SlotArea
class calculating slot areas like lines or rectangles based on the inventory size. This makes it easier to define the areas of a pagination or a placeholder. - Add
PlaceholderWidget
which can be used to add placeholder items (such as glass panes, etc.) to any inventory. - Add
ItemMetadata
forKelpItems
:- You can now give any KelpItem a metadata depending on which material it has. This enables you to use colored armor, custom head textures, etc.
LeatherArmorMetadata
: Give color to leather armor parts- Add
Color
class representing RGB colors and offering some minecraft default colors
- Add
SkullMetadata
: Give either custom or player textures to skull items (PLAYER_HEAD
)- Add
HeadTexture
class for conversion between custom skins and their base64-URL needed by minecraft to display the skins.
- Add
- Documentation improvements for some NPC classes and other item classes
- Add
getRomanNumber(int)
method toMathUtils
allowing to get the roman notation for a decimal number - Add custom enchantments:
- You can now define default minecraft enchantments as
KelpEnchantment
for version independence (KelpItem#enchant(KelpEnchantment class, level)
) - You can create your own custom enchantments by extending from
KelpEnchantment
- Implement glow effect of
KelpItem
: There is now a custom enchantmentItemGlowEnchantment
which can be applied to simply make an item glow without actually giving special abilities.
- You can now define default minecraft enchantments as
- A
Pagination
widget now takes a supplier of widgets instead of a normal list allowing the amount of items inside a pagination to be changed. - The
Pagination
widget now acceptsSimpleWidgets
instead of only normal Kelp items. - Add
ORB_PICKUP
toKelpSound
enum