mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 09:10:00 +00:00
* Enchantment: Split enchantment type data from instance data This commit splits enchantments into (effectively) enchantment TYPES vs enchantment INSTANCES. When applying an enchantment to an item, it only needs to know 2 things: 1. the enchantment ID (identifier) which is used to identify the TYPE 2. the enchantment LEVEL which is used to modify the enchantment's power IN THIS INSTANCE. Therefore, the LEVEL is not an immutable property. However, all other properties of the currently-named "Enchantment" class are immutable type properties. Currently, when applying an enchantment to an item, a copy of the enchantment object is created from the registry, and returned. This copies all of the properties contained by the type, which is obviously sub optimal.