Commits

Thinkofname authored d8a9c7be422
Update to Minecraft 1.8.3
No tags

nms-patches/BiomeDecorator.patch

Deleted
1 ---- ../work/decompile-8eb82bde/net/minecraft/server/BiomeDecorator.java 2014-12-12 19:26:13.625913570 +0000
2 -+++ src/main/java/net/minecraft/server/BiomeDecorator.java 2014-12-12 19:15:22.000000000 +0000
3 -@@ -132,7 +132,7 @@
4 - WorldGenTreeAbstract worldgentreeabstract = biomebase.a(this.b);
5 -
6 - worldgentreeabstract.e();
7 -- blockposition = this.a.getHighestBlockYAt(this.c.a(k, 0, l));
8 -+ blockposition = this.getHighestBlockYAt(this.c.a(k, 0, l)); // CraftBukkit - Prevent crash
9 - if (worldgentreeabstract.generate(this.a, this.b, blockposition)) {
10 - worldgentreeabstract.a(this.a, this.b, blockposition);
11 - }
12 -@@ -141,7 +141,7 @@
13 - for (j = 0; j < this.K; ++j) {
14 - k = this.b.nextInt(16) + 8;
15 - l = this.b.nextInt(16) + 8;
16 -- this.v.generate(this.a, this.b, this.a.getHighestBlockYAt(this.c.a(k, 0, l)));
17 -+ this.v.generate(this.a, this.b, this.getHighestBlockYAt(this.c.a(k, 0, l ))); // CraftBukkit - Prevent crash
18 - }
19 -
20 - int i1;
21 -@@ -149,7 +149,7 @@
22 - for (j = 0; j < this.B; ++j) {
23 - k = this.b.nextInt(16) + 8;
24 - l = this.b.nextInt(16) + 8;
25 -- i1 = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(k, 0, l)).getY() + 32);
26 -+ i1 = this.b.nextInt(this.getHighestBlockYAt(this.c.a(k, 0, l)).getY() + 32); // CraftBukkit - Prevent crash
27 - blockposition = this.c.a(k, i1, l);
28 - EnumFlowerVarient enumflowervarient = biomebase.a(this.b, blockposition);
29 - BlockFlowers blockflowers = enumflowervarient.a().a();
30 -@@ -163,14 +163,14 @@
31 - for (j = 0; j < this.C; ++j) {
32 - k = this.b.nextInt(16) + 8;
33 - l = this.b.nextInt(16) + 8;
34 -- i1 = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2);
35 -+ i1 = this.b.nextInt(this.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2); // CraftBukkit - Prevent crash
36 - biomebase.b(this.b).generate(this.a, this.b, this.c.a(k, i1, l));
37 - }
38 -
39 - for (j = 0; j < this.D; ++j) {
40 - k = this.b.nextInt(16) + 8;
41 - l = this.b.nextInt(16) + 8;
42 -- i1 = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2);
43 -+ i1 = this.b.nextInt(this.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2); // CraftBukkit - Prevent crash
44 - (new WorldGenDeadBush()).generate(this.a, this.b, this.c.a(k, i1, l));
45 - }
46 -
47 -@@ -179,7 +179,7 @@
48 - while (j < this.z) {
49 - k = this.b.nextInt(16) + 8;
50 - l = this.b.nextInt(16) + 8;
51 -- i1 = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2);
52 -+ i1 = this.b.nextInt(this.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2); // CraftBukkit - Prevent crash
53 - blockposition = this.c.a(k, i1, l);
54 -
55 - while (true) {
56 -@@ -202,7 +202,7 @@
57 - if (this.b.nextInt(4) == 0) {
58 - k = this.b.nextInt(16) + 8;
59 - l = this.b.nextInt(16) + 8;
60 -- BlockPosition blockposition2 = this.a.getHighestBlockYAt(this.c.a(k, 0, l));
61 -+ BlockPosition blockposition2 = this.getHighestBlockYAt(this.c.a(k, 0, l)); // CraftBukkit - Prevent crash
62 -
63 - this.t.generate(this.a, this.b, blockposition2);
64 - }
65 -@@ -210,7 +210,7 @@
66 - if (this.b.nextInt(8) == 0) {
67 - k = this.b.nextInt(16) + 8;
68 - l = this.b.nextInt(16) + 8;
69 -- i1 = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2);
70 -+ i1 = this.b.nextInt(this.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2); // CraftBukkit - Prevent crash
71 - blockposition = this.c.a(k, i1, l);
72 - this.u.generate(this.a, this.b, blockposition);
73 - }
74 -@@ -219,42 +219,42 @@
75 - if (this.b.nextInt(4) == 0) {
76 - j = this.b.nextInt(16) + 8;
77 - k = this.b.nextInt(16) + 8;
78 -- l = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(j, 0, k)).getY() * 2);
79 -+ l = this.b.nextInt(this.getHighestBlockYAt(this.c.a(j, 0, k)).getY() * 2); // CraftBukkit - Prevent crash
80 - this.t.generate(this.a, this.b, this.c.a(j, l, k));
81 - }
82 -
83 - if (this.b.nextInt(8) == 0) {
84 - j = this.b.nextInt(16) + 8;
85 - k = this.b.nextInt(16) + 8;
86 -- l = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(j, 0, k)).getY() * 2);
87 -+ l = this.b.nextInt(this.getHighestBlockYAt(this.c.a(j, 0, k)).getY() * 2); // CraftBukkit - Prevent crash
88 - this.u.generate(this.a, this.b, this.c.a(j, l, k));
89 - }
90 -
91 - for (j = 0; j < this.F; ++j) {
92 - k = this.b.nextInt(16) + 8;
93 - l = this.b.nextInt(16) + 8;
94 -- i1 = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2);
95 -+ i1 = this.b.nextInt(this.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2); // CraftBukkit - Prevent crash
96 - this.w.generate(this.a, this.b, this.c.a(k, i1, l));
97 - }
98 -
99 - for (j = 0; j < 10; ++j) {
100 - k = this.b.nextInt(16) + 8;
101 - l = this.b.nextInt(16) + 8;
102 -- i1 = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2);
103 -+ i1 = this.b.nextInt(this.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2); // CraftBukkit - Prevent crash
104 - this.w.generate(this.a, this.b, this.c.a(k, i1, l));
105 - }
106 -
107 - if (this.b.nextInt(32) == 0) {
108 - j = this.b.nextInt(16) + 8;
109 - k = this.b.nextInt(16) + 8;
110 -- l = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(j, 0, k)).getY() * 2);
111 -+ l = this.b.nextInt(this.getHighestBlockYAt(this.c.a(j, 0, k)).getY() * 2); // CraftBukkit - Prevent crash
112 - (new WorldGenPumpkin()).generate(this.a, this.b, this.c.a(j, l, k));
113 - }
114 -
115 - for (j = 0; j < this.G; ++j) {
116 - k = this.b.nextInt(16) + 8;
117 - l = this.b.nextInt(16) + 8;
118 -- i1 = this.b.nextInt(this.a.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2);
119 -+ i1 = this.b.nextInt(this.getHighestBlockYAt(this.c.a(k, 0, l)).getY() * 2); // CraftBukkit - Prevent crash
120 - this.x.generate(this.a, this.b, this.c.a(k, i1, l));
121 - }
122 -
123 -@@ -274,6 +274,16 @@
124 -
125 - }
126 -
127 -+ // CraftBukkit start - The heightMap can be wrong calculated and return Y = 0 which will crash the Server
128 -+ private BlockPosition getHighestBlockYAt( BlockPosition blockPosition ) {
129 -+ BlockPosition returnBlockPosition = this.a.getHighestBlockYAt( blockPosition );
130 -+ if ( returnBlockPosition.getY() == 0 ) {
131 -+ returnBlockPosition = returnBlockPosition.up( 1 );
132 -+ }
133 -+ return returnBlockPosition;
134 -+ }
135 -+ // CraftBukkit end
136 -+
137 - protected void a(int i, WorldGenerator worldgenerator, int j, int k) {
138 - int l;
139 -

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut