mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 06:53:20 +00:00
MapGenStronghold dynamic biome changes. Changed InitNoiseGensEvent to pass a NoiseGenerator array instead of NoiseGeneratorOctaves due to new NoiseGeneratorPerlin in ChunkProviderGenerate. Fixed worldgen crash caused by wrong metadata in Chunk patch.
73 lines
2.2 KiB
Java
73 lines
2.2 KiB
Java
package net.minecraftforge.common;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
|
import net.minecraft.world.gen.ChunkProviderGenerate;
|
|
import net.minecraft.world.chunk.IChunkProvider;
|
|
import net.minecraft.world.gen.structure.MapGenStronghold;
|
|
import net.minecraft.world.gen.structure.MapGenVillage;
|
|
import net.minecraft.world.biome.WorldChunkManager;
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
public class BiomeManager
|
|
{
|
|
public static ArrayList<BiomeGenBase> strongHoldBiomes = new ArrayList<BiomeGenBase>();
|
|
public static ArrayList<BiomeGenBase> strongHoldBiomesBlackList = new ArrayList<BiomeGenBase>();
|
|
|
|
public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn)
|
|
{
|
|
if (!MapGenVillage.villageSpawnBiomes.contains(biome))
|
|
{
|
|
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
|
|
biomes.add(biome);
|
|
MapGenVillage.villageSpawnBiomes = biomes;
|
|
}
|
|
}
|
|
|
|
public static void removeVillageBiome(BiomeGenBase biome)
|
|
{
|
|
if (MapGenVillage.villageSpawnBiomes.contains(biome))
|
|
{
|
|
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
|
|
biomes.remove(biome);
|
|
MapGenVillage.villageSpawnBiomes = biomes;
|
|
}
|
|
}
|
|
|
|
public static void addStrongholdBiome(BiomeGenBase biome)
|
|
{
|
|
if (!strongHoldBiomes.contains(biome))
|
|
{
|
|
strongHoldBiomes.add(biome);
|
|
}
|
|
}
|
|
|
|
public static void removeStrongholdBiome(BiomeGenBase biome)
|
|
{
|
|
if (!strongHoldBiomesBlackList.contains(biome))
|
|
{
|
|
strongHoldBiomesBlackList.add(biome);
|
|
}
|
|
}
|
|
|
|
public static void addSpawnBiome(BiomeGenBase biome)
|
|
{
|
|
if (!WorldChunkManager.allowedBiomes.contains(biome))
|
|
{
|
|
WorldChunkManager.allowedBiomes.add(biome);
|
|
}
|
|
}
|
|
|
|
public static void removeSpawnBiome(BiomeGenBase biome)
|
|
{
|
|
if (WorldChunkManager.allowedBiomes.contains(biome))
|
|
{
|
|
WorldChunkManager.allowedBiomes.remove(biome);
|
|
}
|
|
}
|
|
} |