2019-07-17 00:09:32 +02:00
|
|
|
From 928455bc5846a2193c454e3528201567dd359d14 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-07-11 18:59:21 +02:00
|
|
|
index c20374d77..5e88367d3 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-06-25 03:47:58 +02:00
|
|
|
@@ -1327,6 +1327,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2018-10-12 03:42:49 +02:00
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
|
2019-06-25 03:47:58 +02:00
|
|
|
+ public boolean isInDaylight() { return dT(); } // Paper - OBFHELPER
|
|
|
|
protected boolean dT() {
|
2019-05-05 10:33:44 +02:00
|
|
|
if (this.world.J() && !this.world.isClientSide) {
|
2019-06-25 03:47:58 +02:00
|
|
|
float f = this.aF();
|
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-07-11 18:59:21 +02:00
|
|
|
index f0332c893..1f28358f9 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-07-11 18:59:21 +02:00
|
|
|
index 2ef965a7d..79aac04ff 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-07-11 18:59:21 +02:00
|
|
|
@@ -824,6 +824,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-07-11 18:59:21 +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
|
|
|
|