mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
Force Load Chunks for Biome Decoration. May solve some random.nextInt() crashes people have been seeing.
This commit is contained in:
parent
b42275d94c
commit
2549f4c043
1 changed files with 37 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
||||||
|
From f67e97185382ed3e7cbfea25039c58dffb61486c 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
|
||||||
|
|
Loading…
Reference in a new issue