Interface SavedItemsAccessor
- All Known Implementing Classes:
CommonPlayerMixin
public interface SavedItemsAccessor
Accessor interface implemented via Mixin on the
Player entity class.
This interface provides a mechanism to temporarily store and retrieve a list of
SavedItemEntry objects. This system is crucial for implementing custom
persistence logic, such as preventing cursed items (e.g., Binding Curse)
from being dropped on player death and ensuring they are restored to the player's
inventory (specifically their original equipment slots) upon respawn or dimension transfer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a newSavedItemEntryto the list of items pending restoration.Retrieves the mutable list of items that were successfully saved and should be restored (e.g., items affected by a probabilistic Binding Curse that survived player death).
-
Method Details
-
enchanting_overhauled$getSavedItems
List<SavedItemEntry> enchanting_overhauled$getSavedItems()Retrieves the mutable list of items that were successfully saved and should be restored (e.g., items affected by a probabilistic Binding Curse that survived player death).- Returns:
- A
ListofSavedItemEntryobjects.
-
enchanting_overhauled$addSavedItem
Adds a newSavedItemEntryto the list of items pending restoration.This is typically called just before the inventory is dropped/cleared on death.
- Parameters:
entry- The item and its original slot index to be saved.
-