Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
18f0f8d1ca
Upstream has released updates that appear 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: 312281ea PR-742: Make World implement Keyed CraftBukkit Changes: 2ac7fa7a SPIGOT-7014: getLootTable API should not persistently update loot table 7fdd7941 PR-1046: Make World implement Keyed 7bc728a6 PR-1045: Revert changes to persistence required checks Spigot Changes: b6d12d17 Rebuild patches
23 Zeilen
948 B
Diff
23 Zeilen
948 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 797dfc6b10aab7a84a19cd49854b23bd04341d6b..2a388f8bbbdfb4dc469bcfce6a6241066a7fe597 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -195,6 +195,11 @@ public class CraftWorld extends CraftRegionAccessor 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();
|