3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/patches/server/0484-Add-moon-phase-API.patch

23 Zeilen
948 B
Diff

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
2022-03-30 22:28:38 +02:00
index de65baee5ae66c4ba5625701b1646e4129b5e054..d27a921672a12ad5506c5af080e52cfb2500f7e7 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
2022-03-01 06:43:03 +01:00
@@ -194,6 +194,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();