mirror of https://github.com/YatopiaMC/Yatopia.git
49 lines
1.9 KiB
Diff
49 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Ben Kerllenevich <me@notom3ga.me>
|
|
Date: Tue, 25 May 2021 16:30:30 -0400
|
|
Subject: [PATCH] API for any mob to burn daylight
|
|
|
|
Co-authored by: Encode42 <me@encode42.dev>
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
|
index 7fa5242bd44c9b19648d79fa8fecbb7ee125288e..62d8d7dbd4d602ca8cb00ff0cf1331583b398323 100644
|
|
--- a/src/main/java/org/bukkit/entity/Entity.java
|
|
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
|
@@ -770,5 +770,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
|
* @return Whether the entity was successfully spawned.
|
|
*/
|
|
boolean spawnAt(@NotNull Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason);
|
|
+
|
|
+ /**
|
|
+ * Checks if the entity is in daylight
|
|
+ *
|
|
+ * @return True if in daylight
|
|
+ */
|
|
+ boolean isInDaylight();
|
|
// Purpur end
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
index 42811d18ff304082f74f45794344891208599c04..ebe10b5612835d22dfcf8b30b0f028022e47216e 100644
|
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
@@ -872,5 +872,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
|
* @param slot Equipment slot to play break animation for
|
|
*/
|
|
void broadcastItemBreak(@NotNull org.bukkit.inventory.EquipmentSlot slot);
|
|
+
|
|
+ /**
|
|
+ * If this mob will burn in the sunlight
|
|
+ *
|
|
+ * @return True if mob will burn in sunlight
|
|
+ */
|
|
+ boolean shouldBurnInDay();
|
|
+
|
|
+ /**
|
|
+ * Set if this mob should burn in the sunlight
|
|
+ *
|
|
+ * @param shouldBurnInDay True to burn in sunlight
|
|
+ */
|
|
+ void setShouldBurnInDay(boolean shouldBurnInDay);
|
|
// Purpur end
|
|
}
|