Skip to content

Commit

Permalink
Flower generation, fixed some name errors, corrected soulsand valley …
Browse files Browse the repository at this point in the history
…pitch for certain sounds

Also tweaked granite/diorite/andesite gen slightly to be a little more efficient
  • Loading branch information
Roadhog360 committed Jan 26, 2021
1 parent e6af2a2 commit 0113432
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 15 deletions.
15 changes: 15 additions & 0 deletions src/main/java/ganymedes01/etfuturum/blocks/BlockWitherRose.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package ganymedes01.etfuturum.blocks;

import static net.minecraftforge.common.EnumPlantType.Cave;
import static net.minecraftforge.common.EnumPlantType.Crop;
import static net.minecraftforge.common.EnumPlantType.Desert;
import static net.minecraftforge.common.EnumPlantType.Nether;
import static net.minecraftforge.common.EnumPlantType.Plains;
import static net.minecraftforge.common.EnumPlantType.Water;

import java.util.Random;

import cpw.mods.fml.relauncher.Side;
Expand All @@ -15,7 +22,9 @@
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;

public class BlockWitherRose extends BlockFlowerBase implements IConfigurable {

Expand Down Expand Up @@ -49,4 +58,10 @@ public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3
public boolean isEnabled() {
return ConfigurationHandler.enableNewFlowers;
}

@Override
public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
{
return Nether;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ public NetherAmbience(String string, float theVolume, float thePitch) {
if(string.equals(Reference.MOD_ID + ":ambient.warped_forest.additions.w3_p0.8") || (string.equals(Reference.MOD_ID + ":ambient.crimson_forest.additions.w4") && new Random().nextInt(2) == 0)) {
field_147663_c = 0.8F;
} else
if(string.equals(Reference.MOD_ID + ":ambient.warped_forest.additions.w3_p0.7") || ((string.equals(Reference.MOD_ID + ":ambient.warped_forest.additions.w2") || string.equals(Reference.MOD_ID + ":ambient.warped_forest.additions.w2")) && new Random().nextInt(2) == 0)) {
if(string.equals(Reference.MOD_ID + ":ambient.warped_forest.additions.w3_p0.7") ||
string.equals(Reference.MOD_ID + ":ambient.soul_sand_valley.additions.w5_p0.7") ||
((string.equals(Reference.MOD_ID + ":ambient.warped_forest.additions.w2") ||
string.equals(Reference.MOD_ID + ":ambient.warped_forest.additions.w2")) && new Random().nextInt(2) == 0)) {
field_147663_c = 0.7F;
} else
if(string.equals(Reference.MOD_ID + ":ambient.soul_sand_valley.additions.w25_p0.75")) {
field_147663_c = 0.75F;
} else
if(string.equals(Reference.MOD_ID + ":ambient.warped_forest.additions.w3_p0.1")) {
field_147663_c = 0.1F;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private WeightedSoundPool getAmbienceForBiome() {
String string = ambience.getPositionedSoundLocation().getResourcePath().split("\\.")[1];
if(string.equals("null"))
return null;

if(string.equals("basalt_deltas")) {
return basaltDeltas;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package ganymedes01.etfuturum.world;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;

import org.apache.commons.lang3.ArrayUtils;

import cpw.mods.fml.common.IWorldGenerator;
import ganymedes01.etfuturum.EtFuturum;
import ganymedes01.etfuturum.ModBlocks;
import ganymedes01.etfuturum.blocks.ChorusFlower;
import ganymedes01.etfuturum.configuration.ConfigurationHandler;
Expand All @@ -15,10 +17,12 @@
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenPlains;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenFlowers;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;
import net.minecraftforge.common.util.ForgeDirection;

public class EtFuturumWorldGenerator implements IWorldGenerator {
Expand All @@ -33,16 +37,20 @@ public EtFuturumWorldGenerator() {

@Override
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
if (ConfigurationHandler.enableCoarseDirt && world.provider.dimensionId != -1 && world.provider.dimensionId != 1)
for (int x = chunkX * 16; x < chunkX * 16 + 16; x++)
for (int z = chunkZ * 16; z < chunkZ * 16 + 16; z++)
for (int y = 0; y < world.getActualHeight(); y++)
if (ConfigurationHandler.enableCoarseDirt && world.provider.dimensionId != -1 && world.provider.dimensionId != 1) {
//TODO Add checks so it doesn't run this code in biomes that don't generate coarse dirt
for (int x = chunkX * 16; x < chunkX * 16 + 16; x++) {
for (int z = chunkZ * 16; z < chunkZ * 16 + 16; z++) {
for (int y = 0; y < world.getActualHeight(); y++) {
if (world.getBlock(x, y, z) == Blocks.dirt && world.getBlockMetadata(x, y, z) == 1)
world.setBlock(x, y, z, ModBlocks.coarse_dirt, 0, 2);
}
}
}
}

if (ConfigurationHandler.enableStones && ConfigurationHandler.maxStonesPerCluster > 0 && world.provider.dimensionId != -1 && world.provider.dimensionId != 1)
for (Iterator<WorldGenMinable> iterator = generators.iterator(); iterator.hasNext();) {
WorldGenMinable generator = iterator.next();
for (WorldGenMinable generator : generators) {
for (int i = 0; i < 10; i++) {
int x = chunkX * 16 + rand.nextInt(16);
int y = rand.nextInt(80);
Expand All @@ -52,6 +60,20 @@ public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkPro
}
}

// Flowers TODO Bone meal
if(world.provider.dimensionId == 0) {
int x = chunkX * 16 + world.rand.nextInt(16);
int z = chunkZ * 16 + world.rand.nextInt(16);
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
Type[] biomeList = BiomeDictionary.getTypesForBiome(biome);
if(ArrayUtils.contains(biomeList, Type.FOREST) && !ArrayUtils.contains(biomeList, Type.SNOWY)) {
new WorldGenFlowers(ModBlocks.lily_of_the_valley).generate(world, world.rand, x, world.rand.nextInt(world.getHeightValue(x, z) + 32), z);
}
if(biome.biomeID == 132 || (ArrayUtils.contains(biomeList, Type.PLAINS) && !ArrayUtils.contains(biomeList, Type.SNOWY) && !ArrayUtils.contains(biomeList, Type.SAVANNA))) {
new WorldGenFlowers(ModBlocks.cornflower).generate(world, world.rand, x, world.rand.nextInt(world.getHeightValue(x, z) + 32), z);
}
}

if(world.provider.dimensionId == -1) {
if(ConfigurationHandler.enableMagmaBlock)
this.generateOre(ModBlocks.magma_block, 0, world, rand, chunkX, chunkZ, 1, ConfigurationHandler.maxMagmaPerCluster, 4, 23, 37, Blocks.netherrack);
Expand Down
13 changes: 7 additions & 6 deletions src/main/resources/assets/etfuturum/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ tipped_arrow.potion.weakness.name=Arrow of Weakness


Blocks
tile.etfuturum.granite.name=Granite
tile.etfuturum.granite_smooth.name=Polished Granite
tile.etfuturum.diorite.name=Diorite
tile.etfuturum.diorite_smooth.name=Polished Diorite
tile.etfuturum.andesite.name=Andesite
tile.etfuturum.andesite_smooth.name=Polished Andesite
tile.etfuturum.stone_granite.name=Granite
tile.etfuturum.stone_granite_smooth.name=Polished Granite
tile.etfuturum.stone_diorite.name=Diorite
tile.etfuturum.stone_diorite_smooth.name=Polished Diorite
tile.etfuturum.stone_andesite.name=Andesite
tile.etfuturum.stone_andesite_smooth.name=Polished Andesite
tile.etfuturum.granite_slab.name=Granite Slab
tile.etfuturum.polished_granite_slab.name=Polished Granite Slab
tile.etfuturum.diorite_slab.name=Diorite Slab
Expand Down Expand Up @@ -189,6 +189,7 @@ tile.etfuturum.smooth_red_sandstone_slab.name=Smooth Red Sandstone Slab
tile.etfuturum.smooth_sandstone_stairs.name=Smooth Sandstone Stairs
tile.etfuturum.smooth_red_sandstone_stairs.name=Smooth Red Sandstone Stairs
tile.etfuturum.smooth_quartz.name=Smooth Quartz
tile.etfuturum.smooth_quartz_slab.name=Smooth Quartz Slab
tile.etfuturum.smooth_quartz_stairs.name=Smooth Quartz Stairs
tile.etfuturum.quartz_bricks.name=Quartz Bricks
tile.etfuturum.stone_slab.name=Stone Slab
Expand Down

0 comments on commit 0113432

Please sign in to comment.