API patches
This commit is contained in:
parent
56e64243ed
commit
028e2d9f00
381 changed files with 263 additions and 311 deletions
33
patches/api/0203-Potential-bed-API.patch
Normal file
33
patches/api/0203-Potential-bed-API.patch
Normal file
|
@ -0,0 +1,33 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Sun, 10 May 2020 23:06:41 -0400
|
||||
Subject: [PATCH] Potential bed API
|
||||
|
||||
Adds a new method to fetch the location of a player's bed without generating any sync loads.
|
||||
|
||||
getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
index b007b582d344b79ee67751fd1e21f6cef6a1a950..43ab3d1f96179a547630be3494d85642ab2ff029 100644
|
||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
@@ -248,6 +248,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
*/
|
||||
public int getSleepTicks();
|
||||
|
||||
+
|
||||
+ // Paper start - Potential bed api
|
||||
+ /**
|
||||
+ * Gets the Location of the player's bed, null if they have not slept
|
||||
+ * in one. This method will not attempt to validate if the current bed
|
||||
+ * is still valid.
|
||||
+ *
|
||||
+ * @return Bed Location if has slept in one, otherwise null.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getPotentialBedLocation();
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Attempts to make the entity sleep at the given location.
|
||||
* <br>
|
Loading…
Add table
Add a link
Reference in a new issue