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/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2021-11-25 09:54:06 +01:00
|
|
|
index 85b688ee046c160f689495d97e2c48bef4ad6cdb..b2efce98e8d6f5297646e4f270bc2d5cc7e182f0 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2021-10-05 05:14:11 +02:00
|
|
|
@@ -183,6 +183,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
2021-06-11 14:02:28 +02:00
|
|
|
public int getPlayerCount() {
|
2021-06-14 12:42:08 +02:00
|
|
|
return world.players().size();
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public io.papermc.paper.world.MoonPhase getMoonPhase() {
|
|
|
|
+ return io.papermc.paper.world.MoonPhase.getPhase(getFullTime() / 24000L);
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
private static final Random rand = new Random();
|