Tweaked some biome decoration things

This commit is contained in:
Matt Caughey 2014-04-01 06:37:59 -04:00
parent ada18c601d
commit e96a1fc698
11 changed files with 339 additions and 53 deletions

View File

@ -1,18 +1,16 @@
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;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.biomes.BOPBiome;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.WorldGenCookie;
public class BiomeGenCandyland extends BOPBiome
{
private static final Height biomeHeight = new Height(0.1F, 0.2F);
private static final Height biomeHeight = new Height(0.2F, 0.2F);
public BiomeGenCandyland(int id)
{
@ -23,6 +21,11 @@ public class BiomeGenCandyland extends BOPBiome
//TODO: setColor()
this.setColor(10341485);
this.setTemperatureRainfall(0.7F, 0.8F);
this.waterColorMultiplier = 11485208;
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
this.topBlock = BOPBlockHelper.get("frostedCake");
this.fillerBlock = BOPBlockHelper.get("cakeBlock");
@ -30,6 +33,8 @@ public class BiomeGenCandyland extends BOPBiome
this.theBiomeDecorator.grassPerChunk = -999;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.theBiomeDecorator.reedsPerChunk = -999;
this.theBiomeDecorator.generateLakes = false;
this.theBiomeDecorator.clayPerChunk = -999;
this.theBiomeDecorator.flowersPerChunk = -999;
@ -37,33 +42,27 @@ public class BiomeGenCandyland extends BOPBiome
this.bopWorldFeatures.setFeature("stalagmitesPerChunk", -999);
this.bopWorldFeatures.setFeature("stalactitesPerChunk", -999);
this.bopWorldFeatures.setFeature("minersDelightPerChunk", -999);
this.bopWorldFeatures.setFeature("cookiesPerChunk", 4);
//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;
return 16760265;
}
@Override
public int getBiomeFoliageColor(int x, int y, int z)
{
return 3866368;
return 16760265;
}
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors) return 8441086;
if (BOPConfigurationMisc.skyColors) return 16760265;
else return super.getSkyColorByTemp(par1);
}
}

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, CAKE;
ASH_STONE, HARD_SAND, HARD_DIRT, HARD_ICE, DRIED_DIRT, CRAG_ROCK, MUD_BRICK, HOLY_DIRT, CRYSTAL;
}
private IIcon texture;
@ -102,13 +102,6 @@ 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;
@ -156,10 +149,6 @@ 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,124 @@
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.Items;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.WorldTypeBOPA;
public class BlockCandy extends Block
{
public enum BlockTypeCandy
{
CAKE, COOKIE, WAFER;
}
private IIcon texture;
private BlockTypeCandy type;
public BlockCandy(Material material, BlockTypeCandy type)
{
super(material);
this.type = type;
//TODO: this.setCreativeTab()
if (!BOPConfigurationMisc.behaveNormally)
{
if(WorldTypeBOPA.isTime())
{
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
}
switch (type)
{
case CAKE:
this.setHardness(0.3F);
this.setStepSound(soundTypeSnow);
break;
case COOKIE:
this.setHardness(0.8F);
this.setStepSound(soundTypeGravel);
break;
default:
break;
}
}
@Override
//TODO: registerIcons()
public void registerBlockIcons(IIconRegister iconRegister)
{
switch (type)
{
case CAKE:
texture = iconRegister.registerIcon("biomesoplenty:cakeblock_bottom");
break;
case COOKIE:
texture = iconRegister.registerIcon("biomesoplenty:cookieblock");
break;
default:
break;
}
}
@Override
//TODO: getItemDropped()
public Item getItemDropped(int metadata, Random random, int fortune)
{
switch (type)
{
case COOKIE:
return Items.cookie;
default:
//TODO: getItemForBlock()
return Item.getItemFromBlock(this);
}
}
@Override
//TODO damageDropped()
public int damageDropped(int meta)
{
switch (type)
{
case COOKIE:
return 0;
default:
return meta;
}
}
@Override
public int quantityDropped(int meta, int fortune, Random random)
{
switch (type)
{
case COOKIE:
return 4;
default:
return 1;
}
}
@Override
//TODO: getIcon()
public IIcon getIcon(int side, int meta)
{
return texture;
}
}

View File

@ -14,6 +14,8 @@ import net.minecraftforge.common.util.ForgeDirection;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.api.BOPItemHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.WorldTypeBOPA;
public class BlockFrostedCake extends Block
{
@ -34,7 +36,13 @@ public class BlockFrostedCake extends Block
this.setTickRandomly(true);
//TODO: this.setCreativeTab()
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
if (!BOPConfigurationMisc.behaveNormally)
{
if(WorldTypeBOPA.isTime())
{
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
}
}
@Override
@ -58,12 +66,6 @@ public class BlockFrostedCake extends Block
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)

View File

@ -65,7 +65,6 @@ 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,8 +159,6 @@ public class BOPBiomes
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("bog"), Type.SWAMP, Type.FOREST);
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

@ -1,19 +1,89 @@
package biomesoplenty.common.core;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.blocks.*;
import biomesoplenty.common.blocks.BlockBOPColorizedLeaves.ColourizedLeafCategory;
import biomesoplenty.common.blocks.BlockBOPGeneric.BlockType;
import biomesoplenty.common.blocks.BlockBOPLeaves.LeafCategory;
import biomesoplenty.common.blocks.BlockBOPLog.LogCategory;
import biomesoplenty.common.blocks.BlockBOPSlab.SlabCategory;
import biomesoplenty.common.blocks.BlockBOPStairs.Category;
import biomesoplenty.common.itemblocks.*;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.blocks.BlockAsh;
import biomesoplenty.common.blocks.BlockBOPAppleLeaves;
import biomesoplenty.common.blocks.BlockBOPColorizedLeaves;
import biomesoplenty.common.blocks.BlockBOPColorizedLeaves.ColourizedLeafCategory;
import biomesoplenty.common.blocks.BlockBOPColorizedSapling;
import biomesoplenty.common.blocks.BlockBOPCoral;
import biomesoplenty.common.blocks.BlockBOPFlower;
import biomesoplenty.common.blocks.BlockBOPFlower2;
import biomesoplenty.common.blocks.BlockBOPFoliage;
import biomesoplenty.common.blocks.BlockBOPGems;
import biomesoplenty.common.blocks.BlockBOPGeneric;
import biomesoplenty.common.blocks.BlockBOPGeneric.BlockType;
import biomesoplenty.common.blocks.BlockBOPGrass;
import biomesoplenty.common.blocks.BlockBOPLeaves;
import biomesoplenty.common.blocks.BlockBOPLeaves.LeafCategory;
import biomesoplenty.common.blocks.BlockBOPLog;
import biomesoplenty.common.blocks.BlockBOPLog.LogCategory;
import biomesoplenty.common.blocks.BlockBOPMushroom;
import biomesoplenty.common.blocks.BlockBOPPersimmonLeaves;
import biomesoplenty.common.blocks.BlockBOPPetals;
import biomesoplenty.common.blocks.BlockBOPPlank;
import biomesoplenty.common.blocks.BlockBOPPlant;
import biomesoplenty.common.blocks.BlockBOPRedRock;
import biomesoplenty.common.blocks.BlockBOPSapling;
import biomesoplenty.common.blocks.BlockBOPSkystone;
import biomesoplenty.common.blocks.BlockBOPSlab;
import biomesoplenty.common.blocks.BlockBOPSlab.SlabCategory;
import biomesoplenty.common.blocks.BlockBOPStairs;
import biomesoplenty.common.blocks.BlockBOPStairs.Category;
import biomesoplenty.common.blocks.BlockBamboo;
import biomesoplenty.common.blocks.BlockBones;
import biomesoplenty.common.blocks.BlockCandy;
import biomesoplenty.common.blocks.BlockCandy.BlockTypeCandy;
import biomesoplenty.common.blocks.BlockCloud;
import biomesoplenty.common.blocks.BlockFlesh;
import biomesoplenty.common.blocks.BlockFlowerVine;
import biomesoplenty.common.blocks.BlockFrostedCake;
import biomesoplenty.common.blocks.BlockGrave;
import biomesoplenty.common.blocks.BlockHive;
import biomesoplenty.common.blocks.BlockHoney;
import biomesoplenty.common.blocks.BlockIvy;
import biomesoplenty.common.blocks.BlockLongGrass;
import biomesoplenty.common.blocks.BlockMoss;
import biomesoplenty.common.blocks.BlockMud;
import biomesoplenty.common.blocks.BlockOriginGrass;
import biomesoplenty.common.blocks.BlockOvergrownNetherrack;
import biomesoplenty.common.blocks.BlockStoneFormations;
import biomesoplenty.common.blocks.BlockTreeMoss;
import biomesoplenty.common.blocks.BlockTurnip;
import biomesoplenty.common.blocks.BlockWillow;
import biomesoplenty.common.itemblocks.ItemBlockAppleLeaves;
import biomesoplenty.common.itemblocks.ItemBlockBamboo;
import biomesoplenty.common.itemblocks.ItemBlockBones;
import biomesoplenty.common.itemblocks.ItemBlockColorizedLeaves;
import biomesoplenty.common.itemblocks.ItemBlockColorizedSapling;
import biomesoplenty.common.itemblocks.ItemBlockCoral;
import biomesoplenty.common.itemblocks.ItemBlockFlower;
import biomesoplenty.common.itemblocks.ItemBlockFlower2;
import biomesoplenty.common.itemblocks.ItemBlockFoliage;
import biomesoplenty.common.itemblocks.ItemBlockGems;
import biomesoplenty.common.itemblocks.ItemBlockGrave;
import biomesoplenty.common.itemblocks.ItemBlockHive;
import biomesoplenty.common.itemblocks.ItemBlockIvy;
import biomesoplenty.common.itemblocks.ItemBlockLeaves;
import biomesoplenty.common.itemblocks.ItemBlockLog;
import biomesoplenty.common.itemblocks.ItemBlockMoss;
import biomesoplenty.common.itemblocks.ItemBlockMud;
import biomesoplenty.common.itemblocks.ItemBlockMushroom;
import biomesoplenty.common.itemblocks.ItemBlockPersimmonLeaves;
import biomesoplenty.common.itemblocks.ItemBlockPetals;
import biomesoplenty.common.itemblocks.ItemBlockPlank;
import biomesoplenty.common.itemblocks.ItemBlockPlant;
import biomesoplenty.common.itemblocks.ItemBlockRedRock;
import biomesoplenty.common.itemblocks.ItemBlockSapling;
import biomesoplenty.common.itemblocks.ItemBlockSkystone;
import biomesoplenty.common.itemblocks.ItemBlockSlab;
import biomesoplenty.common.itemblocks.ItemBlockStoneFormations;
import biomesoplenty.common.itemblocks.ItemBlockWillow;
import cpw.mods.fml.common.registry.GameRegistry;
public class BOPBlocks
{
@ -91,8 +161,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 BlockCandy(Material.cake, BlockTypeCandy.CAKE).setBlockName("cakeBlock"));
registerBlock(new BlockCandy(Material.cake, BlockTypeCandy.COOKIE).setBlockName("cookieBlock"));
registerBlock(new BlockBones().setBlockName("bones"), ItemBlockBones.class);
registerBlock(new BlockGrave().setBlockName("grave"), ItemBlockGrave.class);

View File

@ -79,6 +79,7 @@ public class BOPWorldFeatures
addFeature("wasteland3PerChunk", 0);
addFeature("wasteland4PerChunk", 0);
addFeature("wastelandRockPilesPerChunk", 0);
addFeature("cookiesPerChunk", 0);
addFeature("bopFlowersPerChunk", 0);
addFeature("bopGrassPerChunk", 0);

View File

@ -0,0 +1,98 @@
package biomesoplenty.common.world.features;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.decoration.BOPDecorationManager;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.Random;
public class WorldGenCookie extends WorldGeneratorBOP
{
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
//TODO: isAirBlock()
while (world.isAirBlock(x, y, z) && y > 2)
{
--y;
}
boolean isGrass = true;
for (int ix = -1; ix <= 1; ix++)
{
for (int iz = -1; iz <= 1; iz++)
{
if (world.getBlock(x + ix, y, z + iz) != BOPBlockHelper.get("frostedCake"))
{
isGrass = false;
break;
}
}
}
if (!isGrass)
{
return false;
}
else
{
for (int var7 = -2; var7 <= 2; ++var7)
{
for (int var8 = -2; var8 <= 2; ++var8)
{
//TODO: isAirBlock() isAirBlock()
if (world.isAirBlock(x + var7, y - 1, z + var8) && world.isAirBlock(x + var7, y - 2, z + var8))
return false;
}
}
//TODO: setBlockAndMetadata()
this.func_150515_a(world, x, y + 1, z, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x - 1, y + 1, z, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x - 1, y + 1, z - 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x - 1, y + 1, z + 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x + 1, y + 1, z, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x + 1, y + 1, z - 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x + 1, y + 1, z + 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x, y + 1, z - 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x, y + 1, z + 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x - 2, y + 1, z, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x + 2, y + 1, z, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x, y + 1, z - 2, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x, y + 1, z + 2, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x - 2, y + 1, z - 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x + 2, y + 1, z + 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x - 1, y + 1, z - 2, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x + 1, y + 1, z + 2, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x - 1, y + 1, z + 2, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x + 1, y + 1, z - 2, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x - 2, y + 1, z + 1, BOPBlockHelper.get("cookieBlock"));
this.func_150515_a(world, x + 2, y + 1, z - 1, BOPBlockHelper.get("cookieBlock"));
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);
}
}
}

View File

@ -77,6 +77,7 @@ public class WorldGenFieldAssociation
associateFeature("wasteland2PerChunk", new WorldGenWasteland2());
associateFeature("wasteland3PerChunk", new WorldGenWasteland3());
associateFeature("wasteland4PerChunk", new WorldGenWasteland4());
associateFeature("cookiesPerChunk", new WorldGenCookie());
associateFeature("bopFlowersPerChunk", new WorldGenBOPFlowerManager());
associateFeature("bopGrassPerChunk", new WorldGenBOPGrassManager());

View File

@ -11,6 +11,10 @@ tile.mudBricks.name=Mud Bricks
tile.holyDirt.name=Purified Dirt
tile.crystal.name=Celestial Crystal
tile.cakeBlock.name=Cake Block
tile.frostedCake.name=Frosted Cake Block
tile.cookieBlock.name=Cookie Block
tile.redRock.redrock.name=Red Rock
tile.redRock.redcobble.name=Red Rock Cobblestone
tile.redRock.redbrick.name=Red Rock Bricks

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B