Only gets vehicle exit world when it's actually used
This commit is contained in:
parent
e253e95cec
commit
4851a0b5e2
@ -707,16 +707,16 @@ public class Portal {
|
|||||||
adjustRotation(exit, origin);
|
adjustRotation(exit, origin);
|
||||||
|
|
||||||
List<Entity> passengers = vehicle.getPassengers();
|
List<Entity> passengers = vehicle.getPassengers();
|
||||||
World vehicleWorld = exit.getWorld();
|
|
||||||
if (vehicleWorld == null) {
|
|
||||||
Stargate.log.warning(Stargate.getString("prefix") + "Unable to get the world to teleport the vehicle to");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
loadChunks();
|
loadChunks();
|
||||||
|
|
||||||
if (!passengers.isEmpty()) {
|
if (!passengers.isEmpty()) {
|
||||||
if (vehicle instanceof RideableMinecart || vehicle instanceof Boat) {
|
if (vehicle instanceof RideableMinecart || vehicle instanceof Boat) {
|
||||||
|
World vehicleWorld = exit.getWorld();
|
||||||
|
if (vehicleWorld == null) {
|
||||||
|
Stargate.log.warning(Stargate.getString("prefix") + "Unable to get the world to teleport the vehicle to");
|
||||||
|
return;
|
||||||
|
}
|
||||||
putPassengersInNewVehicle(vehicle, passengers, vehicleWorld, exit, newVelocity);
|
putPassengersInNewVehicle(vehicle, passengers, vehicleWorld, exit, newVelocity);
|
||||||
} else {
|
} else {
|
||||||
teleportLivingVehicle(vehicle, exit, passengers);
|
teleportLivingVehicle(vehicle, exit, passengers);
|
||||||
@ -914,11 +914,19 @@ public class Portal {
|
|||||||
Chunk forwardChunk = fiveBlocksForward.getChunk();
|
Chunk forwardChunk = fiveBlocksForward.getChunk();
|
||||||
|
|
||||||
//Load the chunks
|
//Load the chunks
|
||||||
if (!getWorld().isChunkLoaded(chunk)) {
|
loadOneChunk(chunk);
|
||||||
chunk.load();
|
loadOneChunk(forwardChunk);
|
||||||
}
|
}
|
||||||
if (!getWorld().isChunkLoaded(forwardChunk)) {
|
}
|
||||||
forwardChunk.load();
|
|
||||||
|
/**
|
||||||
|
* Loads one chunk
|
||||||
|
* @param chunk <p>The chunk to load</p>
|
||||||
|
*/
|
||||||
|
private void loadOneChunk(Chunk chunk) {
|
||||||
|
if (!getWorld().isChunkLoaded(chunk)) {
|
||||||
|
if (!chunk.load()) {
|
||||||
|
Stargate.debug("loadChunks", "Failed to load chunk " + chunk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user