-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
base: dev
Are you sure you want to change the base?
Modernized WorldTag #2659
Conversation
- Need some feedback on the getGameRuleOrDefault method. Should it be static?
@@ -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'."); |
There was a problem hiding this comment.
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
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); | ||
} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
time.full
in favor oftime_full
time.duration
in favor oftime_duration
time.period
in favor oftime_period