Add StructuresLocateEvent as replacement for StructureLocateEvent (#7524)
This commit is contained in:
parent
753bf2c103
commit
15b6b3db2c
418 changed files with 1084 additions and 267 deletions
49
patches/api/0311-Add-more-line-of-sight-methods.patch
Normal file
49
patches/api/0311-Add-more-line-of-sight-methods.patch
Normal file
|
@ -0,0 +1,49 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: TwoLeggedCat <80929284+TwoLeggedCat@users.noreply.github.com>
|
||||
Date: Sat, 29 May 2021 14:33:18 -0500
|
||||
Subject: [PATCH] Add more line of sight methods
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index def9f0f9803e71cbe57abcffeb9114a5ab462e54..d149dd1d3d2703a428006e0c3ab5f9251e560882 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -76,6 +76,14 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*/
|
||||
@NotNull
|
||||
io.papermc.paper.world.MoonPhase getMoonPhase();
|
||||
+
|
||||
+ /**
|
||||
+ * Tell whether a line of sight exists between the given locations
|
||||
+ * @param from Location to start at
|
||||
+ * @param to target Location
|
||||
+ * @return whether a line of sight exists between {@code from} and {@code to}
|
||||
+ */
|
||||
+ public boolean lineOfSightExists(@NotNull Location from, @NotNull Location to);
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 330eab77547ae059f716418f71ad1d3391a57a9b..cda05df6784dd4d6a09710a416dcb71c016dabfc 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -483,6 +483,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
*/
|
||||
public boolean hasLineOfSight(@NotNull Entity other);
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Checks whether the living entity has block line of sight to the given block.
|
||||
+ * <p>
|
||||
+ * This uses the same algorithm that hostile mobs use to find the closest
|
||||
+ * player.
|
||||
+ *
|
||||
+ * @param location the location to determine line of sight to
|
||||
+ * @return true if there is a line of sight, false if not
|
||||
+ */
|
||||
+ public boolean hasLineOfSight(@NotNull Location location);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Returns if the living entity despawns when away from players or not.
|
||||
* <p>
|
Loading…
Add table
Add a link
Reference in a new issue