2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-10-12 01:42:49 +00:00
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
Date: Sun, 7 Oct 2018 00:54:21 -0500
|
|
|
|
Subject: [PATCH] Add sun related API
|
|
|
|
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
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 13:04:28 +00:00
|
|
|
index 41566398f5eee6cf93376f2e2200728bb6d2181c..db72b685f4a4b95f345f1d34f9eeb83b8731120a 100644
|
2021-03-16 07:19:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
2021-03-16 13:04:28 +00:00
|
|
|
@@ -1597,6 +1597,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2020-06-25 14:09:55 +00:00
|
|
|
|
2018-10-12 01:42:49 +00:00
|
|
|
}
|
|
|
|
|
2020-08-25 02:22:08 +00:00
|
|
|
+ public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER
|
|
|
|
protected boolean eG() {
|
2019-12-17 22:39:07 +00:00
|
|
|
if (this.world.isDay() && !this.world.isClientSide) {
|
2020-11-03 02:22:15 +00:00
|
|
|
float f = this.aR();
|
2018-10-12 01:42:49 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2021-04-18 07:52:36 +00:00
|
|
|
index 796fd718f3fe57618aedc9f5a41aac64422e3e34..2197dad881bf5e9d90902c4526db18e19a087230 100644
|
2018-10-12 01:42:49 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2021-04-18 07:52:36 +00:00
|
|
|
@@ -865,6 +865,13 @@ public class CraftWorld implements World {
|
2018-10-12 01:42:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
2019-05-06 02:58:04 +00:00
|
|
|
+ @Override
|
2018-10-12 01:42:49 +00:00
|
|
|
+ public boolean isDayTime() {
|
2019-12-17 22:39:07 +00:00
|
|
|
+ return getHandle().isDay();
|
2018-10-12 01:42:49 +00:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
2019-05-06 02:58:04 +00:00
|
|
|
@Override
|
2021-02-21 20:55:01 +00:00
|
|
|
public long getGameTime() {
|
|
|
|
return world.worldData.getTime();
|
2018-10-12 01:42:49 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
2021-03-16 07:19:45 +00:00
|
|
|
index 28a4e90130f51fd2fda7003fde5b4d0a410e1aef..06cbe63ef04e0de824ac0b9d545b6da1f53701b3 100644
|
2018-10-12 01:42:49 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
2020-02-21 17:52:20 +00:00
|
|
|
@@ -78,4 +78,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
2018-10-12 01:42:49 +00:00
|
|
|
public long getSeed() {
|
|
|
|
return getHandle().lootTableSeed;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
2019-05-06 02:58:04 +00:00
|
|
|
+ @Override
|
2018-10-12 01:42:49 +00:00
|
|
|
+ public boolean isInDaylight() {
|
|
|
|
+ return getHandle().isInDaylight();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|