Paper/Spigot-Server-Patches/0558-Add-moon-phase-API.patch
Mariell Hoversholm 74f507f4e3 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e461dcfe #555: Item - add getters/setters for owner/thrower

CraftBukkit Changes:
055870c4 #758: Item - add getters/setters for owner/thrower
2020-10-14 10:44:15 -04:00

23 lines
918 B
Diff

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
index 3e6924a05bd85563d75f51e4e275896c77d7ad42..299f57ca2a65887a0d7e7c584fc1bd5c783b0db2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -327,6 +327,11 @@ public class CraftWorld implements World {
public int getPlayerCount() {
return world.players.size();
}
+
+ @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();