From 98aecd7f6bf4c4943125aa9fe3e72122a43b05b0 Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Thu, 19 Sep 2013 16:47:46 -0700 Subject: [PATCH] Move have handler creation up, to prevent NPE. --- .../net/minecraft/world/World.java.patch | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 88d9ad7872..26732593b1 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -92,11 +92,10 @@ this.worldLogAgent = par6ILogAgent; this.worldInfo = par1ISaveHandler.loadWorldInfo(); -@@ -275,12 +315,20 @@ - this.worldInfo.setServerInitialized(true); - } +@@ -249,6 +289,14 @@ -- VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); + this.provider.registerWorld(this); + this.chunkProvider = this.createChunkProvider(); + if (this instanceof WorldServer) + { + this.perWorldStorage = new MapStorage(new WorldSpecificSaveHandler((WorldServer)this, par1ISaveHandler)); @@ -105,6 +104,14 @@ + { + this.perWorldStorage = new MapStorage((ISaveHandler)null); + } + + if (!this.worldInfo.isInitialized()) + { +@@ -275,12 +323,12 @@ + this.worldInfo.setServerInitialized(true); + } + +- VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); + VillageCollection villagecollection = (VillageCollection)perWorldStorage.loadData(VillageCollection.class, "villages"); if (villagecollection == null)