Paper/patches/server/0393-Add-moon-phase-API.patch

23 lines
984 B
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
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
2024-10-24 19:29:35 +02:00
index 92a0c2049fa1df76cedfe7dfbd6e5fe402859f4b..15da29058f80a2d7cf2be26c48421c1746815a10 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
2024-10-24 19:29:35 +02:00
@@ -515,4 +515,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
throw new IllegalArgumentException("Cannot spawn an entity for " + clazz.getName());
2021-06-11 14:02:28 +02:00
}
+
+ // Paper start
2021-06-11 14:02:28 +02:00
+ @Override
+ public io.papermc.paper.world.MoonPhase getMoonPhase() {
+ return io.papermc.paper.world.MoonPhase.getPhase(this.getHandle().dayTime() / 24000L);
2021-06-11 14:02:28 +02:00
+ }
+ // Paper end
}