aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0373-Add-sun-related-API.patch
blob: 6c9b4abdc07ac892b73fc1f93ecb2d856e6e0f71 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From d8da756f4792ecdda39669d0407a4d76e60cbc21 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


diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 693973e97..d1e70931e 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -1288,6 +1288,7 @@ public abstract class EntityInsentient extends EntityLiving {
         return flag;
     }
 
+    public boolean isInDaylight() { return dq(); } // Paper - OBFHELPER
     protected boolean dq() {
         if (this.world.L() && !this.world.isClientSide) {
             float f = this.az();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index bde8ad29b..0f34b4163 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -829,6 +829,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
         }
     }
 
+    public boolean isDayTime() { return L(); } // Paper - OBFHELPER
     public boolean L() {
         return this.G < 4;
     }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index eacecccfd..7c0a53053 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -538,6 +538,12 @@ public class CraftWorld implements World {
         }
     }
 
+    // Paper start
+    public boolean isDayTime() {
+        return getHandle().isDayTime();
+    }
+    // Paper end
+
     public boolean createExplosion(double x, double y, double z, float power) {
         return createExplosion(x, y, z, power, false, true);
     }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
index 53c2d154e..40a429942 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
@@ -68,4 +68,10 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
     public long getSeed() {
         return getHandle().lootTableSeed;
     }
+
+    // Paper start
+    public boolean isInDaylight() {
+        return getHandle().isInDaylight();
+    }
+    // Paper end
 }
-- 
2.21.0