Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

potentailly add a new field to the server config #900

Open
RestartFU opened this issue Jul 17, 2024 · 1 comment
Open

potentailly add a new field to the server config #900

RestartFU opened this issue Jul 17, 2024 · 1 comment

Comments

@RestartFU
Copy link
Contributor

hey, recently, while working on my custom provider for dragonfly, I realized that when players get spawned in, they are always going to get spawned in using the server worlds (overworld, nether, end).

This is great but this means that we'd have to merge our dimensions into a single world. Not everybody wants to do that.

As you can see here: https://github.com/bedrock-gophers/provider/blob/master/provider/settings.go#L16-L19
I've made it so you can give a custom world "resolver", which you can use if you are using my custom player provider

here's how we use it on moyai:

func wrld(dim world.Dimension) *world.World {
	switch dim {
	case world.Overworld:
		return Overworld()
	case world.Nether:
		return Nether()
	case world.End:
		fmt.Println("end")
		return End()
	}
	return nil
}

func NewServer(config server.Config) *server.Server {
	providerSettings := provider.DefaultSettings()
	providerSettings.UseServerWorld = false
	providerSettings.World = wrld
	providerSettings.FlushRate = time.Minute * 10
	providerSettings.SaveEffects = false

	playerProvider = provider.NewProvider(&config, providerSettings)
	srv = config.New()
	return srv
}

I was wondering if the main developers would be OK with adding such a field to the server config
(only the world function I mean)

if so, please suggest field names so I can start working on a PR

@T14Raptor
Copy link
Member

This can already be done by providing a world using this field in the player's data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants