2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2021-02-12 23:42:12 +00:00
|
|
|
index fbecc8ccab47b428c43530ad344e325538cf242d..800a8dd2543f0b83eec67e780510427467649d5d 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
|
2020-08-27 13:37:37 +00:00
|
|
|
@@ -1529,6 +1529,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2020-06-25 14:09:55 +00:00
|
|
|
|
2018-10-12 01:42:49 +00:00
|
|
|
}
|
|
|
|
|
2020-08-25 02:22:08 +00:00
|
|
|
+ public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER
|
|
|
|
protected boolean eG() {
|
2019-12-17 22:39:07 +00:00
|
|
|
if (this.world.isDay() && !this.world.isClientSide) {
|
2020-11-03 02:22:15 +00:00
|
|
|
float f = this.aR();
|
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
|
2021-02-21 19:45:33 +00:00
|
|
|
index ab05cc8e4188fcdfcd77ee6c1f217d0fa170c941..7e08032c968bb8405591082193b03badbe872436 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
|
2020-08-25 02:22:08 +00:00
|
|
|
@@ -858,6 +858,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() {
|
2019-12-17 22:39:07 +00:00
|
|
|
+ return getHandle().isDay();
|
2018-10-12 01:42:49 +00:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
2019-05-06 02:58:04 +00:00
|
|
|
@Override
|
2021-02-21 19:45:33 +00:00
|
|
|
public boolean createExplosion(double x, double y, double z, float power) {
|
|
|
|
return createExplosion(x, y, z, power, false, true);
|
2018-10-12 01:42:49 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
2020-05-06 09:48:49 +00:00
|
|
|
index c89bc7024b650c3b6d2c551f0e4e156975570cca..eaad222fd38a4db4074db04c931bcff7a9ca5e24 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
|
2020-02-21 17:52:20 +00:00
|
|
|
@@ -78,4 +78,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
|
|
|
|
}
|