Update to Minecraft 1.8.3

By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
CraftBukkit/Spigot
2015-02-26 22:41:06 +00:00
parent d789ce91d4
commit 85be409b13
347 changed files with 5027 additions and 5465 deletions

View File

@@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.chunkio;
import java.io.IOException;
import net.minecraft.server.Chunk;
import net.minecraft.server.ChunkRegionLoader;
import net.minecraft.server.NBTTagCompound;
@@ -9,21 +10,27 @@ import org.bukkit.craftbukkit.util.AsynchronousExecutor;
import org.bukkit.craftbukkit.util.LongHash;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChunk, Chunk, Runnable, RuntimeException> {
private final AtomicInteger threadNumber = new AtomicInteger(1);
// async stuff
public Chunk callStage1(QueuedChunk queuedChunk) throws RuntimeException {
ChunkRegionLoader loader = queuedChunk.loader;
Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z);
try {
ChunkRegionLoader loader = queuedChunk.loader;
Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z);
if (data != null) {
queuedChunk.compound = (NBTTagCompound) data[1];
return (Chunk) data[0];
}
if (data != null) {
queuedChunk.compound = (NBTTagCompound) data[1];
return (Chunk) data[0];
return null;
} catch (IOException ex) {
throw new RuntimeException(ex);
}
return null;
}
// sync stuff