Move have handler creation up, to prevent NPE.
This commit is contained in:
parent
f58df75bea
commit
98aecd7f6b
1 changed files with 11 additions and 4 deletions
|
@ -92,11 +92,10 @@
|
||||||
this.worldLogAgent = par6ILogAgent;
|
this.worldLogAgent = par6ILogAgent;
|
||||||
this.worldInfo = par1ISaveHandler.loadWorldInfo();
|
this.worldInfo = par1ISaveHandler.loadWorldInfo();
|
||||||
|
|
||||||
@@ -275,12 +315,20 @@
|
@@ -249,6 +289,14 @@
|
||||||
this.worldInfo.setServerInitialized(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
- VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages");
|
this.provider.registerWorld(this);
|
||||||
|
this.chunkProvider = this.createChunkProvider();
|
||||||
+ if (this instanceof WorldServer)
|
+ if (this instanceof WorldServer)
|
||||||
+ {
|
+ {
|
||||||
+ this.perWorldStorage = new MapStorage(new WorldSpecificSaveHandler((WorldServer)this, par1ISaveHandler));
|
+ this.perWorldStorage = new MapStorage(new WorldSpecificSaveHandler((WorldServer)this, par1ISaveHandler));
|
||||||
|
@ -105,6 +104,14 @@
|
||||||
+ {
|
+ {
|
||||||
+ this.perWorldStorage = new MapStorage((ISaveHandler)null);
|
+ 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");
|
+ VillageCollection villagecollection = (VillageCollection)perWorldStorage.loadData(VillageCollection.class, "villages");
|
||||||
|
|
||||||
if (villagecollection == null)
|
if (villagecollection == null)
|
||||||
|
|
Loading…
Reference in a new issue