aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0266-Add-sun-related-API.patch
blob: 1afb4b7b61865fadfe274766b39b1107be24095f (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 e8229f2004b3a729417e99897b641e5bde0fa781..c92b931e2a54122e7a7aeafc5f88faee59c5e0fb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -695,6 +695,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 c2acbf533b5f3aebe4837512f694fe25abee65d6..74843d1fa344497d35f05d0b04f650edd1e0f3a1 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
 }