FountainMC / FountainAPI

A 'simple but beautiful' Minecraft Server Plugin API
https://fountainmc.org/
MIT License
5 stars 5 forks source link

Add an immutable item api #25

Open Techcable opened 8 years ago

Techcable commented 8 years ago

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()
phase commented 8 years ago

Why is the server needed in the builder? I know plugin an just call Fountain.getServer, but why not do that in the constructor of the builder? What other server is possible?