2019-05-10 15:48:58 +00:00
|
|
|
From 6f55238bc936a3be2d872c5f7a0b8c71b9832acf 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-05-10 15:48:58 +00:00
|
|
|
index f1621a9e9..a8318c88a 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-05-05 08:33:44 +00:00
|
|
|
@@ -1330,6 +1330,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2018-10-12 01:42:49 +00:00
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
|
2019-05-05 08:33:44 +00: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 01:42:49 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2019-05-10 15:48:58 +00:00
|
|
|
index acd1b856e..8bbcbbf89 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-05-10 15:48:58 +00:00
|
|
|
@@ -669,6 +669,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
2018-10-12 01:42:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-05 08:33:44 +00:00
|
|
|
+ public boolean isDayTime() { return J(); } // Paper - OBFHELPER
|
|
|
|
public boolean J() {
|
|
|
|
return this.d < 4;
|
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
|
2019-05-10 15:48:58 +00:00
|
|
|
index 583fc6f75..b9786909b 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-05-06 03:53:47 +00:00
|
|
|
@@ -740,6 +740,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() {
|
|
|
|
+ return getHandle().isDayTime();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
2019-05-06 02:58:04 +00:00
|
|
|
@Override
|
2018-10-12 01:42:49 +00: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-05-10 15:48:58 +00:00
|
|
|
index 53c2d154e..56c233872 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
|
2019-05-06 02:58:04 +00:00
|
|
|
@@ -68,4 +68,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
|
|
|
|
}
|
|
|
|
--
|
2019-05-05 11:32:20 +00:00
|
|
|
2.21.0
|
2018-10-12 01:42:49 +00:00
|
|
|
|