For context, here is the project with the C# https://github.com/daniellimws/godot-procedural-landmass/blob/master/Scripts/TextureGenerator.cs
GitHub
Implementation of https://www.youtube.com/playlist?list=PLFt_AvWsXl0eBW2EiBtl_sxmDtSgZBxB3 in godot - godot-procedural-landmass/TextureGenerator.cs at master · daniellimws/godot-procedural-landmass