Skip to content
This repository was archived by the owner on Dec 31, 2021. It is now read-only.

Add an immutable item api #25

@Techcable

Description

@Techcable

An immutable item API is necessary for us to replace bukkit's item api.
We should use inheritance, so items inherit from an abstract 'Item' class, avoiding the ItemMeta disaster.
With builders and withers, its an easy one-liner to construct them, even though they are immutable:

Item.builder(server, Materials.TACO)
        .tasty(true)
        .addEnchantment(EnchantmentTypes.SUPER_YUMMY, Integer.MAX_VALUE)
        .build()
  • AbstractItem (actually called 'Item')
  • nbt values/ItemMeta
    • Banner
    • Book
    • EnchantedBook
      • This is to represent the fact that the enchantments in enchanted books are not 'normal' enchants, they are 'stored' enchants
    • FireworkEffect
    • Firework
    • LeatherArmor
    • MapItem
    • PotionMeta
    • SkullMeta
    • SpawnerMeta
    • SpawnEggMeta
  • data value abstractions
    • TODO

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions