This is bad concept design, because your components will be tightly coupled. Instead, you can pass reference to Main
node to your block.gd when you instance this node, for example:
# block.gd
var main
# main.gd
var block = Block.instance()
block.main = self
so instead of get_tree().get_parent()
you will simply write main
.
Or you can expose it as member of Singleton class (https://docs.godotengine.org/en/stable/getting_started/step_by_step/singletons_autoload.html)
# provider.gd
var main
# main.gd
func _init():
Provider.main = self
then get_tree().get_parent()
can be written as Provider.main
.