2019-06-22 20:06:08 +02:00
|
|
|
From de658a99cc0c2fd95317f1a9c12f394aa3dec85f 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
|
2019-06-22 20:06:08 +02:00
|
|
|
index c2771c5d9..c81e53090 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
|
2019-05-19 05:16:22 +02:00
|
|
|
@@ -1326,6 +1326,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2018-10-12 03:42:49 +02:00
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
|
2019-05-05 10:33:44 +02:00
|
|
|
+ public boolean isInDaylight() { return dS(); } // Paper - OBFHELPER
|
|
|
|
protected boolean dS() {
|
|
|
|
if (this.world.J() && !this.world.isClientSide) {
|
|
|
|
float f = this.aE();
|
2018-10-12 03:42:49 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2019-06-22 20:06:08 +02:00
|
|
|
index 05c7a49a4..83e7a65a2 100644
|
2018-10-12 03:42:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2019-06-22 20:06:08 +02:00
|
|
|
@@ -705,6 +705,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
2018-10-12 03:42:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-05 10:33:44 +02:00
|
|
|
+ public boolean isDayTime() { return J(); } // Paper - OBFHELPER
|
|
|
|
public boolean J() {
|
|
|
|
return this.d < 4;
|
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
|
2019-06-22 20:06:08 +02:00
|
|
|
index 4b3ea756e..93ddf7eed 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
|
2019-05-26 03:56:30 +02:00
|
|
|
@@ -739,6 +739,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() {
|
|
|
|
+ return getHandle().isDayTime();
|
|
|
|
+ }
|
|
|
|
+ // 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
|
2019-06-22 20:06:08 +02:00
|
|
|
index 53c2d154e..56c233872 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
|
2019-05-06 04:58:04 +02:00
|
|
|
@@ -68,4 +68,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
|
|
|
|
}
|
|
|
|
--
|
2019-06-22 20:06:08 +02:00
|
|
|
2.22.0
|
2018-10-12 03:42:49 +02:00
|
|
|
|