Repository navigation
Add World Clock API - #14402
Add World Clock API#14402NonSwag wants to merge 5 commits into
Conversation
kennytv
left a comment
There was a problem hiding this comment.
Doesn't need the experimental annotations I'd say
c0b4c49 to
b0c8b12
Compare
| * @param ticks the tick this marker occurs on | ||
| * @param showInCommands whether the marker should be suggested in commands | ||
| */ | ||
| record TimeMarker(@Range(from = 0, to = Integer.MAX_VALUE) int ticks, boolean showInCommands) { |
There was a problem hiding this comment.
no API records, we've been bitten by this before. Make it an interface and add static methods to create one.
b0c8b12 to
431b424
Compare
|
Why Range and not NonNegative/Positive? |
Pretty much just personal preference. Most projects I contribute to, have jetbrains' annotations, so kinda my go to. |
okay i suppose is not a problem but in general we try to use that for that static ranges and the Paper Util for range check later (in implementation with https://github.com/PaperMC/Paper/blob/main/paper-api/src/main/java/io/papermc/paper/util/BoundChecker.java) |
Supersedes #14086
Based on main...feature/clock-api
Notes
When
time.affects-all-worldsis enabled, changes apply to the shared global clocks.World#getTime/setTime(time of day) as those assume a 24000 tick day, which not every clock has. (should we deprecate those?)WorldCreatorclock and timeline overrides from the original branch are not included.Behavior changes
/time set <ticks>no longer changes the clokc when its event is cacneled.ClockTimeSkipEventinstead ofTimeSkipEventwhentime.affects-all-worldsis enabled.equalsandhashCodeoverrides to the vanillaTimelineso that the registry builder round-trip test can compare rebuilt timelines.TimeSkipEventextendsClockTimeSKipEventbut has its own HandlerList, soClockTimeSkipEventlisteners don't receive per-world skips. That was already the case after #13814. Should this be documented or changed?