1.21.1 to 1.21.4/1.21.5
This is an overview on the breaking changes, deprecations, and future development plans for Curios on 1.21.4/1.21.5. This document aims to be exhaustive and list every relevant change in each section. If there are any missing pieces of information, please submit a PR to this repository or initiate a support request in the Discord server.
Breaking Changes
Non-Deprecated
Method
ICurioRenderer#render
(parameter change)
Description
The changes in rendering in Minecraft made it necessary to change the parameters to accommodate. Everything else about the method is unchanged so developers will just need to adjust the parameters and their implementations accordingly.
Class
DropRule
(package change)
Description
DropRule
has been moved to its own package in top.theillusivec4.curios.api.common.DropRule
as opposed to its previous location
as an inner enum in top.theillusivec4.curios.api.type.ICurio
. This was not a necessary change for this version, however ICurio
is
being planned for future deprecation and, since DropRule
would still be needed, it was decided to separate it now into its own
package rather than later so that deprecation can occur without affecting the enum itself.
Method
CurioAttributeModifierEvent
getId
(removed)getSlotContext
(removed)
Description
The CurioAttributeModifierEvent
event has been refactored to better accommodate the new internal changes to curio attribute modifiers,
which have now fully moved from Multimap<Holder<Attribute>>, AttributeModifier>
instances to the CurioAttributeModifiers
data
component. Some of these changes are also to better align with NeoForge's ItemAttributeModifierEvent
, which this event is based on.
These specific methods were removed due to the fact that, since this event fires with a CurioAttributeModifiers
context now, there is
no longer any reference to a specific SlotContext
or ResourceLocation
and modifiers are instead added with a slot types or predicates
at the time of addition.
Previously Deprecated
The following methods and classes were deprecated previously and have been removed in this version:
Classes
ISlotHelper
IIconHelper
ICuriosHelper
SlotTypeMessage
SlotTypePreset
Methods
ICurio
andICurioItem
getSlotsTooltip
getAttributeModifiers(SlotContext, UUID)
getDropRule(SlotContext, DamageSource, int, boolean)
getAttributesTooltip
SoundInfo
getSoundEvent
getVolume
getPitch
CuriosApi
getSlot(String)
getSlotIcon(String)
getSlots
getEntitySlots(EntityType<?>)
getPlayerSlots
getItemStackSlots
setIconHelper
getIconHelper
setCuriosHelper
getCuriosHelper
setSlotHelper
getSlotHelper
ICuriosItemHandler
getLockedSlots
unlockSlotType
lockSlotType
processSlots
getFortuneBonus
growSlotType
shrinkSlotType
ICurioStacksHandler
getSizeShift
grow
shrink
ISlotType
isLocked
getPriority
isVisible
ISlotData
operation(AttributeModifier.Operation)
Deprecations
CuriosApi
Methods
-
getSlot(String, Level)
-
getSlot(String, boolean)
- Replaced by:
CuriosSlotTypes#getSlotType(String, boolean)
- Replaced by:
-
getSlots(Level)
-
getSlots(boolean)
- Replaced by:
CuriosSlotTypes#getSlotTypes(boolean)
- Replaced by:
-
getPlayerSlots(Level)
-
getPlayerSlots(boolean)
- Replaced by:
CuriosSlotTypes#getDefaultEntitySlotTypes(boolean)
- Replaced by:
-
getPlayerSlots(Player)
-
getEntitySlots(LivingEntity)
- Replaced by:
CuriosSlotTypes#getDefaultEntitySlotTypes(LivingEntity)
- Replaced by:
-
getEntitySlots(EntityType<?>, Level)
-
getEntitySlots(EntityType<?>, boolean)
- Replaced by:
CuriosSlotTypes#getDefaultEntitySlotTypes(EntityType<?>, boolean)
- Replaced by:
-
getItemStackSlots(ItemStack, Level)
-
getItemStackSlots(ItemStack, boolean)
- Replaced by:
CuriosSlotTypes#getItemSlotTypes(ItemStack, boolean)
- Replaced by:
-
getItemStackSlots(ItemStack, LivingEntity)
- Replaced by:
CuriosSlotTypes#getItemSlotTypes(ItemStack, LivingEntity)
- Replaced by:
-
getAttributeModifiers
- Replaced by:
ICurioItem#getAttributeModifiers(ItemStack)
- Replaced by:
-
addSlotModifier(Multimap<Holder<Attribute>, AttributeModifier>, String, ResourceLocation, double, AttributeModifier.Operation)
-
addSlotModifier(ItemStack, String, ResourceLocation, double, AttributeModifier.Operation, String)
-
addModifier
- Replaced by:
CurioAttributeModifiers
- Replaced by:
-
withSlotModifier
- Replaced by: None, replacement functionality still pending implementation.
-
registerCurioPredicate
- Replaced by:
CuriosSlotTypes#registerPredicate
- Replaced by:
-
getCurioPredicate
- Replaced by:
CuriosSlotTypes#getPredicate
- Replaced by:
-
getCurioPredicates
- Replaced by:
CuriosSlotTypes#getPredicates
- Replaced by:
-
testPredicates
- Replaced by:
CuriosSlotTypes#testPredicates
- Replaced by:
Description
These deprecations serve as the first part of future plans to deprecate the entirety of the CuriosApi
class. The purpose is to avoid
having disparate methods all in the same class, while also increasing discovery for these methods by categorizing them appropriately
into separate delegate classes. The new CuriosSlotTypes
class will serve as the functional replacement for the methods in this class
and also the methods in the removed ISlotHelper
class, with logic related to one or more slot types. In addition, ICurioItem
and
CurioAttributeModifiers
will handle curio attribute modifiers depending on which is more appropriate.
Items
Methods
ICurio
and ICurioItem
getAttributeModifiers(SlotContext, UUID)
- Replaced by:
getDefaultCurioAttributeModifiers
- Replaced by:
Description
These deprecations follow the new internal changes to curio attribute modifiers, which have now fully moved from
Multimap<Holder<Attribute>>, AttributeModifier>
instances to the CurioAttributeModifiers
data component. Due to this, the original
attribute modifier methods that utilize maps are no longer recommended in favor of a new one that uses the component class instead.
Rendering
Class
CuriosRendererRegistry
Methods
CuriosRendererRegistry
register
- Replaced by:
ICurioRenderer#register
- Replaced by:
getRenderer
- Replaced by:
ICurioRenderer#get
andICurioRenderer#getOrNull
- Replaced by:
Description
These methods and the class have all been deprecated. This decision was made to streamline both discovery and usage by relocating these methods to the interface that developers use most directly. The deprecated class simply redirects its methods to the new methods, so while they are candidates for removal in future breaking versions they are not high-priority targets and will likely remain for several versions since these methods are the primary ones used by developers.
Methods
ICurioRenderer
translateIfSneaking
rotateIfSneaking
followHeadRotations
followBodyRotations
- Replaced by:
ICurioRenderer#setupHumanoidAnimations
- Replaced by:
Description
These utility methods in the ICurioRenderer
interface have been deprecated. Due to the rendering changes in Minecraft and the
breaking changes in the render
method, a new method setupHumanoidAnimations
has been created to both accommodate these
changes and create a more complete a robust solution to humanoid animations on models. The utility methods before were functional
but clunky to use and didn't always function as expected due to the intermingling of different parts and hardcoded values. The
new method simply takes a model, provided by the implementation, and a render state, provided by the render
parameters, and
will do all of the necessary transformations previously enabled by the deprecated methods.
Events
Methods
CurioAttributeModifierEvent
getModifiers
- Replaced by:
getImmutableModifiers
- Replaced by:
getOriginalModifiers
- Replaced by:
getDefaultModifiers
- Replaced by:
removeModifier(Holder<Attribute>, AttributeModifier)
- Replaced by:
removeModifier(Holder<Attribute>, ResourceLocation)
- Replaced by:
removeAttribute(Holder<Attribute>)
- Replaced by:
removeAllModifiersFor(Holder<Attribute>)
- Replaced by:
Description
These deprecations follow the breaking changes to the class noted above.
Others
Method
ICurioSlotExtension#getSlotTooltip(SlotContext, TooltipFlag)
- Replaced by:
ICurioSlotExtension#getSlotTooltip(SlotContext, List<Component>, TooltipFlag)
Description
This method is replaced by a better one that receives the original tooltip, allowing for potential modification or checking.
Method
ISlotType#getIdentifier
- Replaced by:
ISlotType#getId
Description
This method is simply replaced by a more concisely named one. This is one of the few deprecations not marked for removal, since its continuity adds no future maintenance burden or concerns.
Class
CuriosTooltip
- All methods
Description
Due to the transition to using NeoForge's native tooltip utilities and events, this class no longer serves an effective function and is thus deprecated.
Development Plans
These are broad outlines for plans and ideas for future development that are considered high-priority but with no target version or date in mind for their completion.
Inventory Refactor
Although there have been various updates, features, and changes to the curio inventory system, a lot of the foundations have remained the same since its inception. This is partially due to the work involved in rewriting it, but also because rewriting it would subsequently affect many other parts of the API in a way that would ultimately culminate in a rather large recoding burden for developers. For those reasons, plans to fundamentally redesign the inventory were put on hold for a long time.
However, the current system has now reached the limits of what it's capable of and is also now limiting the capabilities of the API as some recent attempts to implement specific new features proved either difficult or impossible. So the current plans are to refactor the whole inventory system, and to try and do so in a way that leads to the least amount of breaking changes between versions in order to allow developers time to update as needed.
Specifically, this would mostly target the ICuriosItemHandler
, ICurioStacksHandler
, and IDynamicStackHandler
interfaces in the API.
Because of how intricately linked these interfaces are to the inventory, breaking changes are inevitable. It's likely that ICurioStacksHandler
and IDynamicStackHandler
will see a removal once the refactor is done, as deprecation would be difficult or impossible. Conversely,
ICuriosItemHandler
could potentially continue to exist through a wrapper implementation around the new inventory system.
As mentioned previously, these changes would also likely have ramifications across the entire API, particularly any points that touch
the inventory system. The most prominent example being SlotContext
, which may see changes or even replacement depending on what
the final implementation looks like.
ICurioItem
Consolidation
There currently exists two separate interfaces for curio items, ICurio
and ICurioItem
. This wasn't the intended design at first, but
became necessary in order to meet the needs of both direct implementations and capability-based ones.
However, having two interfaces leads to more confusion and a lot of redundancy in the API to accommodate them. In addition, having two
is not strictly necessary to provide the functionality that they were intended for. So the current plans are to merge them both and
leave only ICurioItem
, which will also help consolidate some curio-based utility methods into the same interface.
This would likely occur before the above-mentioned inventory refactor, due to the presence of SlotContext
in many of the method
parameters in these classes. If SlotContext
is changed due to the inventory refactor, it would only require updating/deprecating one
class rather than two.