Paper/patches/server/0265-Add-sun-related-API.patch

43 lines
1.6 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02: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
== AT ==
public net.minecraft.world.entity.Mob isSunBurnTick()Z
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2023-12-05 23:21:44 +01:00
index e886f72df8b5b334299236c26115bbc5f72ce9f1..c14f73d745ec34f0970b2e5aac9d68fc069fc1d2 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2023-12-05 23:21:44 +01:00
@@ -696,6 +696,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
2021-06-11 14:02:28 +02:00
}
}
+ // Paper start
+ @Override
+ public boolean isDayTime() {
+ return getHandle().isDay();
+ }
+ // Paper end
+
@Override
public long getGameTime() {
2023-10-27 01:34:58 +02:00
return this.world.levelData.getGameTime();
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
2023-10-27 01:34:58 +02:00
index c2acbf533b5f3aebe4837512f694fe25abee65d6..74843d1fa344497d35f05d0b04f650edd1e0f3a1 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
@@ -93,4 +93,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
2021-06-11 14:02:28 +02:00
public long getSeed() {
2021-06-13 08:48:25 +02:00
return this.getHandle().lootTableSeed;
2021-06-11 14:02:28 +02:00
}
+
+ // Paper start
+ @Override
+ public boolean isInDaylight() {
2021-06-13 08:48:25 +02:00
+ return getHandle().isSunBurnTick();
2021-06-11 14:02:28 +02:00
+ }
+ // Paper end
}