You can now only spawn on beaches (configurable)
This commit is contained in:
parent
ae45fee974
commit
512a03e027
|
@ -16,7 +16,6 @@ public class BOPConfigurationMisc
|
||||||
public static boolean skyColors;
|
public static boolean skyColors;
|
||||||
public static boolean achievements;
|
public static boolean achievements;
|
||||||
public static boolean dungeonLoot;
|
public static boolean dungeonLoot;
|
||||||
public static boolean rainCreatesPuddles;
|
|
||||||
|
|
||||||
public static boolean amethystTools;
|
public static boolean amethystTools;
|
||||||
public static boolean mudTools;
|
public static boolean mudTools;
|
||||||
|
@ -29,6 +28,9 @@ public class BOPConfigurationMisc
|
||||||
|
|
||||||
public static int promisedLandSkyColor;
|
public static int promisedLandSkyColor;
|
||||||
|
|
||||||
|
public static int spawnSearchRadius;
|
||||||
|
public static boolean onlySpawnOnBeaches;
|
||||||
|
|
||||||
public static void init(File configFile)
|
public static void init(File configFile)
|
||||||
{
|
{
|
||||||
config = new Configuration(configFile);
|
config = new Configuration(configFile);
|
||||||
|
@ -39,7 +41,6 @@ public class BOPConfigurationMisc
|
||||||
|
|
||||||
achievements = config.get("Miscellanious Settings", "Add Biomes O\' Plenty Achievements", true).getBoolean(false);
|
achievements = config.get("Miscellanious Settings", "Add Biomes O\' Plenty Achievements", true).getBoolean(false);
|
||||||
dungeonLoot = config.get("Miscellanious Settings", "Add Custom Dungeon Loot", true).getBoolean(false);
|
dungeonLoot = config.get("Miscellanious Settings", "Add Custom Dungeon Loot", true).getBoolean(false);
|
||||||
rainCreatesPuddles = config.get("Miscellanious Settings", "Enable Puddles During Rain", true).getBoolean(true);
|
|
||||||
hotSpringsRegeneration = config.get("Miscellanious Settings", "Enable Spring Water Regeneration Effect", true).getBoolean(true);
|
hotSpringsRegeneration = config.get("Miscellanious Settings", "Enable Spring Water Regeneration Effect", true).getBoolean(true);
|
||||||
|
|
||||||
amethystTools = config.get("Crafting Settings", "Enable Amethyst Tool/Armor Crafting", true).getBoolean(true);
|
amethystTools = config.get("Crafting Settings", "Enable Amethyst Tool/Armor Crafting", true).getBoolean(true);
|
||||||
|
@ -53,6 +54,9 @@ public class BOPConfigurationMisc
|
||||||
//Hard-Coded Colors
|
//Hard-Coded Colors
|
||||||
skyColors = config.get("Hard-Coded Colors", "Enable Sky Colors", true).getBoolean(false);
|
skyColors = config.get("Hard-Coded Colors", "Enable Sky Colors", true).getBoolean(false);
|
||||||
|
|
||||||
|
spawnSearchRadius = config.get("Spawn Settings", "Spawn Location Search Radius", 1024, "Must be 256 or higher").getInt();
|
||||||
|
onlySpawnOnBeaches = config.get("Spawn Settings", "Only Spawn On Beaches", true).getBoolean(true);
|
||||||
|
|
||||||
promisedLandSkyColor = config.get("Hard-Coded Colors", "Promised Land Sky Color", 5883101, null).getInt();
|
promisedLandSkyColor = config.get("Hard-Coded Colors", "Promised Land Sky Color", 5883101, null).getInt();
|
||||||
|
|
||||||
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Misc Config!");
|
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Misc Config!");
|
||||||
|
|
|
@ -71,6 +71,7 @@ import biomesoplenty.common.biomes.BiomeGenWasteland;
|
||||||
import biomesoplenty.common.biomes.BiomeGenWetland;
|
import biomesoplenty.common.biomes.BiomeGenWetland;
|
||||||
import biomesoplenty.common.biomes.BiomeGenWoodland;
|
import biomesoplenty.common.biomes.BiomeGenWoodland;
|
||||||
import biomesoplenty.common.configuration.BOPConfigurationIDs;
|
import biomesoplenty.common.configuration.BOPConfigurationIDs;
|
||||||
|
import biomesoplenty.common.configuration.BOPConfigurationMisc;
|
||||||
import biomesoplenty.common.world.WorldTypeBOP;
|
import biomesoplenty.common.world.WorldTypeBOP;
|
||||||
|
|
||||||
public class BOPBiomes
|
public class BOPBiomes
|
||||||
|
@ -175,12 +176,20 @@ public class BOPBiomes
|
||||||
|
|
||||||
private static void addSpawnBiomes()
|
private static void addSpawnBiomes()
|
||||||
{
|
{
|
||||||
//TODO: Spawn only on beaches.
|
if (BOPConfigurationMisc.onlySpawnOnBeaches)
|
||||||
|
{
|
||||||
clearAllSpawnBiomes();
|
clearAllSpawnBiomes();
|
||||||
|
|
||||||
addSpawnBiome(BiomeGenBase.beach);
|
addSpawnBiome(BiomeGenBase.beach);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (BiomeGenBase biome : BOPBiomeHelper.biomeList.values())
|
||||||
|
{
|
||||||
|
addSpawnBiome(biome);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void registerOnlyBiome(BOPBiomeListEntry biome)
|
public static void registerOnlyBiome(BOPBiomeListEntry biome)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package biomesoplenty.common.world;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import biomesoplenty.common.configuration.BOPConfigurationMisc;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.WorldChunkManager;
|
||||||
|
|
||||||
|
public class WorldChunkManagerBOP extends WorldChunkManager
|
||||||
|
{
|
||||||
|
public WorldChunkManagerBOP(World world)
|
||||||
|
{
|
||||||
|
super(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChunkPosition func_150795_a(int x, int z, int radius, List biomesToSpawnIn, Random random)
|
||||||
|
{
|
||||||
|
int spawnSearchRadius = BOPConfigurationMisc.spawnSearchRadius >= 256 ? BOPConfigurationMisc.spawnSearchRadius : 256;
|
||||||
|
|
||||||
|
return super.func_150795_a(x, z, spawnSearchRadius, biomesToSpawnIn, random);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package biomesoplenty.common.world;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.world.WorldProviderSurface;
|
||||||
|
|
||||||
|
public class WorldProviderSurfaceBOP extends WorldProviderSurface
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean canCoordinateBeSpawn(int x, int z)
|
||||||
|
{
|
||||||
|
//TODO: getTopBlock()
|
||||||
|
Block topBlock = this.worldObj.func_147474_b(x, z);
|
||||||
|
|
||||||
|
return topBlock == Blocks.sand && this.worldChunkMgr.getBiomesToSpawnIn().contains(this.worldObj.getBiomeGenForCoordsBody(x, z));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,24 @@
|
||||||
package biomesoplenty.common.world;
|
package biomesoplenty.common.world;
|
||||||
|
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldType;
|
import net.minecraft.world.WorldType;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraft.world.biome.WorldChunkManager;
|
||||||
|
import net.minecraft.world.biome.WorldChunkManagerHell;
|
||||||
|
import net.minecraft.world.gen.FlatGeneratorInfo;
|
||||||
import net.minecraft.world.gen.layer.GenLayer;
|
import net.minecraft.world.gen.layer.GenLayer;
|
||||||
import net.minecraft.world.gen.layer.GenLayerBiomeEdge;
|
import net.minecraft.world.gen.layer.GenLayerBiomeEdge;
|
||||||
import net.minecraft.world.gen.layer.GenLayerZoom;
|
import net.minecraft.world.gen.layer.GenLayerZoom;
|
||||||
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
|
||||||
public class WorldTypeBOP extends WorldType
|
public class WorldTypeBOP extends WorldType
|
||||||
{
|
{
|
||||||
public WorldTypeBOP()
|
public WorldTypeBOP()
|
||||||
{
|
{
|
||||||
super("BIOMESOP");
|
super("BIOMESOP");
|
||||||
|
|
||||||
|
DimensionManager.unregisterProviderType(0);
|
||||||
|
DimensionManager.registerProviderType(0, WorldProviderSurfaceBOP.class, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -20,4 +29,10 @@ public class WorldTypeBOP extends WorldType
|
||||||
ret = new GenLayerBiomeEdge(1000L, ret);
|
ret = new GenLayerBiomeEdge(1000L, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WorldChunkManager getChunkManager(World world)
|
||||||
|
{
|
||||||
|
return new WorldChunkManagerBOP(world);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue