From 6f709200ddb4c14de1efaa7a3d66a84e83c2fdbf Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sun, 28 Jul 2019 00:38:49 +0100
Subject: [PATCH] use getChunkImmediately for vehicles

---
 ...option-to-prevent-players-from-moving-into-unloa.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Spigot-Server-Patches/0328-Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/0328-Add-option-to-prevent-players-from-moving-into-unloa.patch
index 0dba9eda82..5ce63d40ae 100644
--- a/Spigot-Server-Patches/0328-Add-option-to-prevent-players-from-moving-into-unloa.patch
+++ b/Spigot-Server-Patches/0328-Add-option-to-prevent-players-from-moving-into-unloa.patch
@@ -1,4 +1,4 @@
-From 2bc98858fe530d335079b28b0a47627b5aa6d22a Mon Sep 17 00:00:00 2001
+From e48549fad9ec1b3e24e92b4ffc9f434552828f90 Mon Sep 17 00:00:00 2001
 From: Gabriele C <sgdc3.mail@gmail.com>
 Date: Mon, 22 Oct 2018 17:34:10 +0200
 Subject: [PATCH] Add option to prevent players from moving into unloaded
@@ -6,7 +6,7 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded
 
 
 diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index 63f313a92d..2299860b81 100644
+index 63f313a92..2299860b8 100644
 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
 +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
 @@ -429,4 +429,9 @@ public class PaperWorldConfig {
@@ -20,7 +20,7 @@ index 63f313a92d..2299860b81 100644
 +    }
  }
 diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
-index a814d8cae9..9eb6982508 100644
+index a814d8cae..b0fd4d800 100644
 --- a/src/main/java/net/minecraft/server/PlayerConnection.java
 +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
 @@ -348,6 +348,13 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -28,7 +28,7 @@ index a814d8cae9..9eb6982508 100644
                  speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
  
 +                // Paper start - Prevent moving into unloaded chunks
-+                if (player.world.paperConfig.preventMovingIntoUnloadedChunks && !worldserver.isChunkLoaded((int) Math.floor(packetplayinvehiclemove.getX()) >> 4, (int) Math.floor(packetplayinvehiclemove.getZ()) >> 4)) {
++                if (player.world.paperConfig.preventMovingIntoUnloadedChunks && worldserver.getChunkIfLoadedImmediately((int) Math.floor(packetplayinvehiclemove.getX()) >> 4, (int) Math.floor(packetplayinvehiclemove.getZ()) >> 4) == null) {
 +                    this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
 +                    return;
 +                }