Fixed server seed inconsistency. Closes #1644

This commit is contained in:
Adubbz 2020-07-21 13:32:02 +10:00
parent b1dd655bb5
commit 8f4a43af31
1 changed files with 2 additions and 10 deletions

View File

@ -85,23 +85,15 @@ public class BOPWorldTypeUtil
return;
ServerProperties properties = server.getProperties();
DimensionGeneratorSettings oldWorldGenSettings = properties.worldGenSettings;
// Obtain the original settings
long seed = oldWorldGenSettings.seed();
boolean generateFeatures = oldWorldGenSettings.generateFeatures();
boolean generateBonusChest = oldWorldGenSettings.generateBonusChest();
BiomesOPlenty.logger.info("Setting world generator settings to biomesoplenty");
DimensionGeneratorSettings newWorldGenSettings = createDimensionGeneratorSettings(seed, generateFeatures, generateBonusChest);
if (server.getWorldData() instanceof ServerWorldInfo)
{
ServerWorldInfo worldInfo = (ServerWorldInfo)server.getWorldData();
worldInfo.worldGenSettings = newWorldGenSettings;
worldInfo.worldGenSettings = createDimensionGeneratorSettings(worldInfo.worldGenSettings.seed(), worldInfo.worldGenSettings.generateFeatures(), worldInfo.worldGenSettings.generateBonusChest());
}
// Replace the world gen settings in server.properties
properties.worldGenSettings = newWorldGenSettings;
properties.worldGenSettings = createDimensionGeneratorSettings(properties.worldGenSettings.seed(), properties.worldGenSettings.generateFeatures(), properties.worldGenSettings.generateBonusChest());
}
}