2020-03-26 03:37:20 +01:00
|
|
|
From 3e5915a5ebe9224483503e023e4fb220b46a34b6 Mon Sep 17 00:00:00 2001
|
2018-10-12 03:42:49 +02:00
|
|
|
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
|
2020-03-26 03:37:20 +01:00
|
|
|
index b5816dc89e..bed15873b6 100644
|
2018-10-12 03:42:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2020-02-21 18:52:20 +01:00
|
|
|
@@ -1341,6 +1341,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2018-10-12 03:42:49 +02:00
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
|
2019-12-12 17:20:43 +01:00
|
|
|
+ public boolean isInDaylight() { return this.en(); } // Paper - OBFHELPER
|
|
|
|
protected boolean en() {
|
2019-12-17 23:39:07 +01:00
|
|
|
if (this.world.isDay() && !this.world.isClientSide) {
|
2019-12-12 17:20:43 +01:00
|
|
|
float f = this.aI();
|
2018-10-12 03:42:49 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2020-03-26 03:37:20 +01:00
|
|
|
index 6e1ae94cea..06b2e8b910 100644
|
2018-10-12 03:42:49 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2020-03-26 03:37:20 +01:00
|
|
|
@@ -856,6 +856,13 @@ public class CraftWorld implements World {
|
2018-10-12 03:42:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
2019-05-06 04:58:04 +02:00
|
|
|
+ @Override
|
2018-10-12 03:42:49 +02:00
|
|
|
+ public boolean isDayTime() {
|
2019-12-17 23:39:07 +01:00
|
|
|
+ return getHandle().isDay();
|
2018-10-12 03:42:49 +02:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
2019-05-06 04:58:04 +02:00
|
|
|
@Override
|
2018-10-12 03:42:49 +02:00
|
|
|
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
|
2020-03-26 03:37:20 +01:00
|
|
|
index c89bc7024b..eaad222fd3 100644
|
2018-10-12 03:42:49 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
2020-02-21 18:52:20 +01:00
|
|
|
@@ -78,4 +78,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
2018-10-12 03:42:49 +02:00
|
|
|
public long getSeed() {
|
|
|
|
return getHandle().lootTableSeed;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
2019-05-06 04:58:04 +02:00
|
|
|
+ @Override
|
2018-10-12 03:42:49 +02:00
|
|
|
+ public boolean isInDaylight() {
|
|
|
|
+ return getHandle().isInDaylight();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
--
|
2020-03-26 03:37:20 +01:00
|
|
|
2.26.0
|
2018-10-12 03:42:49 +02:00
|
|
|
|