|
61 | 61 |
|
62 | 62 | if (chunk != null) |
63 | 63 | { |
64 | | -@@ -79,33 +85,66 @@ |
| 64 | +@@ -79,33 +85,76 @@ |
65 | 65 | return chunk; |
66 | 66 | } |
67 | 67 |
|
|
124 | 124 | } |
125 | 125 |
|
126 | 126 | - @Override |
| 127 | ++ // FAWE fix start |
| 128 | ++ public Chunk getChunkAt(int i, int j, Runnable runnable) { |
| 129 | ++ return provideChunk(i, j, runnable); |
| 130 | ++ } |
| 131 | ++ |
| 132 | ++ public Chunk getChunkAt(int x, int z, Runnable runnable, boolean generate) { |
| 133 | ++ return provideChunk(x, z, runnable, generate); |
| 134 | ++ } |
| 135 | ++ // FAWE fix end |
| 136 | ++ |
127 | 137 | public Chunk func_186025_d(int p_186025_1_, int p_186025_2_) |
128 | 138 | { |
129 | 139 | Chunk chunk = this.func_186028_c(p_186025_1_, p_186025_2_); |
|
134 | 144 | long i = ChunkPos.func_77272_a(p_186025_1_, p_186025_2_); |
135 | 145 |
|
136 | 146 | try |
137 | | -@@ -117,14 +156,15 @@ |
| 147 | +@@ -117,18 +166,52 @@ |
138 | 148 | CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception generating new chunk"); |
139 | 149 | CrashReportCategory crashreportcategory = crashreport.func_85058_a("Chunk to be generated"); |
140 | 150 | crashreportcategory.func_71507_a("Location", String.format("%d,%d", p_186025_1_, p_186025_2_)); |
141 | 151 | - crashreportcategory.func_71507_a("Position hash", i); |
142 | | -+ crashreportcategory.func_71507_a("Position hash", Long.valueOf(i)); |
143 | | - crashreportcategory.func_71507_a("Generator", this.field_186029_c); |
144 | | - throw new ReportedException(crashreport); |
145 | | - } |
146 | | - |
147 | | - this.field_73244_f.put(i, chunk); |
148 | | - chunk.func_76631_c(); |
| 152 | +- crashreportcategory.func_71507_a("Generator", this.field_186029_c); |
| 153 | +- throw new ReportedException(crashreport); |
| 154 | +- } |
| 155 | +- |
| 156 | +- this.field_73244_f.put(i, chunk); |
| 157 | +- chunk.func_76631_c(); |
149 | 158 | - chunk.func_186030_a(this, this.field_186029_c); |
| 159 | +- } |
| 160 | +- |
| 161 | +- return chunk; |
| 162 | +- } |
| 163 | ++ crashreportcategory.func_71507_a("Position hash", Long.valueOf(i)); |
| 164 | ++ crashreportcategory.func_71507_a("Generator", this.field_186029_c); |
| 165 | ++ throw new ReportedException(crashreport); |
| 166 | ++ } |
| 167 | ++ |
| 168 | ++ this.field_73244_f.put(i, chunk); |
| 169 | ++ chunk.func_76631_c(); |
150 | 170 | + chunk.populateCB(this, this.field_186029_c, true); |
151 | 171 | + field_73251_h.timings.syncChunkLoadTimer.stopTiming(); // Spigot |
152 | | - } |
| 172 | ++ } |
| 173 | ++ |
| 174 | ++ return chunk; |
| 175 | ++ } |
| 176 | ++ |
| 177 | ++ // CatServer start |
| 178 | ++ public Chunk provideChunk(int x, int z, Runnable runnable) { |
| 179 | ++ return provideChunk(x, z, runnable, true); |
| 180 | ++ } |
| 181 | ++ |
| 182 | ++ public Chunk provideChunk(int x, int z, Runnable runnable, boolean generate) { |
| 183 | ++ Chunk chunk = this.loadChunk(x, z, runnable); |
| 184 | ++ |
| 185 | ++ if (chunk == null && generate) { |
| 186 | ++ field_73251_h.timings.syncChunkLoadTimer.startTiming(); // Spigot |
| 187 | ++ long i = ChunkPos.func_77272_a(x, z); |
| 188 | ++ |
| 189 | ++ try { |
| 190 | ++ chunk = this.field_186029_c.func_185932_a(x, z); |
| 191 | ++ } catch (Throwable throwable) { |
| 192 | ++ CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception generating new chunk"); |
| 193 | ++ CrashReportCategory crashreportcategory = crashreport.func_85058_a("Chunk to be generated"); |
| 194 | ++ crashreportcategory.func_71507_a("Location", String.format("%d,%d", x, z)); |
| 195 | ++ crashreportcategory.func_71507_a("Position hash", Long.valueOf(i)); |
| 196 | ++ crashreportcategory.func_71507_a("Generator", this.field_186029_c); |
| 197 | ++ throw new ReportedException(crashreport); |
| 198 | ++ } |
| 199 | ++ |
| 200 | ++ this.field_73244_f.put(i, chunk); |
| 201 | ++ chunk.func_76631_c(); |
| 202 | ++ chunk.populateCB(this, this.field_186029_c, true); |
| 203 | ++ field_73251_h.timings.syncChunkLoadTimer.stopTiming(); // Spigot |
| 204 | ++ } |
| 205 | ++ |
| 206 | ++ return chunk; |
| 207 | ++ } |
| 208 | ++ // CatServer end |
153 | 209 |
|
154 | | - return chunk; |
155 | | -@@ -199,8 +239,9 @@ |
| 210 | + @Nullable |
| 211 | + private Chunk func_73239_e(int p_73239_1_, int p_73239_2_) |
| 212 | +@@ -199,8 +282,9 @@ |
156 | 213 | { |
157 | 214 | this.func_73242_b(chunk); |
158 | 215 | chunk.func_177427_f(false); |
|
163 | 220 | { |
164 | 221 | return false; |
165 | 222 | } |
166 | | -@@ -215,30 +256,51 @@ |
| 223 | +@@ -215,30 +299,51 @@ |
167 | 224 | this.field_73247_e.func_75818_b(); |
168 | 225 | } |
169 | 226 |
|
|
223 | 280 |
|
224 | 281 | this.field_73247_e.func_75817_a(); |
225 | 282 | } |
226 | | -@@ -246,12 +308,44 @@ |
| 283 | +@@ -246,12 +351,44 @@ |
227 | 284 | return false; |
228 | 285 | } |
229 | 286 |
|
|
269 | 326 | public String func_73148_d() |
270 | 327 | { |
271 | 328 | return "ServerChunkCache: " + this.field_73244_f.size() + " Drop: " + this.field_73248_b.size(); |
272 | | -@@ -283,7 +377,6 @@ |
| 329 | +@@ -283,7 +420,6 @@ |
273 | 330 | return this.field_73244_f.containsKey(ChunkPos.func_77272_a(p_73149_1_, p_73149_2_)); |
274 | 331 | } |
275 | 332 |
|
|
0 commit comments