diff --git a/src/minecraft/biomesoplenty/api/BlockReferences.java b/src/minecraft/biomesoplenty/api/BlockReferences.java index ff94fa4ce..613806478 100644 --- a/src/minecraft/biomesoplenty/api/BlockReferences.java +++ b/src/minecraft/biomesoplenty/api/BlockReferences.java @@ -105,6 +105,7 @@ public class BlockReferences { crystal (Blocks.crystal, 0), cragRock (Blocks.cragRock, 0), quicksand (Blocks.mud, 1), + cloud (Blocks.cloud, 0), smolderingGrass (Blocks.holyGrass, 1), amethystBlock (Blocks.amethystOre, 1), amethystOre (Blocks.amethystOre, 0), diff --git a/src/minecraft/biomesoplenty/api/Blocks.java b/src/minecraft/biomesoplenty/api/Blocks.java index c03c382f1..f8c99f57a 100644 --- a/src/minecraft/biomesoplenty/api/Blocks.java +++ b/src/minecraft/biomesoplenty/api/Blocks.java @@ -71,6 +71,7 @@ public class Blocks public static Optional moss = Optional.absent(); public static Optional petals = Optional.absent(); public static Optional bamboo = Optional.absent(); + public static Optional cloud = Optional.absent(); // public static Optional amethystBlock = Optional.absent(); public static Optional amethystOre = Optional.absent(); diff --git a/src/minecraft/biomesoplenty/biomes/BiomeDecoratorBOP.java b/src/minecraft/biomesoplenty/biomes/BiomeDecoratorBOP.java index 017b5bc94..922b10e55 100644 --- a/src/minecraft/biomesoplenty/biomes/BiomeDecoratorBOP.java +++ b/src/minecraft/biomesoplenty/biomes/BiomeDecoratorBOP.java @@ -361,7 +361,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator this.canyonGen = new WorldGenCanyon(Blocks.redRock.get().blockID, 48); this.smolderingGrassGen = new WorldGenSmolderingGrass(Blocks.holyGrass.get().blockID, 1, 32); this.driedDirtInSandGen = new WorldGenDriedDirt(Blocks.driedDirt.get().blockID, 32); - this.cloudGen = new WorldGenCloud(Block.cloth.blockID, 48); + this.cloudGen = new WorldGenCloud(Blocks.cloud.get().blockID, 48); this.coalGen = new WorldGenMinable(Block.oreCoal.blockID, 16); this.ironGen = new WorldGenMinable(Block.oreIron.blockID, 8); this.goldGen = new WorldGenMinable(Block.oreGold.blockID, 8); @@ -625,7 +625,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator if (this.generateClouds) { - this.genCloudMain(1, this.cloudGen, 0, 30); + this.genCloudMain(1, this.cloudGen, 0, 50); } if (this.generatePits) @@ -1255,6 +1255,8 @@ public class BiomeDecoratorBOP extends BiomeDecorator if (var999 == 0) { par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6, var7, var8); + par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6, var7, var8 + 8); + par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6 + 8, var7, var8 + 8); } } } diff --git a/src/minecraft/biomesoplenty/blocks/BlockCloud.java b/src/minecraft/biomesoplenty/blocks/BlockCloud.java new file mode 100644 index 000000000..4922bf666 --- /dev/null +++ b/src/minecraft/biomesoplenty/blocks/BlockCloud.java @@ -0,0 +1,52 @@ +package biomesoplenty.blocks; + +import biomesoplenty.BiomesOPlenty; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCloud extends Block +{ + public BlockCloud(int par1) + { + super(par1, Material.sponge); + this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty); + } + + @Override + public void registerIcons(IconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon("BiomesOPlenty:cloud"); + } + + @Override + @SideOnly(Side.CLIENT) + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() + { + return 1; + } + + @Override + @SideOnly(Side.CLIENT) + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5); + } +} \ No newline at end of file diff --git a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java index 36b9a62a2..b2504e55e 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java +++ b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java @@ -30,6 +30,7 @@ import biomesoplenty.blocks.BlockBOPSlab.SlabCategory; import biomesoplenty.blocks.BlockBOPStairs; import biomesoplenty.blocks.BlockBOPStairs.Category; import biomesoplenty.blocks.BlockBamboo; +import biomesoplenty.blocks.BlockCloud; import biomesoplenty.blocks.BlockMoss; import biomesoplenty.blocks.BlockMud; import biomesoplenty.blocks.BlockOriginGrass; @@ -136,6 +137,7 @@ public class BOPBlocks { Blocks.cragRock = Optional.of(new BlockBOPGeneric(BOPConfiguration.cragRockID, Material.rock, BlockType.CRAG_ROCK)); // Blocks.quicksand = Optional.of((new BlockQuicksand(BOPConfiguration.quicksandID)).setHardness(0.3F).setStepSound(Block.soundSandFootstep).setUnlocalizedName("quicksand")); // Blocks.grass = Optional.of(new BlockBOPGrass(3000).setUnlocalizedName("holyGrass")); + Blocks.cloud = Optional.of((new BlockCloud(BOPConfiguration.cloudID)).setHardness(0.1F).setLightOpacity(3).setStepSound(Block.soundClothFootstep).setUnlocalizedName("cloud")); Blocks.planks = Optional.of((new BlockBOPPlank(BOPConfiguration.planksID)).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("planks")); @@ -202,6 +204,7 @@ public class BOPBlocks { GameRegistry.registerBlock(Blocks.cragRock.get(), "cragRock"); // GameRegistry.registerBlock(Blocks.quicksand.get(), "quicksand"); // GameRegistry.registerBlock(Blocks.amethyst.get(), ItemBOPAmethyst.class, "amethystOre1"); + GameRegistry.registerBlock(Blocks.cloud.get(), "cloud"); ItemBOPSlab.setSlabs(Blocks.stoneSingleSlab.get(), Blocks.stoneDoubleSlab.get()); GameRegistry.registerBlock(Blocks.stoneDoubleSlab.get(), ItemBOPSlab.class, "stoneDoubleSlab"); @@ -334,6 +337,7 @@ public class BOPBlocks { // LanguageRegistry.addName(Blocks.smolderingGrass.get(), "Smoldering Grass"); LanguageRegistry.addName(Blocks.cragRock.get(), "Crag Rock"); // LanguageRegistry.addName(Blocks.quicksand.get(), "Quicksand"); + LanguageRegistry.addName(Blocks.cloud.get(), "Cloud Block"); LanguageRegistry.addName(new ItemStack(Blocks.mud.get(), 1, 1), "Quicksand"); LanguageRegistry.addName(new ItemStack(Blocks.saplings.get(),1,2), "Bamboo Sapling"); diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index 8d79ae26f..79ed7951b 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -175,6 +175,7 @@ public class BOPConfiguration { public static int colourizedLeavesID; public static int crystalID; + public static int cloudID; //Item IDs public static int shroomPowderID; @@ -647,6 +648,7 @@ public class BOPConfiguration { colourizedLeavesID = config.getBlock("Colourized Leaves ID", 1962, null).getInt(); crystalID = config.getBlock("Crystal ID", 1963, null).getInt(); + cloudID = config.getBlock("Cloud ID", 1964, null).getInt(); // Get Item ID's shroomPowderID = config.getItem("Shroom Powder ID", 21001, null).getInt(); diff --git a/src/minecraft/biomesoplenty/worldgen/WorldGenCloud.java b/src/minecraft/biomesoplenty/worldgen/WorldGenCloud.java index b542134c5..f1832c7d5 100644 --- a/src/minecraft/biomesoplenty/worldgen/WorldGenCloud.java +++ b/src/minecraft/biomesoplenty/worldgen/WorldGenCloud.java @@ -31,8 +31,8 @@ public class WorldGenCloud extends WorldGenerator double var9 = (double)((float)(par3 + 8) - MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F); double var11 = (double)((float)(par5 + 8) + MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F); double var13 = (double)((float)(par5 + 8) - MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F); - double var15 = (double)(par4 + par2Random.nextInt(3) - 2); - double var17 = (double)(par4 + par2Random.nextInt(3) - 2); + double var15 = (double)(par4 + par2Random.nextInt(9) - 2); + double var17 = (double)(par4 + par2Random.nextInt(9) - 2); for (int var19 = 0; var19 <= this.numberOfBlocks; ++var19) { @@ -67,7 +67,12 @@ public class WorldGenCloud extends WorldGenerator if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && par1World.isAirBlock(var38, var41, var44)) { - par1World.setBlock(var38, var41, var44, this.minableBlockId); + int var999 = par2Random.nextInt(45); + + if (var999 == 0) + { + par1World.setBlock(var38, var41, var44, this.minableBlockId); + } } } }