2019-05-30 23:22:34 +00:00
|
|
|
From 1289a5cb120dc44faac5278e9f2b44a74b5827b7 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-30 23:22:34 +00:00
|
|
|
index c2771c5d9..c81e53090 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-19 03:16:22 +00:00
|
|
|
@@ -1326,6 +1326,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-30 23:22:34 +00:00
|
|
|
index dbb4eb0a8..d13e4cf73 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-27 06:14:14 +00:00
|
|
|
@@ -667,6 +667,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-27 09:13:41 +00:00
|
|
|
index 1b2c5012e..3ebea9693 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-26 01:56:30 +00:00
|
|
|
@@ -739,6 +739,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-27 09:13:41 +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
|
|
|
|