2019-01-17 02:02:56 +00:00
|
|
|
From bd1e23a74e539c1a5ea3e37efe5a85a2aefe206b 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
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2019-01-17 02:02:56 +00:00
|
|
|
index ee5078370c..3059682a49 100644
|
2018-10-12 01:42:49 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2019-01-01 03:15:55 +00:00
|
|
|
@@ -1287,6 +1287,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2018-10-12 01:42:49 +00:00
|
|
|
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
|
2019-01-17 02:02:56 +00:00
|
|
|
index 55cd98ae20..a186637f5e 100644
|
2018-10-12 01:42:49 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2019-01-01 03:15:55 +00:00
|
|
|
@@ -822,6 +822,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
2018-10-12 01:42:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ 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
|
2019-01-17 02:02:56 +00:00
|
|
|
index b5a87cfaf6..e33135adaa 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
|
2019-01-01 03:15:55 +00:00
|
|
|
@@ -538,6 +538,12 @@ public class CraftWorld implements World {
|
2018-10-12 01:42:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // 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
|
2019-01-17 02:02:56 +00:00
|
|
|
index 53c2d154ed..40a429942e 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
|
|
|
|
@@ -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
|
|
|
|
}
|
|
|
|
--
|
2018-12-23 17:04:13 +00:00
|
|
|
2.20.1
|
2018-10-12 01:42:49 +00:00
|
|
|
|