Skip to content

Allow Server#getDefaultGameMode before worlds are initialized#12490

Merged
lynxplay merged 4 commits into
PaperMC:mainfrom
NonSwag:default-gamemode
Apr 28, 2025
Merged

Allow Server#getDefaultGameMode before worlds are initialized#12490
lynxplay merged 4 commits into
PaperMC:mainfrom
NonSwag:default-gamemode

Conversation

@NonSwag
Copy link
Copy Markdown
Contributor

@NonSwag NonSwag commented Apr 28, 2025

Instead of accessing the level directly we return the configured value from properties

Without fix
image

With fix
image

@NonSwag NonSwag requested a review from a team as a code owner April 28, 2025 12:27
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Apr 28, 2025
@github-project-automation github-project-automation Bot moved this from Awaiting review to Awaiting final testing in Paper PR Queue Apr 28, 2025
@Doc94
Copy link
Copy Markdown
Member

Doc94 commented Apr 28, 2025

If the get fail in that phase then the set has the same issue?

@lynxplay
Copy link
Copy Markdown
Contributor

There isn't much we can do in that case tho. We cannot modify the server properties state.
We could maybe fail nicer?

@Doc94
Copy link
Copy Markdown
Member

Doc94 commented Apr 28, 2025

There isn't much we can do in that case tho. We cannot modify the server properties state. We could maybe fail nicer?

yeah i was thinking about that.. a Precondition with a state exception but that can be another PR not? or in this for avoid a +1 xd

@lynxplay
Copy link
Copy Markdown
Contributor

Well, rn it doesn't fail at all, it just doesn't do anything.
Maybe we nag? I don't know how useful the setter even is but yea, definitely can just be a new PR.

@lynxplay lynxplay merged commit d1810f2 into PaperMC:main Apr 28, 2025
3 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting final testing to Merged in Paper PR Queue Apr 28, 2025
@NonSwag NonSwag deleted the default-gamemode branch April 28, 2025 15:48
@NonSwag NonSwag restored the default-gamemode branch April 28, 2025 15:48
NonSwag added a commit to NonSwag/Paper that referenced this pull request Apr 28, 2025
@Lulu13022002
Copy link
Copy Markdown
Contributor

getMap has a similar issue if you want to look, also .overworld() exists too

@NonSwag NonSwag deleted the default-gamemode branch April 28, 2025 16:13
Sayakie added a commit to InstellarMC/Stellar that referenced this pull request Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

4 participants