Added cloud blocks to the Promised Land.

This commit is contained in:
Matt Caughey 2013-05-10 16:28:30 -04:00
parent c10fcfb386
commit 08df57d666
7 changed files with 72 additions and 5 deletions

View File

@ -105,6 +105,7 @@ public class BlockReferences {
crystal (Blocks.crystal, 0), crystal (Blocks.crystal, 0),
cragRock (Blocks.cragRock, 0), cragRock (Blocks.cragRock, 0),
quicksand (Blocks.mud, 1), quicksand (Blocks.mud, 1),
cloud (Blocks.cloud, 0),
smolderingGrass (Blocks.holyGrass, 1), smolderingGrass (Blocks.holyGrass, 1),
amethystBlock (Blocks.amethystOre, 1), amethystBlock (Blocks.amethystOre, 1),
amethystOre (Blocks.amethystOre, 0), amethystOre (Blocks.amethystOre, 0),

View File

@ -71,6 +71,7 @@ public class Blocks
public static Optional<? extends Block> moss = Optional.absent(); public static Optional<? extends Block> moss = Optional.absent();
public static Optional<? extends Block> petals = Optional.absent(); public static Optional<? extends Block> petals = Optional.absent();
public static Optional<? extends Block> bamboo = Optional.absent(); public static Optional<? extends Block> bamboo = Optional.absent();
public static Optional<? extends Block> cloud = Optional.absent();
// public static Optional<? extends Block> amethystBlock = Optional.absent(); // public static Optional<? extends Block> amethystBlock = Optional.absent();
public static Optional<? extends Block> amethystOre = Optional.absent(); public static Optional<? extends Block> amethystOre = Optional.absent();

View File

@ -361,7 +361,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
this.canyonGen = new WorldGenCanyon(Blocks.redRock.get().blockID, 48); this.canyonGen = new WorldGenCanyon(Blocks.redRock.get().blockID, 48);
this.smolderingGrassGen = new WorldGenSmolderingGrass(Blocks.holyGrass.get().blockID, 1, 32); this.smolderingGrassGen = new WorldGenSmolderingGrass(Blocks.holyGrass.get().blockID, 1, 32);
this.driedDirtInSandGen = new WorldGenDriedDirt(Blocks.driedDirt.get().blockID, 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.coalGen = new WorldGenMinable(Block.oreCoal.blockID, 16);
this.ironGen = new WorldGenMinable(Block.oreIron.blockID, 8); this.ironGen = new WorldGenMinable(Block.oreIron.blockID, 8);
this.goldGen = new WorldGenMinable(Block.oreGold.blockID, 8); this.goldGen = new WorldGenMinable(Block.oreGold.blockID, 8);
@ -625,7 +625,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
if (this.generateClouds) if (this.generateClouds)
{ {
this.genCloudMain(1, this.cloudGen, 0, 30); this.genCloudMain(1, this.cloudGen, 0, 50);
} }
if (this.generatePits) if (this.generatePits)
@ -1255,6 +1255,8 @@ public class BiomeDecoratorBOP extends BiomeDecorator
if (var999 == 0) if (var999 == 0)
{ {
par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6, var7, var8); 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);
} }
} }
} }

View File

@ -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);
}
}

View File

@ -30,6 +30,7 @@ import biomesoplenty.blocks.BlockBOPSlab.SlabCategory;
import biomesoplenty.blocks.BlockBOPStairs; import biomesoplenty.blocks.BlockBOPStairs;
import biomesoplenty.blocks.BlockBOPStairs.Category; import biomesoplenty.blocks.BlockBOPStairs.Category;
import biomesoplenty.blocks.BlockBamboo; import biomesoplenty.blocks.BlockBamboo;
import biomesoplenty.blocks.BlockCloud;
import biomesoplenty.blocks.BlockMoss; import biomesoplenty.blocks.BlockMoss;
import biomesoplenty.blocks.BlockMud; import biomesoplenty.blocks.BlockMud;
import biomesoplenty.blocks.BlockOriginGrass; 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.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.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.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")); 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.cragRock.get(), "cragRock");
// GameRegistry.registerBlock(Blocks.quicksand.get(), "quicksand"); // GameRegistry.registerBlock(Blocks.quicksand.get(), "quicksand");
// GameRegistry.registerBlock(Blocks.amethyst.get(), ItemBOPAmethyst.class, "amethystOre1"); // GameRegistry.registerBlock(Blocks.amethyst.get(), ItemBOPAmethyst.class, "amethystOre1");
GameRegistry.registerBlock(Blocks.cloud.get(), "cloud");
ItemBOPSlab.setSlabs(Blocks.stoneSingleSlab.get(), Blocks.stoneDoubleSlab.get()); ItemBOPSlab.setSlabs(Blocks.stoneSingleSlab.get(), Blocks.stoneDoubleSlab.get());
GameRegistry.registerBlock(Blocks.stoneDoubleSlab.get(), ItemBOPSlab.class, "stoneDoubleSlab"); 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.smolderingGrass.get(), "Smoldering Grass");
LanguageRegistry.addName(Blocks.cragRock.get(), "Crag Rock"); LanguageRegistry.addName(Blocks.cragRock.get(), "Crag Rock");
// LanguageRegistry.addName(Blocks.quicksand.get(), "Quicksand"); // 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.mud.get(), 1, 1), "Quicksand");
LanguageRegistry.addName(new ItemStack(Blocks.saplings.get(),1,2), "Bamboo Sapling"); LanguageRegistry.addName(new ItemStack(Blocks.saplings.get(),1,2), "Bamboo Sapling");

View File

@ -175,6 +175,7 @@ public class BOPConfiguration {
public static int colourizedLeavesID; public static int colourizedLeavesID;
public static int crystalID; public static int crystalID;
public static int cloudID;
//Item IDs //Item IDs
public static int shroomPowderID; public static int shroomPowderID;
@ -647,6 +648,7 @@ public class BOPConfiguration {
colourizedLeavesID = config.getBlock("Colourized Leaves ID", 1962, null).getInt(); colourizedLeavesID = config.getBlock("Colourized Leaves ID", 1962, null).getInt();
crystalID = config.getBlock("Crystal ID", 1963, null).getInt(); crystalID = config.getBlock("Crystal ID", 1963, null).getInt();
cloudID = config.getBlock("Cloud ID", 1964, null).getInt();
// Get Item ID's // Get Item ID's
shroomPowderID = config.getItem("Shroom Powder ID", 21001, null).getInt(); shroomPowderID = config.getItem("Shroom Powder ID", 21001, null).getInt();

View File

@ -31,8 +31,8 @@ public class WorldGenCloud extends WorldGenerator
double var9 = (double)((float)(par3 + 8) - MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F); 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 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 var13 = (double)((float)(par5 + 8) - MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F);
double var15 = (double)(par4 + par2Random.nextInt(3) - 2); double var15 = (double)(par4 + par2Random.nextInt(9) - 2);
double var17 = (double)(par4 + par2Random.nextInt(3) - 2); double var17 = (double)(par4 + par2Random.nextInt(9) - 2);
for (int var19 = 0; var19 <= this.numberOfBlocks; ++var19) 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)) 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);
}
} }
} }
} }