Commits

md_5 authored e0001040ae8
Rebuild patches
No tags

CraftBukkit-Patches/0003-mc-dev-imports.patch

Modified
1 -From 9869907b2114041132556d184db61e0a61ccbd6f Mon Sep 17 00:00:00 2001
1 +From 1add68c38babb8285f1830a777f9f247f2aade1b Mon Sep 17 00:00:00 2001
2 2 From: md_5 <md_5@live.com.au>
3 3 Date: Sun, 1 Dec 2013 15:10:48 +1100
4 4 Subject: [PATCH] mc-dev imports
5 5
6 6 Imported files which are only modified by Spigot, not upstream. Files here should be completely unmodified aside from trivial changes such as adding throws statements to ensure proper compilation. You may need to add unrelated files in order to ensure a compilable result in the face of synthetic methods.
7 7
8 8 diff --git a/src/main/java/net/minecraft/server/AttributeRanged.java b/src/main/java/net/minecraft/server/AttributeRanged.java
9 9 new file mode 100644
10 10 index 0000000..13602f0
11 11 --- /dev/null
2260 2260 + }
2261 2261 + }
2262 2262 +
2263 2263 + entityplayer.playerConnection.sendPacket(new PacketPlayOutStatistic(hashmap));
2264 2264 + }
2265 2265 +
2266 2266 + public boolean e() {
2267 2267 + return this.g;
2268 2268 + }
2269 2269 +}
2270 -diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
2271 -new file mode 100644
2272 -index 0000000..dacba33
2273 ---- /dev/null
2274 -+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
2275 -@@ -0,0 +1,239 @@
2276 -+package net.minecraft.server;
2277 -+
2278 -+import com.google.common.collect.Maps;
2279 -+import java.util.Iterator;
2280 -+import java.util.List;
2281 -+import java.util.Map;
2282 -+import java.util.Random;
2283 -+import java.util.concurrent.Callable;
2284 -+
2285 -+public abstract class StructureGenerator extends WorldGenBase {
2286 -+
2287 -+ private PersistentStructure a;
2288 -+ protected Map<Long, StructureStart> c = Maps.newHashMap();
2289 -+
2290 -+ public StructureGenerator() {}
2291 -+
2292 -+ public abstract String a();
2293 -+
2294 -+ protected final synchronized void a(World world, final int i, final int j, int k, int l, ChunkSnapshot chunksnapshot) {
2295 -+ this.a(world);
2296 -+ if (!this.c.containsKey(Long.valueOf(ChunkCoordIntPair.a(i, j)))) {
2297 -+ this.f.nextInt();
2298 -+
2299 -+ try {
2300 -+ if (this.a(i, j)) {
2301 -+ StructureStart structurestart = this.b(i, j);
2302 -+
2303 -+ this.c.put(Long.valueOf(ChunkCoordIntPair.a(i, j)), structurestart);
2304 -+ if (structurestart.a()) {
2305 -+ this.a(i, j, structurestart);
2306 -+ }
2307 -+ }
2308 -+
2309 -+ } catch (Throwable throwable) {
2310 -+ CrashReport crashreport = CrashReport.a(throwable, "Exception preparing structure feature");
2311 -+ CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Feature being prepared");
2312 -+
2313 -+ crashreportsystemdetails.a("Is feature chunk", new Callable() {
2314 -+ public String a() throws Exception {
2315 -+ return StructureGenerator.this.a(i, j) ? "True" : "False";
2316 -+ }
2317 -+
2318 -+ public Object call() throws Exception {
2319 -+ return this.a();
2320 -+ }
2321 -+ });
2322 -+ crashreportsystemdetails.a("Chunk location", (Object) String.format("%d,%d", new Object[] { Integer.valueOf(i), Integer.valueOf(j)}));
2323 -+ crashreportsystemdetails.a("Chunk pos hash", new Callable() {
2324 -+ public String a() throws Exception {
2325 -+ return String.valueOf(ChunkCoordIntPair.a(i, j));
2326 -+ }
2327 -+
2328 -+ public Object call() throws Exception {
2329 -+ return this.a();
2330 -+ }
2331 -+ });
2332 -+ crashreportsystemdetails.a("Structure type", new Callable() {
2333 -+ public String a() throws Exception {
2334 -+ return StructureGenerator.this.getClass().getCanonicalName();
2335 -+ }
2336 -+
2337 -+ public Object call() throws Exception {
2338 -+ return this.a();
2339 -+ }
2340 -+ });
2341 -+ throw new ReportedException(crashreport);
2342 -+ }
2343 -+ }
2344 -+ }
2345 -+
2346 -+ public synchronized boolean a(World world, Random random, ChunkCoordIntPair chunkcoordintpair) {
2347 -+ this.a(world);
2348 -+ int i = (chunkcoordintpair.x << 4) + 8;
2349 -+ int j = (chunkcoordintpair.z << 4) + 8;
2350 -+ boolean flag = false;
2351 -+ Iterator iterator = this.c.values().iterator();
2352 -+
2353 -+ while (iterator.hasNext()) {
2354 -+ StructureStart structurestart = (StructureStart) iterator.next();
2355 -+
2356 -+ if (structurestart.a() && structurestart.a(chunkcoordintpair) && structurestart.b().a(i, j, i + 15, j + 15)) {
2357 -+ structurestart.a(world, random, new StructureBoundingBox(i, j, i + 15, j + 15));
2358 -+ structurestart.b(chunkcoordintpair);
2359 -+ flag = true;
2360 -+ this.a(structurestart.e(), structurestart.f(), structurestart);
2361 -+ }
2362 -+ }
2363 -+
2364 -+ return flag;
2365 -+ }
2366 -+
2367 -+ public boolean b(BlockPosition blockposition) {
2368 -+ this.a(this.g);
2369 -+ return this.c(blockposition) != null;
2370 -+ }
2371 -+
2372 -+ protected StructureStart c(BlockPosition blockposition) {
2373 -+ Iterator iterator = this.c.values().iterator();
2374 -+
2375 -+ while (iterator.hasNext()) {
2376 -+ StructureStart structurestart = (StructureStart) iterator.next();
2377 -+
2378 -+ if (structurestart.a() && structurestart.b().b((BaseBlockPosition) blockposition)) {
2379 -+ Iterator iterator1 = structurestart.c().iterator();
2380 -+
2381 -+ while (iterator1.hasNext()) {
2382 -+ StructurePiece structurepiece = (StructurePiece) iterator1.next();
2383 -+
2384 -+ if (structurepiece.c().b((BaseBlockPosition) blockposition)) {
2385 -+ return structurestart;
2386 -+ }
2387 -+ }
2388 -+ }
2389 -+ }
2390 -+
2391 -+ return null;
2392 -+ }
2393 -+
2394 -+ public boolean b(World world, BlockPosition blockposition) {
2395 -+ this.a(world);
2396 -+ Iterator iterator = this.c.values().iterator();
2397 -+
2398 -+ StructureStart structurestart;
2399 -+
2400 -+ do {
2401 -+ if (!iterator.hasNext()) {
2402 -+ return false;
2403 -+ }
2404 -+
2405 -+ structurestart = (StructureStart) iterator.next();
2406 -+ } while (!structurestart.a() || !structurestart.b().b((BaseBlockPosition) blockposition));
2407 -+
2408 -+ return true;
2409 -+ }
2410 -+
2411 -+ public BlockPosition getNearestGeneratedFeature(World world, BlockPosition blockposition) {
2412 -+ this.g = world;
2413 -+ this.a(world);
2414 -+ this.f.setSeed(world.getSeed());
2415 -+ long i = this.f.nextLong();
2416 -+ long j = this.f.nextLong();
2417 -+ long k = (long) (blockposition.getX() >> 4) * i;
2418 -+ long l = (long) (blockposition.getZ() >> 4) * j;
2419 -+
2420 -+ this.f.setSeed(k ^ l ^ world.getSeed());
2421 -+ this.a(world, blockposition.getX() >> 4, blockposition.getZ() >> 4, 0, 0, (ChunkSnapshot) null);
2422 -+ double d0 = Double.MAX_VALUE;
2423 -+ BlockPosition blockposition1 = null;
2424 -+ Iterator iterator = this.c.values().iterator();
2425 -+
2426 -+ BlockPosition blockposition2;
2427 -+ double d1;
2428 -+
2429 -+ while (iterator.hasNext()) {
2430 -+ StructureStart structurestart = (StructureStart) iterator.next();
2431 -+
2432 -+ if (structurestart.a()) {
2433 -+ StructurePiece structurepiece = (StructurePiece) structurestart.c().get(0);
2434 -+
2435 -+ blockposition2 = structurepiece.a();
2436 -+ d1 = blockposition2.k(blockposition);
2437 -+ if (d1 < d0) {
2438 -+ d0 = d1;
2439 -+ blockposition1 = blockposition2;
2440 -+ }
2441 -+ }
2442 -+ }
2443 -+
2444 -+ if (blockposition1 != null) {
2445 -+ return blockposition1;
2446 -+ } else {
2447 -+ List list = this.E_();
2448 -+
2449 -+ if (list != null) {
2450 -+ BlockPosition blockposition3 = null;
2451 -+ Iterator iterator1 = list.iterator();
2452 -+
2453 -+ while (iterator1.hasNext()) {
2454 -+ blockposition2 = (BlockPosition) iterator1.next();
2455 -+ d1 = blockposition2.k(blockposition);
2456 -+ if (d1 < d0) {
2457 -+ d0 = d1;
2458 -+ blockposition3 = blockposition2;
2459 -+ }
2460 -+ }
2461 -+
2462 -+ return blockposition3;
2463 -+ } else {
2464 -+ return null;
2465 -+ }
2466 -+ }
2467 -+ }
2468 -+
2469 -+ protected List<BlockPosition> E_() {
2470 -+ return null;
2471 -+ }
2472 -+
2473 -+ protected void a(World world) {
2474 -+ if (this.a == null) {
2475 -+ this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a());
2476 -+ if (this.a == null) {
2477 -+ this.a = new PersistentStructure(this.a());
2478 -+ world.a(this.a(), (PersistentBase) this.a);
2479 -+ } else {
2480 -+ NBTTagCompound nbttagcompound = this.a.a();
2481 -+ Iterator iterator = nbttagcompound.c().iterator();
2482 -+
2483 -+ while (iterator.hasNext()) {
2484 -+ String s = (String) iterator.next();
2485 -+ NBTBase nbtbase = nbttagcompound.get(s);
2486 -+
2487 -+ if (nbtbase.getTypeId() == 10) {
2488 -+ NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbtbase;
2489 -+
2490 -+ if (nbttagcompound1.hasKey("ChunkX") && nbttagcompound1.hasKey("ChunkZ")) {
2491 -+ int i = nbttagcompound1.getInt("ChunkX");
2492 -+ int j = nbttagcompound1.getInt("ChunkZ");
2493 -+ StructureStart structurestart = WorldGenFactory.a(nbttagcompound1, world);
2494 -+
2495 -+ if (structurestart != null) {
2496 -+ this.c.put(Long.valueOf(ChunkCoordIntPair.a(i, j)), structurestart);
2497 -+ }
2498 -+ }
2499 -+ }
2500 -+ }
2501 -+ }
2502 -+ }
2503 -+
2504 -+ }
2505 -+
2506 -+ private void a(int i, int j, StructureStart structurestart) {
2507 -+ this.a.a(structurestart.a(i, j), i, j);
2508 -+ this.a.c();
2509 -+ }
2510 -+
2511 -+ protected abstract boolean a(int i, int j);
2512 -+
2513 -+ protected abstract StructureStart b(int i, int j);
2514 -+}
2515 2270 diff --git a/src/main/java/net/minecraft/server/WorldGenLargeFeature.java b/src/main/java/net/minecraft/server/WorldGenLargeFeature.java
2516 2271 new file mode 100644
2517 2272 index 0000000..462dc76
2518 2273 --- /dev/null
2519 2274 +++ b/src/main/java/net/minecraft/server/WorldGenLargeFeature.java
2520 2275 @@ -0,0 +1,139 @@
2521 2276 +package net.minecraft.server;
2522 2277 +
2523 2278 +import com.google.common.collect.Lists;
2524 2279 +import java.util.Arrays;
2816 2571 + {
2817 2572 + throw SneakyThrow.<RuntimeException>superSneaky( t );
2818 2573 + }
2819 2574 +
2820 2575 + private static <T extends Throwable> T superSneaky(Throwable t) throws T
2821 2576 + {
2822 2577 + throw (T) t;
2823 2578 + }
2824 2579 +}
2825 2580 --
2826 -1.9.1
2581 +2.7.4
2827 2582

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

Add shortcut