Skip to content

Improve GameRule API#7244

Closed
Machine-Maker wants to merge 2 commits intoPaperMC:masterfrom
Machine-Maker:feature/gamerule-api-improvements
Closed

Improve GameRule API#7244
Machine-Maker wants to merge 2 commits intoPaperMC:masterfrom
Machine-Maker:feature/gamerule-api-improvements

Conversation

@Machine-Maker
Copy link
Member

Getting a gamerule's default value shouldn't be tied to needing a world instance since it's the same without a world. Also, the methods to get the gamerule's value for a world and default world should be notnull, so the methods I added to GameRule to get/set the world have an Objects.requireNonNull wrapped around them.

@Machine-Maker Machine-Maker requested a review from a team as a code owner January 1, 2022 23:58
@Machine-Maker Machine-Maker force-pushed the feature/gamerule-api-improvements branch from acf5393 to 6ce6fd1 Compare January 2, 2022 06:05
@kennytv
Copy link
Member

kennytv commented Jan 2, 2022

I don't like how this duplicates all the methods for no real reason, the nullability change is just a confusing hack with the world method still being marked as nullable. Imo the getDefault in Server and the world methods in GameRule should be removed

@Machine-Maker
Copy link
Member Author

Machine-Maker commented Jan 2, 2022

I don't like how this duplicates all the methods for no real reason, the nullability change is just a confusing hack with the world method still being marked as nullable. Imo the getDefault in Server and the world methods in GameRule should be removed

I need the getDefault in server to have a way of getting the default rule value without a reference to the world. currently, the only way to get the default rule value requires a world, which is totally unneeded.

@kennytv
Copy link
Member

kennytv commented Jan 2, 2022

Ah I didn't see GameRule is not an interface implemented in CraftBukkit

@Machine-Maker Machine-Maker force-pushed the feature/gamerule-api-improvements branch from 6ce6fd1 to a38369c Compare January 2, 2022 18:22
@stale
Copy link

stale bot commented Mar 3, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@Machine-Maker Machine-Maker force-pushed the feature/gamerule-api-improvements branch from a38369c to 235d228 Compare March 30, 2022 03:58
@Machine-Maker
Copy link
Member Author

Rebased for 1.18.2

@stale
Copy link

stale bot commented May 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Jul 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@Machine-Maker Machine-Maker force-pushed the feature/gamerule-api-improvements branch from 235d228 to fd896f0 Compare July 31, 2022 16:46
@Machine-Maker
Copy link
Member Author

Rebased for 1.19.1

@lynxplay lynxplay force-pushed the feature/gamerule-api-improvements branch from 85e0049 to 3badd78 Compare September 29, 2024 14:33
@Warriorrrr Warriorrrr moved this from Awaiting review to Waiting For Author in Paper PR Queue Mar 5, 2025
@kennytv kennytv added the pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch label Mar 23, 2025
@kennytv kennytv deleted the branch PaperMC:master March 23, 2025 19:15
@kennytv kennytv closed this Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch pre-softspoon

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants