So the limitations with the previous system were:
- context arguments sometimes being mentioned and sometimes not is a bit confusing
- every function's input / output types are set in stone at registration. this means that when making a function like
if-else
, you have to create and register it for both booleans and numbers - mostly due to the point above, the only things a function can output are booleans and numbers, and adding another type that a function can output would involve making another Registry
- the design of the code weighed too heavily towards making datagen "easier" (i.e. making red squiggly lines appear if you screw up the types) by providing a factory function for each DFunctionType, resulting in massive type signatures where even the simplest looked like
DFunctionType<Boolean, ? extends Function<ContextArg<Entity>, ? extends DFunction<Boolean>>>
. This also resulted in the hugeDFunctionImplementations
class. - there was no way to create objects from JSON i