Paper/CraftBukkit-Patches/0080-Force-Load-Chunks-for-Biome-Decoration.patch
2013-12-22 10:05:27 +11:00

38 lines
1.3 KiB
Diff

From 06442e81b39007aff69a813571ec4fbf60f1ac6d Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sat, 21 Dec 2013 20:08:26 +1100
Subject: [PATCH] Force Load Chunks for Biome Decoration
diff --git a/src/main/java/net/minecraft/server/BiomeDecorator.java b/src/main/java/net/minecraft/server/BiomeDecorator.java
index b048d6c..a8bbe06 100644
--- a/src/main/java/net/minecraft/server/BiomeDecorator.java
+++ b/src/main/java/net/minecraft/server/BiomeDecorator.java
@@ -147,10 +147,23 @@ public class BiomeDecorator {
for (j = 0; j < this.z; ++j) {
k = this.c + this.b.nextInt(16) + 8;
l = this.d + this.b.nextInt(16) + 8;
+ // Spigot Start
+ boolean chunkWasLoaded = this.a.isChunkLoaded( i >> 4, j >> 4 );
+ if ( !chunkWasLoaded )
+ {
+ this.a.getChunkAt( i, j );
+ }
+ // Spigot End
i1 = this.b.nextInt(this.a.getHighestBlockYAt(k, l) * 2);
WorldGenerator worldgenerator = biomebase.b(this.b);
worldgenerator.a(this.a, this.b, k, i1, l);
+ // Spigot Start
+ if ( !chunkWasLoaded )
+ {
+ this.a.getWorld().unloadChunk( i >> 4, j >> 4 );
+ }
+ // Spigot End
}
for (j = 0; j < this.A; ++j) {
--
1.8.3.2