Removed value that was turned to true when having generated the spawn cave as it would've been overriden on world join anyway. As there's only one spawn, unless you set it into chunks that haven't generated yet, it doesn't matter anyways.

This commit is contained in:
Ellpeck 2016-05-20 14:50:39 +02:00
parent ddf012ef62
commit 93b51eb853
3 changed files with 7 additions and 20 deletions

View file

@ -41,7 +41,7 @@ public class ConfigValues{
public static boolean lessParticles; public static boolean lessParticles;
public static boolean lessBlockBreakingEffects; public static boolean lessBlockBreakingEffects;
public static boolean caveWorld = false; //TODO Make this proper public static boolean caveWorld = true; //TODO Make this proper
public static void defineConfigValues(Configuration config){ public static void defineConfigValues(Configuration config){

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.gen.cave; package de.ellpeck.actuallyadditions.mod.gen.cave;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -27,7 +28,6 @@ import java.util.Random;
public class ChunkProviderCave implements IChunkGenerator{ public class ChunkProviderCave implements IChunkGenerator{
private boolean generatedSpawn;
private final World world; private final World world;
private final Random rand; private final Random rand;
@ -74,12 +74,11 @@ public class ChunkProviderCave implements IChunkGenerator{
@Override @Override
public void populate(int x, int z){ public void populate(int x, int z){
if(!this.generatedSpawn){
BlockPos spawn = this.world.getSpawnPoint(); BlockPos spawn = this.world.getSpawnPoint();
Chunk chunk = this.world.getChunkFromBlockCoords(spawn); Chunk chunk = this.world.getChunkFromBlockCoords(spawn);
if(chunk.xPosition == x && chunk.zPosition == z){ if(chunk.xPosition == x && chunk.zPosition == z){
this.generatedSpawn = this.spawnGenerator.generate(this.world, this.rand, spawn); this.spawnGenerator.generate(this.world, this.rand, spawn);
} ModUtil.LOGGER.info("Generating spawn cave...");
} }
} }

View file

@ -25,8 +25,6 @@ public class WorldData extends WorldSavedData{
public static final String DATA_TAG = ModUtil.MOD_ID+"WorldData"; public static final String DATA_TAG = ModUtil.MOD_ID+"WorldData";
private static WorldData instance; private static WorldData instance;
public static NBTTagCompound additionalData = new NBTTagCompound();
public WorldData(String tag){ public WorldData(String tag){
super(tag); super(tag);
} }
@ -71,10 +69,6 @@ public class WorldData extends WorldSavedData{
ModUtil.LOGGER.info("Clearing leftover Persistent Server Data from other worlds!"); ModUtil.LOGGER.info("Clearing leftover Persistent Server Data from other worlds!");
PersistentServerData.playerSaveData.clear(); PersistentServerData.playerSaveData.clear();
} }
if(!additionalData.hasNoTags()){
ModUtil.LOGGER.info("Clearing leftover Additional Data from other worlds!");
additionalData = new NBTTagCompound();
}
} }
@Override @Override
@ -92,9 +86,6 @@ public class WorldData extends WorldSavedData{
PersistentServerData.PlayerSave aSave = PersistentServerData.PlayerSave.fromNBT(playerList.getCompoundTagAt(i)); PersistentServerData.PlayerSave aSave = PersistentServerData.PlayerSave.fromNBT(playerList.getCompoundTagAt(i));
PersistentServerData.playerSaveData.add(aSave); PersistentServerData.playerSaveData.add(aSave);
} }
//Additional Data
additionalData = compound.getCompoundTag("Additional");
} }
@Nonnull @Nonnull
@ -115,9 +106,6 @@ public class WorldData extends WorldSavedData{
} }
compound.setTag("PlayerData", playerList); compound.setTag("PlayerData", playerList);
//Additional Data
compound.setTag("Additional", additionalData);
return compound; return compound;
} }
} }