Fixed moss placement

This commit is contained in:
Matt Caughey 2014-04-01 04:08:22 -04:00
parent 27a026f155
commit b7b08d205e
15 changed files with 238 additions and 21 deletions

View File

@ -0,0 +1,69 @@
package biomesoplenty.common.biomes.overworld;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.biomes.BOPBiome;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.trees.WorldGenOriginalTree;
import net.minecraft.init.Blocks;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import java.util.Random;
public class BiomeGenCandyland extends BOPBiome
{
private static final Height biomeHeight = new Height(0.1F, 0.2F);
public BiomeGenCandyland(int id)
{
super(id);
//TODO: setHeight()
this.setHeight(biomeHeight);
//TODO: setColor()
this.setColor(10341485);
this.setTemperatureRainfall(0.7F, 0.8F);
this.topBlock = BOPBlockHelper.get("frostedCake");
this.fillerBlock = BOPBlockHelper.get("cakeBlock");
this.theBiomeDecorator.treesPerChunk = -999;
this.theBiomeDecorator.grassPerChunk = -999;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.theBiomeDecorator.clayPerChunk = -999;
this.theBiomeDecorator.flowersPerChunk = -999;
this.bopWorldFeatures.setFeature("rootsPerChunk", -999);
this.bopWorldFeatures.setFeature("stalagmitesPerChunk", -999);
this.bopWorldFeatures.setFeature("stalactitesPerChunk", -999);
this.bopWorldFeatures.setFeature("minersDelightPerChunk", -999);
//TODO: FEATURE this.theBiomeDecorator.generateUndergroundLakes = false;
this.bopWorldFeatures.setFeature("generatePumpkins", false);
}
@Override
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves3"), 0, 0, false, 5, 3, false);
}
@Override
public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_)
{
return 10682207;
}
@Override
public int getBiomeFoliageColor(int x, int y, int z)
{
return 3866368;
}
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors) return 8441086;
else return super.getSkyColorByTemp(par1);
}
}

View File

@ -18,7 +18,7 @@ import java.util.Random;
public class BiomeGenWetland extends BOPBiome
{
private static final Height biomeHeight = new Height(0.0F, 0.2F);
private static final Height biomeHeight = new Height(-0.1F, 0.2F);
public BiomeGenWetland(int id)
{
@ -35,7 +35,7 @@ public class BiomeGenWetland extends BOPBiome
this.waterColorMultiplier = 6512772;
this.theBiomeDecorator.treesPerChunk = 10;
this.theBiomeDecorator.treesPerChunk = 6;
this.theBiomeDecorator.grassPerChunk = 10;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.mushroomsPerChunk = 8;

View File

@ -14,7 +14,7 @@ public class BlockBOPGeneric extends Block
{
public enum BlockType
{
ASH_STONE, HARD_SAND, HARD_DIRT, HARD_ICE, DRIED_DIRT, CRAG_ROCK, MUD_BRICK, HOLY_DIRT, CRYSTAL;
ASH_STONE, HARD_SAND, HARD_DIRT, HARD_ICE, DRIED_DIRT, CRAG_ROCK, MUD_BRICK, HOLY_DIRT, CRYSTAL, CAKE;
}
private IIcon texture;
@ -102,6 +102,13 @@ public class BlockBOPGeneric extends Block
//TODO setStepSound(Block.soundGravelFootstep)
this.setStepSound(Block.soundTypeGlass);
break;
case CAKE:
//TODO: this.setHardness
this.setHardness(0.3F);
//TODO setStepSound(Block.soundGravelFootstep)
this.setStepSound(soundTypeSnow);
break;
default:
break;
@ -149,6 +156,10 @@ public class BlockBOPGeneric extends Block
case CRYSTAL:
texture = iconRegister.registerIcon("biomesoplenty:crystal");
break;
case CAKE:
texture = iconRegister.registerIcon("biomesoplenty:cakeblock_bottom");
break;
default:
break;

View File

@ -0,0 +1,73 @@
package biomesoplenty.common.blocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.api.BOPItemHelper;
public class BlockFrostedCake extends Block
{
private IIcon[] icons = new IIcon[6];
public BlockFrostedCake()
{
//TODO: Material.rock
super(Material.cake);
//TODO: this.setHardness
this.setHardness(0.3F);
//TODO setStepSound(Block.soundGrassFootstep)
this.setStepSound(Block.soundTypeSnow);
//TODO: setTickRandomly()
this.setTickRandomly(true);
//TODO: this.setCreativeTab()
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
//TODO: registerIcons()
public void registerBlockIcons(IIconRegister iconRegister)
{
this.icons[0] = iconRegister.registerIcon("biomesoplenty:cakeblock_bottom");
this.icons[1] = iconRegister.registerIcon("biomesoplenty:cakeblock_top");
this.icons[2] = iconRegister.registerIcon("biomesoplenty:cakeblock_side");
this.icons[3] = iconRegister.registerIcon("biomesoplenty:cakeblock_side");
this.icons[4] = iconRegister.registerIcon("biomesoplenty:cakeblock_side");
this.icons[5] = iconRegister.registerIcon("biomesoplenty:cakeblock_side");
}
@Override
//TODO: getIcon()
public IIcon getIcon(int side, int meta)
{
if (side < 0 || side >= this.icons.length) side = 1;
return this.icons[side];
}
@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plant)
{
return true;
}
@Override
//TODO: getItemDropped()
public Item getItemDropped(int metadata, Random random, int fortune)
{
return Item.getItemFromBlock(BOPBlockHelper.get("cakeBlock"));
}
}

View File

@ -1,19 +1,13 @@
package biomesoplenty.common.blocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockVine;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Direction;
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.IBlockAccess;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.BOPBlockHelper;
public class BlockMoss extends BlockVine
{
@ -47,15 +41,15 @@ public class BlockMoss extends BlockVine
switch (side)
{
case 1:
return (world.getBlock(x, y + 1, z) == Blocks.stone);
return ((OreDictionary.getOreID("logWood") == OreDictionary.getOreID(new ItemStack(world.getBlock(x, y + 1, z)))) || (world.getBlock(x, y + 1, z) == Blocks.stone));
case 2:
return (world.getBlock(x, y, z + 1) == Blocks.stone);
return ((OreDictionary.getOreID("logWood") == OreDictionary.getOreID(new ItemStack(world.getBlock(x, y, z + 1)))) || (world.getBlock(x, y, z + 1) == Blocks.stone));
case 3:
return (world.getBlock(x, y, z - 1) == Blocks.stone);
return ((OreDictionary.getOreID("logWood") == OreDictionary.getOreID(new ItemStack(world.getBlock(x, y, z - 1)))) || (world.getBlock(x, y, z - 1) == Blocks.stone));
case 4:
return (world.getBlock(x + 1, y, z) == Blocks.stone);
return ((OreDictionary.getOreID("logWood") == OreDictionary.getOreID(new ItemStack(world.getBlock(x + 1, y, z)))) || (world.getBlock(x + 1, y, z) == Blocks.stone));
case 5:
return (world.getBlock(x - 1, y, z) == Blocks.stone);
return ((OreDictionary.getOreID("logWood") == OreDictionary.getOreID(new ItemStack(world.getBlock(x - 1, y, z)))) || (world.getBlock(x - 1, y, z) == Blocks.stone));
default:
return false;
}

View File

@ -27,6 +27,7 @@ public class BOPConfigurationIDs
public static int bogID;
public static int borealForestID;
public static int brushlandID;
public static int candylandID;
public static int canyonID;
public static int canyonRavineID;
public static int chaparralID;
@ -158,6 +159,7 @@ public class BOPConfigurationIDs
//23-79 ExtraBiomesXL
candylandID = config.get("Biome IDs", "Candyland ID", 54).getInt();
mysticGroveThinID = config.get("Biome IDs", "Thinned Mystic Grove (Sub-Biome) ID", 55).getInt();
lavenderFieldsID = config.get("Biome IDs", "Lavender Fields ID", 56).getInt();
tropicsMountainID = config.get("Biome IDs", "Tropics Mountain (Sub-Biome) ID", 57).getInt();

View File

@ -65,6 +65,7 @@ public class BOPBiomes
registerBiome(new BOPBiomeEntry(new BiomeGenBog(BOPConfigurationIDs.bogID).setBiomeName("Bog"), TemperatureType.WARM, 50));
registerBiome(new BOPBiomeEntry(new BiomeGenBorealForest(BOPConfigurationIDs.borealForestID).setBiomeName("Boreal Forest"), TemperatureType.WARM, 50));
registerBiome(new BOPBiomeEntry(new BiomeGenBrushland(BOPConfigurationIDs.brushlandID).setBiomeName("Brushland"), TemperatureType.HOT, 50));
//registerBiome(new BOPBiomeEntry(new BiomeGenCandyland(BOPConfigurationIDs.candylandID).setBiomeName("Candyland"), TemperatureType.ICY, 100));
registerBiome(new BOPBiomeEntry(new BiomeGenCanyon(BOPConfigurationIDs.canyonID).setBiomeName("Canyon"), TemperatureType.HOT, 50));
registerBiome(new BOPBiomeEntry(new BiomeGenChaparral(BOPConfigurationIDs.chaparralID).setBiomeName("Chaparral"), TemperatureType.WARM, 50));
registerBiome(new BOPBiomeEntry(new BiomeGenCherryBlossomGrove(BOPConfigurationIDs.cherryBlossomGroveID).setBiomeName("Cherry Blossom Grove"), TemperatureType.COOL, 25));
@ -160,6 +161,7 @@ public class BOPBiomes
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("borealForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("brushland"), Type.DESERT, Type.FOREST, Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("candyland"), Type.MAGICAL);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("canyon"), Type.DESERT, Type.MOUNTAIN, Type.HILLS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("canyonRavine"), Type.DESERT, Type.HILLS);

View File

@ -39,6 +39,8 @@ public class BOPBlocks
registerBlock(new BlockBOPCoral().setBlockName("coral"), ItemBlockCoral.class);
registerBlock(new BlockWillow().setBlockName("willow"), ItemBlockWillow.class);
registerBlock(new BlockIvy().setBlockName("ivy"), ItemBlockIvy.class);
registerBlock(new BlockTreeMoss().setBlockName("treeMoss"));
registerBlock(new BlockFlowerVine().setBlockName("flowerVine"));
registerBlock(new BlockBOPLeaves(LeafCategory.CAT1).setBlockName("leaves1"), ItemBlockLeaves.class);
registerBlock(new BlockBOPLeaves(LeafCategory.CAT2).setBlockName("leaves2"), ItemBlockLeaves.class);
registerBlock(new BlockBOPLeaves(LeafCategory.CAT3).setBlockName("leaves3"), ItemBlockLeaves.class);
@ -52,6 +54,7 @@ public class BOPBlocks
registerBlock(new BlockBOPAppleLeaves().setBlockName("appleLeaves"), ItemBlockAppleLeaves.class);
registerBlock(new BlockBOPPersimmonLeaves().setBlockName("persimmonLeaves"), ItemBlockPersimmonLeaves.class);
registerBlock(new BlockMoss().setBlockName("moss"), ItemBlockMoss.class);
registerBlock(new BlockBamboo().setBlockName("bamboo"), ItemBlockBamboo.class);
registerBlock(new BlockBOPGeneric(Material.rock, BlockType.MUD_BRICK).setBlockName("mudBricks"));
@ -61,9 +64,6 @@ public class BOPBlocks
registerBlock(new BlockOvergrownNetherrack().setBlockName("overgrownNetherrack"));
registerBlock(new BlockBOPGrass().setBlockName("grass"));
registerBlock(new BlockTreeMoss().setBlockName("treeMoss"));
registerBlock(new BlockFlowerVine().setBlockName("flowerVine"));
registerBlock(new BlockBOPLog(LogCategory.CAT1).setBlockName("logs1"), ItemBlockLog.class);
registerBlock(new BlockBOPLog(LogCategory.CAT2).setBlockName("logs2"), ItemBlockLog.class);
registerBlock(new BlockBOPLog(LogCategory.CAT3).setBlockName("logs3"), ItemBlockLog.class);
@ -83,8 +83,6 @@ public class BOPBlocks
registerBlock(new BlockBOPGeneric(Material.glass, BlockType.CRYSTAL).setBlockName("crystal"));
registerBlock(new BlockBOPGems().setBlockName("gemOre"), ItemBlockGems.class);
registerBlock(new BlockMoss().setBlockName("moss"), ItemBlockMoss.class);
registerBlock(new BlockBOPGeneric(Material.rock, BlockType.CRAG_ROCK).setBlockName("cragRock"));
@ -92,6 +90,9 @@ public class BOPBlocks
registerBlock(new BlockHive().setBlockName("hive"), ItemBlockHive.class);
registerBlock(new BlockHoney().setBlockName("honeyBlock"));
registerBlock(new BlockBOPGeneric(Material.cake, BlockType.CAKE).setBlockName("cakeBlock"));
registerBlock(new BlockFrostedCake().setBlockName("frostedCake"));
registerBlock(new BlockBones().setBlockName("bones"), ItemBlockBones.class);
registerBlock(new BlockGrave().setBlockName("grave"), ItemBlockGrave.class);

View File

@ -0,0 +1,65 @@
package biomesoplenty.common.world.features;
import biomesoplenty.common.world.decoration.BOPDecorationManager;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.Random;
public class WorldGenBOPUndergroundDecoration extends WorldGeneratorBOP
{
private Block tallGrass;
private int tallGrassMetadata;
public WorldGenBOPUndergroundDecoration(Block p_i45466_1_, int p_i45466_2_)
{
this.tallGrass = p_i45466_1_;
this.tallGrassMetadata = p_i45466_2_;
}
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
Block block;
do
{
block = world.getBlock(x, y, z);
if (!(block.isLeaves(world, x, y, z) || block.isAir(world, x, y, z)))
{
break;
}
--y;
} while (y > 0);
for (int l = 0; l < 128; ++l)
{
int i1 = x + random.nextInt(8) - random.nextInt(8);
int j1 = y + random.nextInt(4) - random.nextInt(4);
int k1 = z + random.nextInt(8) - random.nextInt(8);
if (world.isAirBlock(i1, j1, k1) && this.tallGrass.canReplace(world, i1, j1, k1, 0, new ItemStack(this.tallGrass, 1, this.tallGrassMetadata)))
{
world.setBlock(i1, j1, k1, this.tallGrass, this.tallGrassMetadata, 2);
}
}
return true;
}
@Override
public void setupGeneration(World world, Random random, BiomeGenBase biome, String featureName, int x, int z)
{
for (int i = 0; i < (Integer)BOPDecorationManager.getBiomeFeatures(biome.biomeID).getFeature(featureName); i++)
{
int randX = x + random.nextInt(16) + 8;
int randZ = z + random.nextInt(16) + 8;
int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2);
this.generate(world, random, randX, randY, randZ);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 447 B