fix offline teleport method StackOverflow (#856)

This commit is contained in:
YouHaveTrouble
2022-01-22 18:04:41 +01:00
committed by GitHub
parent 762fcddb3e
commit c672eeacd7

View File

@@ -223,7 +223,7 @@ index 88bc0807e8bf66a65422f85f1112336334eb3de2..d0e822b329085b9d0a42276c3cacd6cb
+ // Purpur end - OfflinePlayer API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 944d0e118e0bed160fc6e40a147c043aade1599f..f4ed262e51a0cc64df56dfc23ba816c23c5ce11e 100644
index 944d0e118e0bed160fc6e40a147c043aade1599f..9a90d084a05ad4865f3cd2d3b9cf1d7e3e0466d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1967,6 +1967,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -233,22 +233,22 @@ index 944d0e118e0bed160fc6e40a147c043aade1599f..f4ed262e51a0cc64df56dfc23ba816c2
+ // Purpur start - OfflinePlayer API
+ @Override
+ public boolean teleportOffline(@NotNull Location destination) {
+ return ((OfflinePlayer)this).teleportOffline(destination);
+ return this.teleport(destination);
+ }
+
+ @Override
+ public boolean teleportOffline(Location destination, PlayerTeleportEvent.TeleportCause cause) {
+ return ((OfflinePlayer)this).teleportOffline(destination, cause);
+ return this.teleport(destination, cause);
+ }
+
+ @Override
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(@NotNull Location destination) {
+ return ((OfflinePlayer)this).teleportOfflineAsync(destination);
+ return this.teleportAsync(destination);
+ }
+
+ @Override
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(@NotNull Location destination, PlayerTeleportEvent.TeleportCause cause) {
+ return ((OfflinePlayer)this).teleportOfflineAsync(destination, cause);
+ return this.teleportAsync(destination, cause);
+ }
+ // Purpur end - OfflinePlayer API
+