aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0199-Add-moon-phase-API.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-09-30 11:44:36 -0700
committerJake Potrebic <[email protected]>2024-09-30 16:02:52 -0700
commite7e1ab56ca2a401aabacaee2de5818a93886bea3 (patch)
treeb8fc5d35bec2d9466f8cac95289797684a70968b /patches/api/0199-Add-moon-phase-API.patch
parentba3c29b92ec29c8c321f7e6160a4a25f65f18088 (diff)
downloadPaper-e7e1ab56ca2a401aabacaee2de5818a93886bea3.tar.gz
Paper-e7e1ab56ca2a401aabacaee2de5818a93886bea3.zip
Finish converting most of the undeprecated api to jspecify
Diffstat (limited to 'patches/api/0199-Add-moon-phase-API.patch')
-rw-r--r--patches/api/0199-Add-moon-phase-API.patch15
1 files changed, 7 insertions, 8 deletions
diff --git a/patches/api/0199-Add-moon-phase-API.patch b/patches/api/0199-Add-moon-phase-API.patch
index d949b274a6..bb0b1570be 100644
--- a/patches/api/0199-Add-moon-phase-API.patch
+++ b/patches/api/0199-Add-moon-phase-API.patch
@@ -6,17 +6,17 @@ Subject: [PATCH] Add moon phase API
diff --git a/src/main/java/io/papermc/paper/world/MoonPhase.java b/src/main/java/io/papermc/paper/world/MoonPhase.java
new file mode 100644
-index 0000000000000000000000000000000000000000..df05153397b42930cd53d37b30824c7e5f008f7e
+index 0000000000000000000000000000000000000000..0b24e1a92bba4fed0ca2d4336a3b8351a800f93a
--- /dev/null
+++ b/src/main/java/io/papermc/paper/world/MoonPhase.java
-@@ -0,0 +1,36 @@
+@@ -0,0 +1,35 @@
+package io.papermc.paper.world;
+
-+import org.jetbrains.annotations.NotNull;
-+
+import java.util.HashMap;
+import java.util.Map;
++import org.jspecify.annotations.NullMarked;
+
++@NullMarked
+public enum MoonPhase {
+ FULL_MOON(0L),
+ WANING_GIBBOUS(1L),
@@ -29,20 +29,19 @@ index 0000000000000000000000000000000000000000..df05153397b42930cd53d37b30824c7e
+
+ private final long day;
+
-+ MoonPhase(long day) {
++ MoonPhase(final long day) {
+ this.day = day;
+ }
+
+ private static final Map<Long, MoonPhase> BY_DAY = new HashMap<>();
+
+ static {
-+ for (MoonPhase phase : values()) {
++ for (final MoonPhase phase : values()) {
+ BY_DAY.put(phase.day, phase);
+ }
+ }
+
-+ @NotNull
-+ public static MoonPhase getPhase(long day) {
++ public static MoonPhase getPhase(final long day) {
+ return BY_DAY.get(day % 8L);
+ }
+}