PaperMC/Spigot-Server-Patches/0111-Load-chunk-before-player-teleport.patch
Aikar 9ff01b16ab Add MCUtils helper
This will be used by my next commit. But trying to get the build going
since CI blew up
2016-03-28 21:01:42 -04:00

27 lines
1 KiB
Diff

From 562e105bbb5bda677214a8be2b1e3be52457839c Mon Sep 17 00:00:00 2001
From: Gabscap <sonstige.netzwerke@gabriel-paradzik.de>
Date: Sat, 26 Mar 2016 18:41:22 +0100
Subject: [PATCH] Load chunk before player teleport
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index fe5084e..d77211a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -553,6 +553,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().closeInventory();
}
+ // Paper start - Load chunk before player teleport
+ org.bukkit.Chunk chunk = to.getChunk();
+ if (!chunk.isLoaded()) {
+ chunk.load();
+ }
+ // Paper end
+
// Check if the fromWorld and toWorld are the same.
if (fromWorld == toWorld) {
entity.playerConnection.teleport(to);
--
2.7.4