convertToMcSafeType
When Registering an Object using the Register Class most of the time you receive a Modloader dependent Object (1). In some creation process's such as making a BlockEntity you need direct
access to the Registered Block, which you won't get in the case of Forge/NeoForge
you need to call the get()
function from the RegisteryObject
to access it, this is naturally not possible in the Commons project of a mod, so this function deals with the messiness of the mod loaders by doing the casting work itself
- The Actual registered Object for
Fabric/Quilt
and a RegistryObject forForge/NeoForge
Parameters:
obj
: The Object to convert.T
: The type to convert to.
Returns: The converted data data.