testserver/patches/server/0275-Add-sun-related-API.patch

41 lines
1.5 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 034c2886b4e29be40fa2e5e213a7457d803c0f55..a6884bde5e6e717c5f37b0b96070b44f1253ce35 100644
2021-06-11 12:02:28 +00:00
--- 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 {
2021-06-11 12:02:28 +00:00
}
}
+ // 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 140672d03dd2563d2b1fb905d79164ff53cf0b76..e0022ea4bf228eef8384f20cfc717076c5ca5c99 100644
2021-06-11 12:02:28 +00:00
--- 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 {
2021-06-11 12:02:28 +00:00
public long getSeed() {
2021-06-13 06:48:25 +00:00
return this.getHandle().lootTableSeed;
2021-06-11 12:02:28 +00:00
}
+
+ // Paper start
+ @Override
+ public boolean isInDaylight() {
2021-06-13 06:48:25 +00:00
+ return getHandle().isSunBurnTick();
2021-06-11 12:02:28 +00:00
+ }
+ // Paper end
}