aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0258-Add-sun-related-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0258-Add-sun-related-API.patch')
-rw-r--r--patches/server/0258-Add-sun-related-API.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/server/0258-Add-sun-related-API.patch b/patches/server/0258-Add-sun-related-API.patch
new file mode 100644
index 0000000000..9725c39278
--- /dev/null
+++ b/patches/server/0258-Add-sun-related-API.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath <[email protected]>
+Date: Sun, 7 Oct 2018 00:54:21 -0500
+Subject: [PATCH] Add sun related API
+
+== AT ==
+public net.minecraft.world.entity.Mob isSunBurnTick()Z
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+index 358fe6e35ab7555bbd6ae075bcec5249e09dede1..0cded703702e7271eec909e470fbfded17eb791f 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+@@ -711,6 +711,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+ }
+ }
+
++ // Paper start
++ @Override
++ public boolean isDayTime() {
++ return getHandle().isDay();
++ }
++ // Paper end
++
+ @Override
+ public long getGameTime() {
+ return this.world.levelData.getGameTime();
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+index 018884ced888fcd03d2fb17b3620f8e6125e67da..0ad9885f939bcb50026d50ed78b970a44772ceb8 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+@@ -93,4 +93,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
+ public long getSeed() {
+ return this.getHandle().lootTableSeed;
+ }
++
++ // Paper start
++ @Override
++ public boolean isInDaylight() {
++ return getHandle().isSunBurnTick();
++ }
++ // Paper end
+ }