Added for configs for biomes and bushes

This commit is contained in:
oitsjustjose 2013-06-30 17:05:29 -05:00
commit 0345cb11c4
5 changed files with 59 additions and 40 deletions

View file

@ -1,6 +1,7 @@
package MysticWorld.Biome;
import cpw.mods.fml.common.registry.GameRegistry;
import MysticWorld.Lib.*;
import MysticOres.Blocks.BlockHandler;
import net.minecraft.block.Block;
import net.minecraft.world.biome.BiomeDecorator;
@ -19,8 +20,6 @@ public class BiomeHandler
{
initializeBiomes();
registerBiomes();
addSpawnBiomes();
addStructureBiomes();
}
public static void initializeBiomes()
@ -34,30 +33,36 @@ public class BiomeHandler
public static void registerBiomes()
{
GameRegistry.removeBiome(BiomeGenBase.jungle);
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
GameRegistry.addBiome(Mountain);
GameRegistry.addBiome(Tundra);
GameRegistry.addBiome(Steppe);
GameRegistry.addBiome(Glacier);
GameRegistry.addBiome(Jungle);
}
public static void addSpawnBiomes()
{
BiomeManager.addSpawnBiome(Steppe);
BiomeManager.addSpawnBiome(Mountain);
BiomeManager.addSpawnBiome(Jungle);
}
public static void addStructureBiomes()
{
BiomeManager.addVillageBiome(Steppe, true);
BiomeManager.addStrongholdBiome(Glacier);
BiomeManager.addStrongholdBiome(Mountain);
BiomeManager.addStrongholdBiome(Steppe);
BiomeManager.addStrongholdBiome(Tundra);
BiomeManager.addStrongholdBiome(Jungle);
if(Booleans.ENABLE_JUNGLE_REWRITE)
{
GameRegistry.removeBiome(BiomeGenBase.jungle);
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
GameRegistry.addBiome(Jungle);
BiomeManager.addSpawnBiome(Jungle);
BiomeManager.addStrongholdBiome(Jungle);
}
if(Booleans.ENABLE_GLACIER_GEN)
{
GameRegistry.addBiome(Glacier);
BiomeManager.addStrongholdBiome(Glacier);
}
if(Booleans.ENABLE_MOUNTAIN_GEN)
{
GameRegistry.addBiome(Mountain);
BiomeManager.addSpawnBiome(Mountain);
BiomeManager.addStrongholdBiome(Mountain);
}
if(Booleans.ENABLE_TUNDRA_GEN)
{
GameRegistry.addBiome(Tundra);
BiomeManager.addStrongholdBiome(Tundra);
}
if(Booleans.ENABLE_STEPPE_GEN)
{
GameRegistry.addBiome(Steppe);
BiomeManager.addSpawnBiome(Steppe);
BiomeManager.addVillageBiome(Steppe, true);
BiomeManager.addStrongholdBiome(Steppe);
}
}
}

View file

@ -1,6 +1,7 @@
package MysticWorld.Blocks;
import MysticWorld.Lib.BlockIds;
import MysticWorld.Lib.Booleans;
import MysticWorld.Lib.Strings;
import MysticWorld.WorldGen.StonesGen;
import MysticWorld.WorldGen.WorldGenBushes;
@ -34,7 +35,10 @@ public class BlockHandler {
GameRegistry.registerBlock(bush, ItemBlockBush.class, Strings.BUSH_NAME);
GameRegistry.registerBlock(lightCube, Strings.LIGHT_CUBE_NAME);
GameRegistry.registerWorldGenerator(new WorldGenBushes());
if(Booleans.ENABLE_BUSH_GEN)
{
GameRegistry.registerWorldGenerator(new WorldGenBushes());
}
GameRegistry.registerWorldGenerator(new WorldGenStones());
}

View file

@ -6,25 +6,33 @@ import MysticWorld.Lib.BlockIds;
import MysticWorld.Lib.EntityIds;
import MysticWorld.Lib.ItemIds;
import MysticWorld.Lib.Strings;
import MysticWorld.Lib.Booleans;
import net.minecraftforge.common.Configuration;
public class Config
{
public static Configuration config;
public static void initialize(File file)
{
config = new Configuration(file);
//Boolean Configurations
Booleans.ENABLE_BUSH_GEN = config.get("World Generation", "Enable Bush Generation", true).getBoolean(Booleans.ENABLE_BUSH_GEN);
Booleans.ENABLE_GLACIER_GEN = config.get("World Generation", "Enable Glacier Biome", true).getBoolean(Booleans.ENABLE_GLACIER_GEN);
Booleans.ENABLE_JUNGLE_REWRITE = config.get("World Generation", "Enable Vanilla Jungle Biome Modification", true).getBoolean(Booleans.ENABLE_JUNGLE_REWRITE);
Booleans.ENABLE_MOUNTAIN_GEN = config.get("World Generation", "Enable Mountain Biome", true).getBoolean(Booleans.ENABLE_MOUNTAIN_GEN);
Booleans.ENABLE_STEPPE_GEN = config.get("World Generation", "Enable Steppe Biome", true).getBoolean(Booleans.ENABLE_STEPPE_GEN);
Booleans.ENABLE_TUNDRA_GEN = config.get("World Generation", "Enable Tundra Biome", true).getBoolean(Booleans.ENABLE_TUNDRA_GEN);
//Block Configuration
BlockIds.ORE_STONE_1 = config.getBlock(Strings.IMBUED_STONE_NAME, BlockIds.ORE_STONE_1_DEFAULT).getInt(BlockIds.ORE_STONE_1);
BlockIds.BUSH = config.getBlock(Strings.BUSH_NAME, BlockIds.BUSH_DEFAULT).getInt(BlockIds.BUSH_DEFAULT);
BlockIds.LIGHT_CUBE = config.getBlock(Strings.LIGHT_CUBE_NAME, BlockIds.LIGHT_CUBE_DEFAULT).getInt(BlockIds.LIGHT_CUBE_DEFAULT);
//Item Configuration
ItemIds.IMBUED_SHARD = config.getItem(Strings.IMBUED_SHARD_NAME, ItemIds.IMBUED_SHARD_DEFAULT).getInt(ItemIds.IMBUED_SHARD_DEFAULT);
ItemIds.STAFF_PARTS = config.getItem(Strings.STAFF_NAME, ItemIds.STAFF_PARTS_DEFAULT).getInt(ItemIds.STAFF_PARTS_DEFAULT);
ItemIds.FIRE_STAFF = config.getItem(Strings.FIRE_STAFF_NAME, ItemIds.FIRE_STAFF_DEFAULT).getInt(ItemIds.FIRE_STAFF_DEFAULT);

View file

@ -0,0 +1,11 @@
package MysticWorld.Lib;
public class Booleans
{
public static boolean ENABLE_BUSH_GEN;
public static boolean ENABLE_GLACIER_GEN;
public static boolean ENABLE_JUNGLE_REWRITE;
public static boolean ENABLE_MOUNTAIN_GEN;
public static boolean ENABLE_TUNDRA_GEN;
public static boolean ENABLE_STEPPE_GEN;
}

View file

@ -83,13 +83,4 @@ public class MysticWorld
public void postInit(FMLPostInitializationEvent event)
{
}
@ServerStarted
public void startedInit(FMLServerStartedEvent event, EntityPlayer player)
{
if (player.username.equals("oitsjustjose") || !player.username.equals("oitsjustjose"))
{
player.addChatMessage("Welcome " + player.username + " to your world!");
}
}
}