2018-11-09 04:43:38 +01:00
|
|
|
From d95fe94f2eaa0f9bb2be771c4005d63dcd2b9406 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
|
2018-11-09 04:43:38 +01:00
|
|
|
index db9201d292..6c9776f57e 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
|
2018-11-09 04:43:38 +01:00
|
|
|
@@ -1297,6 +1297,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2018-10-12 03:42:49 +02: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
|
2018-11-03 10:31:30 +01:00
|
|
|
index 23529954b4..7914f9b606 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
|
2018-10-12 03:46:35 +02:00
|
|
|
@@ -829,6 +829,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
2018-10-12 03:42:49 +02: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
|
2018-11-03 10:31:30 +01:00
|
|
|
index ef5a7bc38a..10fa122536 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
|
2018-11-03 10:31:30 +01:00
|
|
|
@@ -523,6 +523,12 @@ public class CraftWorld implements World {
|
2018-10-12 03:42:49 +02: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
|
2018-11-03 10:31:30 +01:00
|
|
|
index 53c2d154ed..40a429942e 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
|
|
|
|
@@ -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-10-12 03:46:35 +02:00
|
|
|
2.19.1
|
2018-10-12 03:42:49 +02:00
|
|
|
|