aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0398-Add-moon-phase-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0398-Add-moon-phase-API.patch')
-rw-r--r--patches/server/0398-Add-moon-phase-API.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0398-Add-moon-phase-API.patch b/patches/server/0398-Add-moon-phase-API.patch
new file mode 100644
index 0000000000..539ccca6de
--- /dev/null
+++ b/patches/server/0398-Add-moon-phase-API.patch
@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath <[email protected]>
+Date: Sun, 23 Aug 2020 16:32:11 +0200
+Subject: [PATCH] Add moon phase API
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+index 454f3a08c4d319f3d3fe2b1209c4d8b9fa9d4d08..1963e826548c5a8859c50f57654784c3aef50e44 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+@@ -509,4 +509,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
+
+ throw new IllegalArgumentException("Cannot spawn an entity for " + clazz.getName());
+ }
++
++ // Paper start
++ @Override
++ public io.papermc.paper.world.MoonPhase getMoonPhase() {
++ return io.papermc.paper.world.MoonPhase.getPhase(this.getHandle().dayTime() / 24000L);
++ }
++ // Paper end
+ }