aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0256-Add-sun-related-API.patch
blob: 67f9eb6f7c839f530662b99171aa53385d4276f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
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 8aac52d6a31c36ce7fd173972ab4709c1dc95f9f..f3d52650e9dd338396d325c9fb7a46e3927d3b36 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -756,6 +756,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 d597eea5d5c2f223e87bff06f292619657596f1f..2a8596e4f9d7be966c18e867c2c7b5bfbea9742c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
@@ -90,4 +90,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
 }