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

Add Halloween API #10639

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add Halloween API #10639

wants to merge 1 commit into from

Conversation

SoSeDiK
Copy link
Contributor

@SoSeDiK SoSeDiK commented May 1, 2024

Allow checking / forcing Halloween Season/Day via API.
Also makes a tiny optimization over vanilla by using the month/day ints directly (they are stored in fields) instead of fetching from enum.

@SoSeDiK SoSeDiK requested a review from a team as a code owner May 1, 2024 14:39
- int j = localdate.get(ChronoField.MONTH_OF_YEAR);
-
- return j == 10 && i >= 20 || j == 11 && i <= 3;
+ return org.bukkit.Bukkit.isHalloweenSeason(); // Paper - Add Halloween API
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would much rather we not redirect mojang calls into replacements from the bukkit singleton

Copy link
Contributor Author

@SoSeDiK SoSeDiK May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation is the same, plus forced enable/disable. The patch should fail in case vanilla changes anything.
Not overriding these kinda makes half of this API (forcing/disabling Halloween) obsolete.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally in the long run want to start moving away from the Bukkit/Server "god" class, and so would generally prefer that we don't move implementation aspects to it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the alternative?
Without it, plugins won't have a common ground to communicate, and in this case it makes no sense to enable/disable Halloween and yet have no according behavior changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create another class and proxy the calls to that; maybe others on the team won't care as much, however

@lynxplay lynxplay added the type: feature Request for a new Feature. label May 1, 2024
@kashike
Copy link
Member

kashike commented May 1, 2024

Is this really needed in the API? This can be re-created in a plugin easily.

@Owen1212055
Copy link
Member

Agreed

@SoSeDiK
Copy link
Contributor Author

SoSeDiK commented May 1, 2024

Depends. You need to duplicate the perfectly working vanilla system (having another time check, changing equipment on some entities, controlling bat's spawn rules and keeping track of changes in the future) while also not having any communication with other plugins.

I'd love for plugins to be able to add features during Halloween while also providing a ground to control it from one place (Paper's a good source to depend on, unlike some obscure plugin). I don't think maintaining this is much of a pain.
Feel free to close if doomed unwanted though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Request for a new Feature.
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

None yet

5 participants