Paper/Spigot-Server-Patches/0294-Add-sun-related-API.patch

53 lines
2.1 KiB
Diff
Raw Normal View History

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
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
2021-03-16 14:04:28 +01:00
index 41566398f5eee6cf93376f2e2200728bb6d2181c..db72b685f4a4b95f345f1d34f9eeb83b8731120a 100644
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
2021-03-16 14:04:28 +01:00
@@ -1597,6 +1597,7 @@ public abstract class EntityInsentient extends EntityLiving {
2020-06-25 16:09:55 +02:00
}
+ public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER
protected boolean eG() {
if (this.world.isDay() && !this.world.isClientSide) {
float f = this.aR();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2021-05-16 01:42:36 +02:00
index 880bbf09f77f59824184c1c9dd1ca3c3df09dae9..95b4774b7696fa9711d7169d06a23c70364bfdb2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -865,6 +865,13 @@ public class CraftWorld implements World {
}
}
+ // Paper start
2019-05-06 04:58:04 +02:00
+ @Override
+ public boolean isDayTime() {
+ return getHandle().isDay();
+ }
+ // Paper end
+
2019-05-06 04:58:04 +02:00
@Override
2021-02-21 21:55:01 +01:00
public long getGameTime() {
return world.worldData.getTime();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
index 28a4e90130f51fd2fda7003fde5b4d0a410e1aef..06cbe63ef04e0de824ac0b9d545b6da1f53701b3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
@@ -78,4 +78,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
public long getSeed() {
return getHandle().lootTableSeed;
}
+
+ // Paper start
2019-05-06 04:58:04 +02:00
+ @Override
+ public boolean isInDaylight() {
+ return getHandle().isInDaylight();
+ }
+ // Paper end
}