mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Fix up biome handling for client and server
This commit is contained in:
1 parent
abcb583dd0
commit
df205d7d3f
6 files changed
+27
-4
No files matched your search
@@ -1091,4 +1091,12 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param biome
|
||||
*/
|
||||
public void removeBiomeFromDefaultWorldGenerator(BiomeGenBase biome)
|
||||
{
|
||||
WorldType.field_48635_b.removeBiome(biome);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package net.minecraft.src;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.registry.FMLRegistry;
|
||||
import cpw.mods.fml.common.registry.IMinecraftRegistry;
|
||||
|
||||
@@ -79,7 +80,7 @@ public class ClientRegistry implements IMinecraftRegistry
|
||||
@Override
|
||||
public void addBiome(BiomeGenBase biome)
|
||||
{
|
||||
//NOOP because the implementation idea is broken. Creating a BiomeGenBase adds the biome already.
|
||||
FMLClientHandler.instance().addBiomeToDefaultWorldGenerator(biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -121,7 +122,7 @@ public class ClientRegistry implements IMinecraftRegistry
|
||||
@Override
|
||||
public void removeBiome(BiomeGenBase biome)
|
||||
{
|
||||
// NOOP because broken
|
||||
FMLClientHandler.instance().removeBiomeFromDefaultWorldGenerator(biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -92,6 +92,11 @@ public class FMLRegistry
|
||||
instance.addSpawn(entityName, weightedProb, min, max, spawnList, biomes);
|
||||
}
|
||||
|
||||
public static void removeBiome(BiomeGenBase biome)
|
||||
{
|
||||
instance.removeBiome(biome);
|
||||
}
|
||||
|
||||
public static void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
instance.removeSpawn(entityClass, typeOfCreature, biomes);
|
||||
|
||||
@@ -16,6 +16,8 @@ public interface IMinecraftRegistry
|
||||
|
||||
public abstract void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes);
|
||||
|
||||
public abstract void removeBiome(BiomeGenBase biome);
|
||||
|
||||
public abstract void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes);
|
||||
|
||||
public abstract void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes);
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ModLoader
|
||||
*/
|
||||
public static void addBiome(BiomeGenBase biome)
|
||||
{
|
||||
FMLServerHandler.instance().addBiomeToDefaultWorldGenerator(biome);
|
||||
FMLRegistry.addBiome(biome);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.IMinecraftRegistry;
|
||||
import cpw.mods.fml.server.FMLServerHandler;
|
||||
|
||||
public class ServerRegistry implements IMinecraftRegistry
|
||||
{
|
||||
@@ -69,7 +70,7 @@ public class ServerRegistry implements IMinecraftRegistry
|
||||
@Override
|
||||
public void addBiome(BiomeGenBase biome)
|
||||
{
|
||||
//NOOP because the implementation idea is broken. Creating a BiomeGenBase adds the biome already.
|
||||
FMLServerHandler.instance().addBiomeToDefaultWorldGenerator(biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,6 +109,12 @@ public class ServerRegistry implements IMinecraftRegistry
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBiome(BiomeGenBase biome)
|
||||
{
|
||||
FMLServerHandler.instance().removeBiomeFromDefaultWorldGenerator(biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user