From 42ceb23b06ae943b7d805b09972ad86870e6f159 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 5ca281172..e259c868e 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -1334,6 +1334,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 ce1ac730c..323d78b22 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -852,6 +852,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 53c2d154e..56c233872 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -68,4 +68,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 } -- 2.25.0