Previously on 3.0.0, the old item in the changed slot could be easily obtained through the EntityInventoryChangeEvent. With 4.0.0, the event has been replaced with inventory change listeners, which lacks the ability to easily get the old item.
Justification
PiggyCE currently has 3 types of custom enchantments: reactive, ticking, & toggling. Toggling enchantments rely on three different events on 3.0.0: PlayerItemHeldEvent for held enchantments, EntityInventoryChangeEvent for inventory enchantments, & EntityArmorChangeEvent for armor enchantments. EntityInventoryChangeEvent, and EntityArmorChangeEvent which extends EntityInventoryChangeEvent, have since been removed, and with them, the ability to easily get the old item. The old items are used to toggle off the enchantments. It's possible to replicate this without having the old item accessible, albeit quite messily. The feature may also benefit other plugin developers when switching to 4.0
Description
Previously on 3.0.0, the old item in the changed slot could be easily obtained through the EntityInventoryChangeEvent. With 4.0.0, the event has been replaced with inventory change listeners, which lacks the ability to easily get the old item.
Justification
PiggyCE currently has 3 types of custom enchantments: reactive, ticking, & toggling. Toggling enchantments rely on three different events on 3.0.0: PlayerItemHeldEvent for held enchantments, EntityInventoryChangeEvent for inventory enchantments, & EntityArmorChangeEvent for armor enchantments. EntityInventoryChangeEvent, and EntityArmorChangeEvent which extends EntityInventoryChangeEvent, have since been removed, and with them, the ability to easily get the old item. The old items are used to toggle off the enchantments. It's possible to replicate this without having the old item accessible, albeit quite messily. The feature may also benefit other plugin developers when switching to 4.0
Alternative methods