diff --git a/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenCandyland.java b/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenCandyland.java new file mode 100644 index 000000000..bd01f7c36 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenCandyland.java @@ -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); + } +} diff --git a/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenWetland.java b/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenWetland.java index e56ad72f3..0707ef243 100644 --- a/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenWetland.java +++ b/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenWetland.java @@ -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; diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java index 1277c0c90..1c65521f6 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java @@ -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; diff --git a/src/main/java/biomesoplenty/common/blocks/BlockFrostedCake.java b/src/main/java/biomesoplenty/common/blocks/BlockFrostedCake.java new file mode 100644 index 000000000..78a945e33 --- /dev/null +++ b/src/main/java/biomesoplenty/common/blocks/BlockFrostedCake.java @@ -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")); + } +} diff --git a/src/main/java/biomesoplenty/common/blocks/BlockMoss.java b/src/main/java/biomesoplenty/common/blocks/BlockMoss.java index 9ffe66935..4bc6db9db 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockMoss.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockMoss.java @@ -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; } diff --git a/src/main/java/biomesoplenty/common/configuration/BOPConfigurationIDs.java b/src/main/java/biomesoplenty/common/configuration/BOPConfigurationIDs.java index dcbb87dab..cddf456c7 100644 --- a/src/main/java/biomesoplenty/common/configuration/BOPConfigurationIDs.java +++ b/src/main/java/biomesoplenty/common/configuration/BOPConfigurationIDs.java @@ -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(); diff --git a/src/main/java/biomesoplenty/common/core/BOPBiomes.java b/src/main/java/biomesoplenty/common/core/BOPBiomes.java index ca470864b..641358730 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBiomes.java +++ b/src/main/java/biomesoplenty/common/core/BOPBiomes.java @@ -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); diff --git a/src/main/java/biomesoplenty/common/core/BOPBlocks.java b/src/main/java/biomesoplenty/common/core/BOPBlocks.java index 79ba12f38..b7e965a26 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBlocks.java +++ b/src/main/java/biomesoplenty/common/core/BOPBlocks.java @@ -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); diff --git a/src/main/java/biomesoplenty/common/world/features/WorldGenBOPUndergroundDecoration.java b/src/main/java/biomesoplenty/common/world/features/WorldGenBOPUndergroundDecoration.java new file mode 100644 index 000000000..dddb568a6 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/WorldGenBOPUndergroundDecoration.java @@ -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); + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_bottom.png b/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_bottom.png new file mode 100644 index 000000000..eeea8db50 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_bottom.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_side.png b/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_side.png new file mode 100644 index 000000000..fcd2dd5d6 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_side.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_top.png b/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_top.png new file mode 100644 index 000000000..8bebc001d Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/cakeblock_top.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/candycane_heart.png b/src/main/resources/assets/biomesoplenty/textures/blocks/candycane_heart.png new file mode 100644 index 000000000..87d7a9927 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/candycane_heart.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/candycane_side.png b/src/main/resources/assets/biomesoplenty/textures/blocks/candycane_side.png new file mode 100644 index 000000000..1c8408dc9 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/candycane_side.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/item_moss.png b/src/main/resources/assets/biomesoplenty/textures/blocks/item_moss.png index 67efc7d5b..e4c5a2a14 100644 Binary files a/src/main/resources/assets/biomesoplenty/textures/blocks/item_moss.png and b/src/main/resources/assets/biomesoplenty/textures/blocks/item_moss.png differ