Update to Minecraft 1.9

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-03-01 08:32:46 +11:00
parent 2da480a9c8
commit 21d4bf5d1f
305 changed files with 6684 additions and 6105 deletions

View File

@@ -1,27 +1,26 @@
--- a/net/minecraft/server/WorldNBTStorage.java
+++ b/net/minecraft/server/WorldNBTStorage.java
@@ -11,6 +11,12 @@
@@ -11,6 +11,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.UUID;
+
+import org.bukkit.craftbukkit.entity.CraftPlayer;
+// CraftBukkit end
+
public class WorldNBTStorage implements IDataManager, IPlayerFileData {
private static final Logger a = LogManager.getLogger();
@@ -19,6 +25,7 @@
private final File dataDir;
private final long sessionId = MinecraftServer.az();
private final String f;
private static final Logger b = LogManager.getLogger();
@@ -21,6 +26,7 @@
private final String g;
private final DefinedStructureManager h;
protected final DataConverterManager a;
+ private UUID uuid = null; // CraftBukkit
public WorldNBTStorage(File file, String s, boolean flag) {
this.baseDir = new File(file, s);
@@ -202,12 +209,39 @@
public WorldNBTStorage(File file, String s, boolean flag, DataConverterManager dataconvertermanager) {
this.a = dataconvertermanager;
@@ -167,12 +173,38 @@
}
if (nbttagcompound != null) {
@@ -35,8 +34,7 @@
+ }
+ }
+ // CraftBukkit end
+
entityhuman.f(nbttagcompound);
entityhuman.f(this.a.a((DataConverterType) DataConverterTypes.PLAYER, nbttagcompound));
}
return nbttagcompound;
@@ -51,7 +49,7 @@
+ return NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file1)));
+ }
+ } catch (Exception exception) {
+ a.warn("Failed to load player data for " + s);
+ b.warn("Failed to load player data for " + s);
+ }
+
+ return null;
@@ -61,9 +59,9 @@
public IPlayerFileData getPlayerFileData() {
return this;
}
@@ -237,4 +271,50 @@
public String g() {
return this.f;
@@ -202,4 +234,50 @@
public DefinedStructureManager h() {
return this.h;
}
+
+ // CraftBukkit start
@@ -76,7 +74,7 @@
+ dis = new DataInputStream(new FileInputStream(file1));
+ return uuid = new UUID(dis.readLong(), dis.readLong());
+ } catch (IOException ex) {
+ a.warn("Failed to read " + file1 + ", generating new random UUID", ex);
+ b.warn("Failed to read " + file1 + ", generating new random UUID", ex);
+ } finally {
+ if (dis != null) {
+ try {
@@ -94,7 +92,7 @@
+ dos.writeLong(uuid.getMostSignificantBits());
+ dos.writeLong(uuid.getLeastSignificantBits());
+ } catch (IOException ex) {
+ a.warn("Failed to write " + file1, ex);
+ b.warn("Failed to write " + file1, ex);
+ } finally {
+ if (dos != null) {
+ try {