From f1fabb9da2e69f43591eb7f0c074891efb38df13 Mon Sep 17 00:00:00 2001 From: ted80-PC Date: Sat, 20 Apr 2013 13:55:39 +0200 Subject: [PATCH] tried adding bwg4 api but it doesn't work :( --- .../configuration/BOPBiomes.java | 8 ++ src/minecraft/ted80/api/DefaultBiomeList.java | 79 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 src/minecraft/ted80/api/DefaultBiomeList.java diff --git a/src/minecraft/biomesoplenty/configuration/BOPBiomes.java b/src/minecraft/biomesoplenty/configuration/BOPBiomes.java index 8b0798a48..9cac8b135 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPBiomes.java +++ b/src/minecraft/biomesoplenty/configuration/BOPBiomes.java @@ -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 { @@ -192,6 +194,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); diff --git a/src/minecraft/ted80/api/DefaultBiomeList.java b/src/minecraft/ted80/api/DefaultBiomeList.java new file mode 100644 index 000000000..1a6d85237 --- /dev/null +++ b/src/minecraft/ted80/api/DefaultBiomeList.java @@ -0,0 +1,79 @@ +package ted80.api; + +import java.util.ArrayList; +import net.minecraft.world.biome.BiomeGenBase; + +public class DefaultBiomeList +{ + public static ArrayList allowedBiomes = new ArrayList(); + 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 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; + } +}