tried adding bwg4 api but it doesn't work :(

This commit is contained in:
ted80-PC 2013-04-20 13:55:39 +02:00
parent f62d7ae8a5
commit f1fabb9da2
2 changed files with 87 additions and 0 deletions

View file

@ -1,5 +1,6 @@
package biomesoplenty.configuration;
import ted80.api.DefaultBiomeList;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeManager;
@ -88,6 +89,7 @@ import biomesoplenty.worldtype.WTBiomesOP;
import com.google.common.base.Optional;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
public class BOPBiomes {
@ -193,6 +195,12 @@ public class BOPBiomes {
//Initialize new world type
WTBiomesOP = new WTBiomesOP();
if (Loader.isModLoaded("BWG4"))
{
/* ==== biometypes: 4=hot, 3=wet, 2=norm, 1=cold, 0=tech, 5=island ==== */
//DefaultBiomeList.addBiome("Alps", Biomes.alps, 1);
}
//Spawning
addSpawnBiome(Biomes.alps);
addSpawnBiome(Biomes.arctic);

View file

@ -0,0 +1,79 @@
package ted80.api;
import java.util.ArrayList;
import net.minecraft.world.biome.BiomeGenBase;
public class DefaultBiomeList
{
public static ArrayList<BiomeGenBase> allowedBiomes = new ArrayList<BiomeGenBase>();
public static String[] biomeList = new String[256];
public static int[] biomeType = new int[256];
public static int generatorversion = 1;
public static void addBiome(String name, BiomeGenBase biome, int biometype)
{
allowedBiomes.add(biome);
for(int i = 0; i < biomeList.length; i++)
{
if(biomeList[i] == null)
{
biomeList[i] = name;
biomeType[i] = biometype;
break;
}
}
}
public static ArrayList<BiomeGenBase> getBiomeList()
{
return allowedBiomes;
}
public static int[] getTypesList()
{
return biomeType;
}
public static String[] getStringList()
{
String[] newbiomelist = new String[biomeList.length];
for(int i = 0; i < biomeList.length; i++)
{
if(biomeList[i] != null)
{
newbiomelist[i] = biomeList[i] + "=true";
}
else
{
break;
}
}
return newbiomelist;
}
public static String getDefaultString()
{
String genstring = generatorversion + "&";
for(int i = 0; i < biomeList.length; i++)
{
if(biomeList[i] != null)
{
if(i != 0)
{
genstring += ";" + biomeList[i] + "=true";
}
else
{
genstring += biomeList[i] + "=true";
}
}
else
{
break;
}
}
return genstring;
}
}