2019-12-13 21:41:01 +01:00
|
|
|
From ad6bd5036e5ee80145156399673df57eb80ce635 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-12-12 17:20:43 +01:00
|
|
|
index eadac07f6..cbaed08f5 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-12-12 17:20:43 +01:00
|
|
|
@@ -1334,6 +1334,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2018-10-12 03:42:49 +02:00
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
|
2019-12-12 17:20:43 +01:00
|
|
|
+ public boolean isInDaylight() { return this.en(); } // Paper - OBFHELPER
|
|
|
|
protected boolean en() {
|
2019-05-05 10:33:44 +02:00
|
|
|
if (this.world.J() && !this.world.isClientSide) {
|
2019-12-12 17:20:43 +01:00
|
|
|
float f = this.aI();
|
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-12-13 02:18:18 +01:00
|
|
|
index 7a9159252..3e4632425 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-12-13 02:18:18 +01:00
|
|
|
@@ -631,6 +631,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
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() {
|
2019-12-12 17:20:43 +01:00
|
|
|
return this.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD && this.c < 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-12-13 21:41:01 +01:00
|
|
|
index 8a0675037..aec657952 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-12-12 17:20:43 +01:00
|
|
|
@@ -855,6 +855,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-12-12 17:20:43 +01: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-12-13 21:41:01 +01:00
|
|
|
2.24.1
|
2018-10-12 03:42:49 +02:00
|
|
|
|