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

Modernized WorldTag #2659

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

Modernized WorldTag #2659

wants to merge 6 commits into from

Conversation

heypr
Copy link
Contributor

@heypr heypr commented Oct 31, 2024

  • Deprecated time.full in favor of time_full
  • Deprecated time.duration in favor of time_duration
  • Deprecated time.period in favor of time_period
  • Updated many mechanisms
  • I do need some feedback on whether the gamerule stuff on line 1525 is okay to do.

@heypr heypr marked this pull request as draft October 31, 2024 23:40
@heypr heypr marked this pull request as ready for review December 23, 2024 00:05
@@ -344,6 +344,15 @@ public class BukkitImplDeprecations {
// Bad candidate for bumping, targets extremely commonly used naming, some of which may be hard to remove (eg stored in flag data).
public static Warning oldSpigotNames = new FutureWarning("oldSpigotNames", "Several features (particles, entities, etc.) had alternative naming added by Spigot, which are now deprecated in favor of the official Minecraft naming; see relevant feature's meta docs for more information.");

// Added 2024/12/23, deprecate officially by 2028.
public static Warning timePeriod = new FutureWarning("timePeriod", "'time.period' is deprecated in favor of 'time_period'.");
Copy link
Member

Choose a reason for hiding this comment

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

just do one deprecation for all of world.time, and use pointlessSubtagPrefix

Comment on lines -1485 to 1534
if (getGameRuleOrDefault(GameRule.DO_WEATHER_CYCLE) && world.hasStorm()) {
if (world.getGameRuleValue(GameRule.DO_WEATHER_CYCLE) == null) {
if (world.getGameRuleDefault(GameRule.DO_WEATHER_CYCLE) == null) {
throw new IllegalStateException("World " + world.getName() + " contains no GameRule " + GameRule.DO_WEATHER_CYCLE.getName());
}
}
if (world.hasStorm()) {
NMSHandler.worldHelper.clearWeather(world);
}
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure this is a breaking change because the actual value of the gamerule isn't checked anymore - but is there any reason this was changed/can't just use the method anymore?

@@ -1482,14 +1524,44 @@ public void adjust(Mechanism mechanism) {
NMSHandler.worldHelper.wakeUpAllPlayers(world);
}
// minor change: prior to 1.18, hasStorm/isRaining was not checked
if (getGameRuleOrDefault(GameRule.DO_WEATHER_CYCLE) && world.hasStorm()) {
if (world.getGameRuleValue(GameRule.DO_WEATHER_CYCLE) == null) {
if (world.getGameRuleDefault(GameRule.DO_WEATHER_CYCLE) == null) {
Copy link
Member

Choose a reason for hiding this comment

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

wait what why is this here twice

@@ -614,8 +615,10 @@ public static void register() {
// @returns DurationTag
// @description
// Returns the relative in-game time of this world as a duration.
Copy link
Member

Choose a reason for hiding this comment

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

replace the description with a deprecation notice as well. Look at other deprecated tags for example

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

Successfully merging this pull request may close these issues.

3 participants