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
|
|
|
|
|
|
|
|
|
2022-06-05 22:51:44 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
2023-06-08 01:44:11 +02:00
|
|
|
index cb6f5fc352aff449173825d4e7fad9fccb9df915..5f9c3c237b65986f8c425bbc691ac301f8fdebbc 100644
|
2022-06-05 22:51:44 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
2023-05-12 13:10:08 +02:00
|
|
|
@@ -984,4 +984,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
2022-06-05 22:51:44 +02:00
|
|
|
|
|
|
|
throw new IllegalArgumentException("Cannot spawn an entity for " + clazz.getName());
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
+
|
2022-06-05 22:51:44 +02:00
|
|
|
+ // Paper start
|
2021-06-11 14:02:28 +02:00
|
|
|
+ @Override
|
|
|
|
+ public io.papermc.paper.world.MoonPhase getMoonPhase() {
|
2022-06-05 22:51:44 +02:00
|
|
|
+ return io.papermc.paper.world.MoonPhase.getPhase(this.getHandle().dayTime() / 24000L);
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
2022-06-05 22:51:44 +02:00
|
|
|
+ // Paper end
|
|
|
|
}
|