[Bug] Crash with EMFAnimationApi.registerSingletonAnimationVariable
pythoncoder1234 opened this issue ยท 0 comments
Describe the bug
Calling EMFAnimationApi.registerSingletonAnimationVariable
with a FloatSupplier
crashes the game
To Reproduce
Steps to reproduce the behavior:
- Register a singleton float variable by calling the
registerSingletonAnimationVariable
function with aFloatSupplier
- Launch the game
Expected behavior
It shouldn't crash (and also should register the variable)
Crashlog
If applicable, add your crashlog or latest.log to help explain your problem.
- Minecraft Version: [1.21.4]
- EMF version [2.4.1]
- Does the issue persist with only EMF installed? Yes
- latest.log
Additional context
Likely cause of the issue:
Line 86 of EMFAnimationAPI
VariableRegistry.getInstance().registerSimpleFloatVariable(variableName, variableExplanationTranslationKeyOrText, (MathValue.ResultSupplier) variableValueSupplier);
The variableValueSupplier
, which does not inherit from MathValue.ResultSupplier
, is forcibly cast to it, producing a ClassCastException