mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Merge pull request #1034 from Adubbz/master
Greatly simplified the addition of new biomes to the default world. If this breaks things blame Adubbz.
This commit is contained in:
commit
f3cbc6c262
3 files changed
+174
-1
No files matched your search
@@ -1,16 +1,50 @@
|
||||
package net.minecraftforge.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.structure.MapGenVillage;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
|
||||
public class BiomeManager
|
||||
{
|
||||
public static List<BiomeEntry> desertBiomes = new ArrayList<BiomeEntry>();
|
||||
public static List<BiomeEntry> warmBiomes = new ArrayList<BiomeEntry>();
|
||||
public static List<BiomeEntry> coolBiomes = new ArrayList<BiomeEntry>();
|
||||
public static List<BiomeEntry> icyBiomes = new ArrayList<BiomeEntry>();
|
||||
|
||||
public static List<BiomeGenBase> oceanBiomes = new ArrayList<BiomeGenBase>();
|
||||
|
||||
public static ArrayList<BiomeGenBase> strongHoldBiomes = new ArrayList<BiomeGenBase>();
|
||||
public static ArrayList<BiomeGenBase> strongHoldBiomesBlackList = new ArrayList<BiomeGenBase>();
|
||||
|
||||
static
|
||||
{
|
||||
warmBiomes.add(new BiomeEntry(BiomeGenBase.forest, 10));
|
||||
warmBiomes.add(new BiomeEntry(BiomeGenBase.roofedForest, 10));
|
||||
warmBiomes.add(new BiomeEntry(BiomeGenBase.extremeHills, 10));
|
||||
warmBiomes.add(new BiomeEntry(BiomeGenBase.plains, 10));
|
||||
warmBiomes.add(new BiomeEntry(BiomeGenBase.birchForest, 10));
|
||||
warmBiomes.add(new BiomeEntry(BiomeGenBase.swampland, 10));
|
||||
|
||||
coolBiomes.add(new BiomeEntry(BiomeGenBase.forest, 10));
|
||||
coolBiomes.add(new BiomeEntry(BiomeGenBase.extremeHills, 10));
|
||||
coolBiomes.add(new BiomeEntry(BiomeGenBase.taiga, 10));
|
||||
coolBiomes.add(new BiomeEntry(BiomeGenBase.plains, 10));
|
||||
|
||||
icyBiomes.add(new BiomeEntry(BiomeGenBase.icePlains, 30));
|
||||
icyBiomes.add(new BiomeEntry(BiomeGenBase.coldTaiga, 10));
|
||||
|
||||
oceanBiomes.add(BiomeGenBase.ocean);
|
||||
oceanBiomes.add(BiomeGenBase.deepOcean);
|
||||
oceanBiomes.add(BiomeGenBase.frozenOcean);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn)
|
||||
{
|
||||
@@ -64,4 +98,16 @@ public class BiomeManager
|
||||
WorldChunkManager.allowedBiomes.remove(biome);
|
||||
}
|
||||
}
|
||||
|
||||
public static class BiomeEntry extends WeightedRandom.Item
|
||||
{
|
||||
public final BiomeGenBase biome;
|
||||
|
||||
public BiomeEntry(BiomeGenBase biome, int weight)
|
||||
{
|
||||
super(weight);
|
||||
|
||||
this.biome = biome;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user