@@ -71,7 +71,7 @@ public class JavaWorld extends World {
7171 new String [] { NETHER_DIMENSION_ID , OVERWORLD_DIMENSION_ID , END_DIMENSION_ID }
7272 ));
7373
74- protected int versionId ;
74+ protected final int versionId ;
7575
7676 /**
7777 * In a java world player data is per-world and not per-dimension, so we store it here.
@@ -89,10 +89,12 @@ public class JavaWorld extends World {
8989 * @param seed
9090 * @param timestamp
9191 */
92- protected JavaWorld (String levelName , File worldDirectory , long seed , long timestamp , Set <PlayerEntityData > playerEntities , Vector3i spawnPos ) {
92+ protected JavaWorld (String levelName , File worldDirectory , long seed , long timestamp , Set <PlayerEntityData > playerEntities , Vector3i spawnPos , int gameMode , int versionId ) {
9393 super (levelName , worldDirectory , seed , timestamp );
9494 this .playerEntities = playerEntities ;
9595 this .spawnPos = spawnPos ;
96+ this .gameMode = gameMode ;
97+ this .versionId = versionId ;
9698 }
9799
98100 @ Override
@@ -164,11 +166,7 @@ public static World loadWorld(File worldDirectory, LoggedWarnings warnings) {
164166 spawnPos = new Vector3i (0 , 0 , 0 );
165167 }
166168
167- JavaWorld world = new JavaWorld (levelName , worldDirectory , seed , modtime , playerEntities , spawnPos );
168- world .gameMode = gameType .intValue (0 );
169- world .versionId = versionId .intValue ();
170-
171- return world ;
169+ return new JavaWorld (levelName , worldDirectory , seed , modtime , playerEntities , spawnPos , gameType .intValue (0 ), versionId .intValue ());
172170 } catch (FileNotFoundException e ) {
173171 if (warnings == LoggedWarnings .NORMAL ) {
174172 Log .infof ("Could not find level.dat file for world %s!" , levelName );
@@ -293,8 +291,8 @@ public synchronized void exportChunksToZip(File target, Collection<ChunkPosition
293291 progress .setJobSize (regionMap .size () + 1 );
294292
295293 String regionDirectory =
296- currentDim .id ().equals (JavaWorld .OVERWORLD_DIMENSION_ID ) ? currentDim .getDimensionDirectory ().getName () :
297- currentDim .getDimensionDirectory ().getName () + "/DIM" + JavaWorld .VANILLA_DIMENSION_ID_TO_IDX .get (currentDim .id ());
294+ currentDim .getId ().equals (JavaWorld .OVERWORLD_DIMENSION_ID ) ? currentDim .getDimensionDirectory ().getName () :
295+ currentDim .getDimensionDirectory ().getName () + "/DIM" + JavaWorld .VANILLA_DIMENSION_ID_TO_IDX .get (currentDim .getId ());
298296 regionDirectory += "/region" ;
299297
300298 try (ZipOutputStream zout = new ZipOutputStream (new FileOutputStream (target ))) {
0 commit comments