Paper/Spigot-API-Patches/0158-Add-sun-related-API.patch
Aikar 57dd397155
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:
b999860d SPIGOT-2304: Add LootGenerateEvent

CraftBukkit Changes:
77fd87e4 SPIGOT-2304: Implement LootGenerateEvent
a1a705ee SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent
41712edd SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
2020-05-01 18:03:57 -04:00

49 lines
1.4 KiB
Diff

From 7bfc23854585ea3d9b0281708668e638eb17f2a3 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 00:54:15 -0500
Subject: [PATCH] Add sun related API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index b7ad4f566..c88f17244 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1646,6 +1646,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public void setFullTime(long time);
+ // Paper start
+
+ /**
+ * Check if it is currently daytime in this world
+ *
+ * @return True if it is daytime
+ */
+ public boolean isDayTime();
+ // Paper end
+
/**
* Returns whether the world has an ongoing storm.
*
diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
index b13228781..d726453c0 100644
--- a/src/main/java/org/bukkit/entity/Mob.java
+++ b/src/main/java/org/bukkit/entity/Mob.java
@@ -16,6 +16,13 @@ public interface Mob extends LivingEntity, Lootable {
*/
@NotNull
com.destroystokyo.paper.entity.Pathfinder getPathfinder();
+
+ /**
+ * Check if this mob is exposed to daylight
+ *
+ * @return True if mob is exposed to daylight
+ */
+ boolean isInDaylight();
// Paper end
/**
--
2.26.2