testserver/patches/server/0510-Add-moon-phase-API.patch

23 lines
920 B
Diff
Raw Normal View History

2021-06-11 12:02:28 +00: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-06-16 10:14:53 +00:00
index d1c7d5a0918bf4d11c453fe31b3dfda9e146474c..99e0413cad2bca77e80ea67aaeb78ebb25e6f896 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2021-06-14 10:42:08 +00:00
@@ -325,6 +325,11 @@ public class CraftWorld implements World {
2021-06-11 12:02:28 +00:00
public int getPlayerCount() {
2021-06-14 10:42:08 +00:00
return world.players().size();
2021-06-11 12:02:28 +00: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();