Readded custom village biomes, readied configurable village distance, readied custom biome village materials

This commit is contained in:
Adubbz 2014-01-16 00:02:38 +11:00
parent d55f6d3d76
commit cbc6fd568a
7 changed files with 1484 additions and 44 deletions

View file

@ -46,7 +46,7 @@ public class BOPConfigurationTerrainGen
public static boolean chaparralVillage; public static boolean chaparralVillage;
public static boolean cherryBlossomGroveVillage; public static boolean cherryBlossomGroveVillage;
public static boolean coniferousForestVillage; public static boolean coniferousForestVillage;
public static boolean coniferousForestSnowVillage; public static boolean snowyConiferousForest;
public static boolean cragVillage; public static boolean cragVillage;
public static boolean deadForestVillage; public static boolean deadForestVillage;
public static boolean deadForestSnowVillage; public static boolean deadForestSnowVillage;
@ -55,7 +55,7 @@ public class BOPConfigurationTerrainGen
public static boolean deciduousForestVillage; public static boolean deciduousForestVillage;
public static boolean dunesVillage; public static boolean dunesVillage;
public static boolean fenVillage; public static boolean fenVillage;
public static boolean fieldVillage; public static boolean flowerField;
public static boolean frostForestVillage; public static boolean frostForestVillage;
public static boolean fungiForestVillage; public static boolean fungiForestVillage;
public static boolean gardenVillage; public static boolean gardenVillage;
@ -163,7 +163,7 @@ public class BOPConfigurationTerrainGen
chaparralVillage = config.get("Allow Villages", "Chaparral", true).getBoolean(false); chaparralVillage = config.get("Allow Villages", "Chaparral", true).getBoolean(false);
cherryBlossomGroveVillage = config.get("Allow Villages", "CherryBlossomGrove", false).getBoolean(false); cherryBlossomGroveVillage = config.get("Allow Villages", "CherryBlossomGrove", false).getBoolean(false);
coniferousForestVillage = config.get("Allow Villages", "ConiferousForest", true).getBoolean(false); coniferousForestVillage = config.get("Allow Villages", "ConiferousForest", true).getBoolean(false);
coniferousForestSnowVillage = config.get("Allow Villages", "ConiferousForestSnow", true).getBoolean(false); snowyConiferousForest = config.get("Allow Villages", "SnowyConiferousForest", true).getBoolean(false);
//cragVillage = config.get("Allow Villages", "Crag", false).getBoolean(false); //cragVillage = config.get("Allow Villages", "Crag", false).getBoolean(false);
deadForestVillage = config.get("Allow Villages", "DeadForest", false).getBoolean(false); deadForestVillage = config.get("Allow Villages", "DeadForest", false).getBoolean(false);
deadForestSnowVillage = config.get("Allow Villages", "DeadForestSnow", false).getBoolean(false); deadForestSnowVillage = config.get("Allow Villages", "DeadForestSnow", false).getBoolean(false);
@ -172,7 +172,7 @@ public class BOPConfigurationTerrainGen
deciduousForestVillage = config.get("Allow Villages", "DeciduousForest", true).getBoolean(false); deciduousForestVillage = config.get("Allow Villages", "DeciduousForest", true).getBoolean(false);
dunesVillage = config.get("Allow Villages", "Dunes", false).getBoolean(false); dunesVillage = config.get("Allow Villages", "Dunes", false).getBoolean(false);
fenVillage = config.get("Allow Villages", "Fen", false).getBoolean(false); fenVillage = config.get("Allow Villages", "Fen", false).getBoolean(false);
fieldVillage = config.get("Allow Villages", "Field", true).getBoolean(false); flowerField = config.get("Allow Villages", "FlowerField", true).getBoolean(false);
frostForestVillage = config.get("Allow Villages", "FrostForest", true).getBoolean(false); frostForestVillage = config.get("Allow Villages", "FrostForest", true).getBoolean(false);
//fungiForestVillage = config.get("Allow Villages", "FungiForest", false).getBoolean(false); //fungiForestVillage = config.get("Allow Villages", "FungiForest", false).getBoolean(false);
//gardenVillage = config.get("Allow Villages", "Garden", false).getBoolean(false); //gardenVillage = config.get("Allow Villages", "Garden", false).getBoolean(false);

View file

@ -1,13 +1,12 @@
package biomesoplenty.common.core; package biomesoplenty.common.core;
import static biomesoplenty.api.BOPBiomeHelper.get;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.biome.WorldChunkManager;
import net.minecraftforge.common.BiomeManager; import net.minecraftforge.common.BiomeManager;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
import biomesoplenty.api.BOPBiomeHelper; import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.api.BOPBiomeHelper.BOPBiomeListEntry; import biomesoplenty.api.BOPBiomeHelper.BOPBiomeListEntry;
import biomesoplenty.api.BOPBiomeHelper.BOPBiomeTemperatureType; import biomesoplenty.api.BOPBiomeHelper.BOPBiomeTemperatureType;
@ -72,6 +71,7 @@ import biomesoplenty.common.biomes.BiomeGenWetland;
import biomesoplenty.common.biomes.BiomeGenWoodland; import biomesoplenty.common.biomes.BiomeGenWoodland;
import biomesoplenty.common.configuration.BOPConfigurationIDs; import biomesoplenty.common.configuration.BOPConfigurationIDs;
import biomesoplenty.common.configuration.BOPConfigurationMisc; import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.configuration.BOPConfigurationTerrainGen;
import biomesoplenty.common.world.WorldTypeBOP; import biomesoplenty.common.world.WorldTypeBOP;
public class BOPBiomes public class BOPBiomes
@ -85,6 +85,7 @@ public class BOPBiomes
registerBiomes(); registerBiomes();
useOnlyBiome(); useOnlyBiome();
addSpawnBiomes(); addSpawnBiomes();
addVillageBiomes();
} }
private static void registerBiomes() private static void registerBiomes()
@ -195,6 +196,78 @@ public class BOPBiomes
} }
} }
private static void addVillageBiomes()
{
addVillageBiome(BOPBiomeHelper.get("alps"), BOPConfigurationTerrainGen.alpsVillage);
addVillageBiome(BOPBiomeHelper.get("arctic"), BOPConfigurationTerrainGen.arcticVillage);
//addVillageBiome(BOPBiomeHelper.get("autumnHills"), BOPConfigurationTerrainGen.autumnHillsVillage);
//addVillageBiome(BOPBiomeHelper.get("badlands"), BOPConfigurationTerrainGen.badlandsVillage);
addVillageBiome(BOPBiomeHelper.get("bambooForest"), BOPConfigurationTerrainGen.bambooForestVillage);
addVillageBiome(BOPBiomeHelper.get("bayou"), BOPConfigurationTerrainGen.bayouVillage);
addVillageBiome(BOPBiomeHelper.get("bog"), BOPConfigurationTerrainGen.bogVillage);
addVillageBiome(BOPBiomeHelper.get("borealForest"), BOPConfigurationTerrainGen.borealForestVillage);
addVillageBiome(BOPBiomeHelper.get("brushland"), BOPConfigurationTerrainGen.brushlandVillage);
addVillageBiome(BOPBiomeHelper.get("canyon"), BOPConfigurationTerrainGen.canyonVillage);
addVillageBiome(BOPBiomeHelper.get("chaparral"), BOPConfigurationTerrainGen.chaparralVillage);
addVillageBiome(BOPBiomeHelper.get("cherryBlossomGrove"), BOPConfigurationTerrainGen.cherryBlossomGroveVillage);
addVillageBiome(BOPBiomeHelper.get("coniferousForest"), BOPConfigurationTerrainGen.coniferousForestVillage);
addVillageBiome(BOPBiomeHelper.get("snowyConiferousForest"), BOPConfigurationTerrainGen.snowyConiferousForest);
addVillageBiome(BOPBiomeHelper.get("deadForest"), BOPConfigurationTerrainGen.deadForestVillage);
//addVillageBiome(BOPBiomeHelper.get("deadForestSnow"), BOPConfigurationTerrainGen.deadForestSnowVillage);
addVillageBiome(BOPBiomeHelper.get("deadSwamp"), BOPConfigurationTerrainGen.deadSwampVillage);
addVillageBiome(BOPBiomeHelper.get("deciduousForest"), BOPConfigurationTerrainGen.deciduousForestVillage);
addVillageBiome(BOPBiomeHelper.get("dunes"), BOPConfigurationTerrainGen.dunesVillage);
addVillageBiome(BOPBiomeHelper.get("fen"), BOPConfigurationTerrainGen.fenVillage);
addVillageBiome(BOPBiomeHelper.get("flowerField"), BOPConfigurationTerrainGen.flowerField);
addVillageBiome(BOPBiomeHelper.get("frostForest"), BOPConfigurationTerrainGen.frostForestVillage);
//addVillageBiome(BOPBiomeHelper.get("glacier"), BOPConfigurationTerrainGen.glacierVillage);
addVillageBiome(BOPBiomeHelper.get("grassland"), BOPConfigurationTerrainGen.grasslandVillage);
addVillageBiome(BOPBiomeHelper.get("grove"), BOPConfigurationTerrainGen.groveVillage);
addVillageBiome(BOPBiomeHelper.get("heathland"), BOPConfigurationTerrainGen.heathlandVillage);
addVillageBiome(BOPBiomeHelper.get("highland"), BOPConfigurationTerrainGen.highlandVillage);
//addVillageBiome(BOPBiomeHelper.get("hotSprings"), BOPConfigurationTerrainGen.hotSpringsVillage);
addVillageBiome(BOPBiomeHelper.get("jadeCliffs"), BOPConfigurationTerrainGen.jadeCliffsVillage);
addVillageBiome(BOPBiomeHelper.get("lushDesert"), BOPConfigurationTerrainGen.lushDesertVillage);
addVillageBiome(BOPBiomeHelper.get("lushSwamp"), BOPConfigurationTerrainGen.lushSwampVillage);
//addVillageBiome(BOPBiomeHelper.get("mangrove"), BOPConfigurationTerrainGen.mangroveVillage);
addVillageBiome(BOPBiomeHelper.get("mapleWoods"), BOPConfigurationTerrainGen.mapleWoodsVillage);
addVillageBiome(BOPBiomeHelper.get("marsh"), BOPConfigurationTerrainGen.marshVillage);
addVillageBiome(BOPBiomeHelper.get("meadow"), BOPConfigurationTerrainGen.meadowVillage);
//addVillageBiome(BOPBiomeHelper.get("meadowForest"), BOPConfigurationTerrainGen.meadowVillage);
//addVillageBiome(BOPBiomeHelper.get("mesa"), BOPConfigurationTerrainGen.mesaVillage);
addVillageBiome(BOPBiomeHelper.get("moor"), BOPConfigurationTerrainGen.moorVillage);
addVillageBiome(BOPBiomeHelper.get("mountain"), BOPConfigurationTerrainGen.mountainVillage);
//addVillageBiome(BOPBiomeHelper.get("oasis"), BOPConfigurationTerrainGen.oasisVillage);
//addVillageBiome(BOPBiomeHelper.get("orchard"), BOPConfigurationTerrainGen.orchardVillage);
addVillageBiome(BOPBiomeHelper.get("outback"), BOPConfigurationTerrainGen.outbackVillage);
//addVillageBiome(BOPBiomeHelper.get("overgrownGreens"), BOPConfigurationTerrainGen.overgrownGreensVillage);
addVillageBiome(BOPBiomeHelper.get("pasture"), BOPConfigurationTerrainGen.pastureVillage);
//addVillageBiome(BOPBiomeHelper.get("polar"), BOPConfigurationTerrainGen.polarVillage);
addVillageBiome(BOPBiomeHelper.get("prairie"), BOPConfigurationTerrainGen.prairieVillage);
addVillageBiome(BOPBiomeHelper.get("quagmire"), BOPConfigurationTerrainGen.quagmireVillage);
addVillageBiome(BOPBiomeHelper.get("rainforest"), BOPConfigurationTerrainGen.rainforestVillage);
addVillageBiome(BOPBiomeHelper.get("redwoodForest"), BOPConfigurationTerrainGen.redwoodForestVillage);
addVillageBiome(BOPBiomeHelper.get("seasonalForest"), BOPConfigurationTerrainGen.seasonalForestVillage);
addVillageBiome(BOPBiomeHelper.get("shield"), BOPConfigurationTerrainGen.shieldVillage);
//addVillageBiome(BOPBiomeHelper.get("scrubland"), BOPConfigurationTerrainGen.scrublandVillage);
addVillageBiome(BOPBiomeHelper.get("shrubland"), BOPConfigurationTerrainGen.shrublandVillage);
addVillageBiome(BOPBiomeHelper.get("sludgepit"), BOPConfigurationTerrainGen.sludgepitVillage);
addVillageBiome(BOPBiomeHelper.get("spruceWoods"), BOPConfigurationTerrainGen.spruceWoodsVillage);
//addVillageBiome(BOPBiomeHelper.get("steppe"), BOPConfigurationTerrainGen.steppeVillage);
addVillageBiome(BOPBiomeHelper.get("temperateRainforest"), BOPConfigurationTerrainGen.temperateRainforestVillage);
addVillageBiome(BOPBiomeHelper.get("thicket"), BOPConfigurationTerrainGen.thicketVillage);
addVillageBiome(BOPBiomeHelper.get("timber"), BOPConfigurationTerrainGen.timberVillage);
addVillageBiome(BOPBiomeHelper.get("tropicalRainforest"), BOPConfigurationTerrainGen.tropicalRainforestVillage);
addVillageBiome(BOPBiomeHelper.get("tropics"), BOPConfigurationTerrainGen.tropicsVillage);
addVillageBiome(BOPBiomeHelper.get("tundra"), BOPConfigurationTerrainGen.tundraVillage);
addVillageBiome(BOPBiomeHelper.get("volcano"), BOPConfigurationTerrainGen.volcanoVillage);
addVillageBiome(BOPBiomeHelper.get("wetland"), BOPConfigurationTerrainGen.wetlandVillage);
addVillageBiome(BOPBiomeHelper.get("woodland"), BOPConfigurationTerrainGen.woodlandVillage);
}
public static void registerOnlyBiome(BOPBiomeListEntry biome) public static void registerOnlyBiome(BOPBiomeListEntry biome)
{ {
onlyBiome = biome.biome; onlyBiome = biome.biome;
@ -216,6 +289,11 @@ public class BOPBiomes
BiomeManager.addSpawnBiome(biome); BiomeManager.addSpawnBiome(biome);
} }
private static void addVillageBiome(BiomeGenBase biome, boolean flag)
{
if (biome != null && flag) BiomeManager.addVillageBiome(biome, true);
}
public static void clearAllSpawnBiomes() public static void clearAllSpawnBiomes()
{ {
WorldChunkManager.allowedBiomes.clear(); WorldChunkManager.allowedBiomes.clear();

View file

@ -12,6 +12,8 @@ import biomesoplenty.common.eventhandler.potions.PotionParalysisEventHandler;
import biomesoplenty.common.eventhandler.potions.PotionPossessionEventHandler; import biomesoplenty.common.eventhandler.potions.PotionPossessionEventHandler;
import biomesoplenty.common.eventhandler.world.DecorateBiomeEventHandler; import biomesoplenty.common.eventhandler.world.DecorateBiomeEventHandler;
import biomesoplenty.common.eventhandler.world.DecorationModificationEventHandler; import biomesoplenty.common.eventhandler.world.DecorationModificationEventHandler;
import biomesoplenty.common.eventhandler.world.MapGenEventHandler;
import biomesoplenty.common.eventhandler.world.VillageMaterialEventHandler;
public class BOPEventHandlers public class BOPEventHandlers
{ {
@ -28,6 +30,8 @@ public class BOPEventHandlers
{ {
MinecraftForge.EVENT_BUS.register(new DecorateBiomeEventHandler()); MinecraftForge.EVENT_BUS.register(new DecorateBiomeEventHandler());
MinecraftForge.TERRAIN_GEN_BUS.register(new DecorationModificationEventHandler()); MinecraftForge.TERRAIN_GEN_BUS.register(new DecorationModificationEventHandler());
MinecraftForge.TERRAIN_GEN_BUS.register(new VillageMaterialEventHandler());
MinecraftForge.TERRAIN_GEN_BUS.register(new MapGenEventHandler());
} }
private static void registerEntityEventHandlers() private static void registerEntityEventHandlers()

View file

@ -0,0 +1,16 @@
package biomesoplenty.common.eventhandler.world;
import net.minecraft.world.gen.structure.MapGenVillage;
import biomesoplenty.common.configuration.BOPConfigurationTerrainGen;
import cpw.mods.fml.relauncher.ReflectionHelper;
public class BOPMapGenVillage extends MapGenVillage
{
public BOPMapGenVillage()
{
super();
ReflectionHelper.setPrivateValue(MapGenVillage.class, this, BOPConfigurationTerrainGen.villageDistance, "field_82665_g");
ReflectionHelper.setPrivateValue(MapGenVillage.class, this, BOPConfigurationTerrainGen.villageDistance / 4, "field_82666_h");
}
}

View file

@ -1,35 +0,0 @@
package biomesoplenty.common.eventhandler.world;
import net.minecraft.world.biome.BiomeDecorator;
import net.minecraftforge.event.terraingen.BiomeEvent.CreateDecorator;
import biomesoplenty.common.world.decoration.BOPBiomeDecorator;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class DecoratorHijackEventHandler
{
@SubscribeEvent
public void onDecoratorReplace(CreateDecorator event)
{
//if (BOPBiomeHelper.biomeList.containsValue(event.biome))
//{
BiomeDecorator originalBiomeDecorator = event.originalBiomeDecorator;
BOPBiomeDecorator newBiomeDecorator = new BOPBiomeDecorator();
newBiomeDecorator.bigMushroomsPerChunk = originalBiomeDecorator.bigMushroomsPerChunk;
newBiomeDecorator.cactiPerChunk = originalBiomeDecorator.cactiPerChunk;
newBiomeDecorator.clayPerChunk = originalBiomeDecorator.clayPerChunk;
newBiomeDecorator.deadBushPerChunk = originalBiomeDecorator.deadBushPerChunk;
newBiomeDecorator.flowersPerChunk = originalBiomeDecorator.flowersPerChunk;
newBiomeDecorator.generateLakes = originalBiomeDecorator.generateLakes;
newBiomeDecorator.grassPerChunk = originalBiomeDecorator.grassPerChunk;
newBiomeDecorator.mushroomsPerChunk = originalBiomeDecorator.mushroomsPerChunk;
newBiomeDecorator.reedsPerChunk = originalBiomeDecorator.reedsPerChunk;
newBiomeDecorator.sandPerChunk = originalBiomeDecorator.sandPerChunk;
newBiomeDecorator.sandPerChunk2 = originalBiomeDecorator.sandPerChunk2;
newBiomeDecorator.treesPerChunk = originalBiomeDecorator.treesPerChunk;
newBiomeDecorator.waterlilyPerChunk = originalBiomeDecorator.waterlilyPerChunk;
event.newBiomeDecorator = newBiomeDecorator;
//}
}
}

View file

@ -0,0 +1,17 @@
package biomesoplenty.common.eventhandler.world;
import net.minecraftforge.event.terraingen.InitMapGenEvent;
import net.minecraftforge.event.terraingen.InitMapGenEvent.EventType;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class MapGenEventHandler
{
@SubscribeEvent
public void onMapGenInit(InitMapGenEvent event)
{
if (event.type == EventType.VILLAGE)
{
event.newGen = new BOPMapGenVillage();
}
}
}