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/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 7f4024dbc1a0c50af9344689561de54eb35e1c98..8615d4abbf18ab105ca7edffa10e8122ef76add3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -664,6 +664,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { } } + // Paper start + @Override + public boolean isDayTime() { + return getHandle().isDay(); + } + // Paper end + @Override public long getGameTime() { return world.levelData.getGameTime(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java index b0d348061487110993b6c4c8a7dc7208f27361b3..d7bc601f2cb4e22565eeebb2d8ebe051748de92a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -80,4 +80,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { public long getSeed() { return this.getHandle().lootTableSeed; } + + // Paper start + @Override + public boolean isInDaylight() { + return getHandle().isSunBurnTick(); + } + // Paper end }