PolyhedralDev / Terra

Voxel world generation modding platform
MIT License
670 stars 88 forks source link

Add salt argument to sampler functions in EXPRESSION samplers #454

Closed pumken closed 7 months ago

pumken commented 7 months ago

Pull Request

Description

This is a naïve implementation of #371. An additional, mandatory argument is included for all sampler functions which is cast to long. It seems to work and comply with the issue, but is inelegant and suspiciously simple.

In theory, this could be a non-breaking change if it used function overloading or optional arguments, but to my limited knowledge, this isn't currently possible. Every function is required to provide a static number of arguments through com.dfsek.paralithic.functions.Function#getArgNumber(int) and no two functions can share the same name as they're stored in a Map<String, Function>.

I request any feedback on if this actually solves the issue or if it could be improved in any way so that I may learn and be better able to contribute.

Closes #371

Changelog

Checklist

Mandatory checks

Types of changes

Compatibility

Documentation

Testing

Licensing