From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: BillyGalbreath 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 index b5816dc89ede5f5f1780d3086d9b1a41fba2b19d..bed15873b675bbd05c0149d655f9fb165bbbc73e 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -1341,6 +1341,7 @@ public abstract class EntityInsentient extends EntityLiving { return flag; } + public boolean isInDaylight() { return this.en(); } // Paper - OBFHELPER protected boolean en() { if (this.world.isDay() && !this.world.isClientSide) { float f = this.aI(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 68b1382838f187f9bfbd83a3f582631af6218e29..db31b17b87084c47402f5452872f385629c58382 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -860,6 +860,13 @@ public class CraftWorld implements World { } } + // Paper start + @Override + public boolean isDayTime() { + return getHandle().isDay(); + } + // Paper end + @Override 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 index c89bc7024b650c3b6d2c551f0e4e156975570cca..eaad222fd38a4db4074db04c931bcff7a9ca5e24 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -78,4 +78,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { public long getSeed() { return getHandle().lootTableSeed; } + + // Paper start + @Override + public boolean isInDaylight() { + return getHandle().isInDaylight(); + } + // Paper end }