Files
CatServer/patches/net/minecraft/world/biome/BiomeProvider.java.patch
2019-02-24 22:29:41 +08:00

39 lines
1.8 KiB
Diff

--- ../src-base/minecraft/net/minecraft/world/biome/BiomeProvider.java
+++ ../src-work/minecraft/net/minecraft/world/biome/BiomeProvider.java
@@ -22,11 +22,12 @@
private GenLayer biomeIndexLayer;
private final BiomeCache biomeCache;
private final List<Biome> biomesToSpawnIn;
+ public static List<Biome> allowedBiomes = Lists.newArrayList(Biomes.FOREST, Biomes.PLAINS, Biomes.TAIGA, Biomes.TAIGA_HILLS, Biomes.FOREST_HILLS, Biomes.JUNGLE, Biomes.JUNGLE_HILLS);
protected BiomeProvider()
{
this.biomeCache = new BiomeCache(this);
- this.biomesToSpawnIn = Lists.newArrayList(Biomes.FOREST, Biomes.PLAINS, Biomes.TAIGA, Biomes.TAIGA_HILLS, Biomes.FOREST_HILLS, Biomes.JUNGLE, Biomes.JUNGLE_HILLS);
+ this.biomesToSpawnIn = Lists.newArrayList(allowedBiomes);
}
private BiomeProvider(long seed, WorldType worldTypeIn, String options)
@@ -39,6 +40,7 @@
}
GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(seed, worldTypeIn, this.settings);
+ agenlayer = getModdedBiomeGenerators(worldTypeIn, seed, agenlayer);
this.genBiomes = agenlayer[0];
this.biomeIndexLayer = agenlayer[1];
}
@@ -207,6 +209,13 @@
this.biomeCache.cleanupCache();
}
+ public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original)
+ {
+ net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens event = new net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens(worldType, seed, original);
+ net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event);
+ return event.getNewBiomeGens();
+ }
+
public boolean isFixedBiome()
{
return this.settings != null && this.settings.fixedBiome >= 0;