net.minecraft.block
Class Block

java.lang.Object
  extended by net.minecraft.block.Block
Direct Known Subclasses:
BlockBookshelf, BlockBreakable, BlockButton, BlockCactus, BlockCake, BlockCauldron, BlockClay, BlockCloth, BlockContainer, BlockDirectional, BlockDirt, BlockDoor, BlockDragonEgg, BlockEndPortalFrame, BlockFarmland, BlockFence, BlockFire, BlockFlower, BlockFlowerPot, BlockFluid, BlockGlowStone, BlockGrass, BlockHalfSlab, BlockLadder, BlockLeavesBase, BlockLever, BlockLockedChest, BlockLog, BlockMelon, BlockMushroomCap, BlockMycelium, BlockNetherrack, BlockOre, BlockOreStorage, BlockPane, BlockPistonBase, BlockPistonExtension, BlockPressurePlate, BlockRail, BlockRedstoneLight, BlockRedstoneOre, BlockRedstoneWire, BlockReed, BlockSand, BlockSandStone, BlockSilverfish, BlockSnow, BlockSnowBlock, BlockSoulSand, BlockSponge, BlockStairs, BlockStone, BlockStoneBrick, BlockTNT, BlockTorch, BlockTrapDoor, BlockTripWire, BlockTripWireSource, BlockVine, BlockWall, BlockWeb, BlockWood, BlockWorkbench

public class Block
extends Object


Field Summary
static Block anvil
           
static Block beacon
           
static Block bed
           
static Block bedrock
           
static Block blockClay
           
static Block blockDiamond
           
static Block blockEmerald
           
static Block blockGold
           
 int blockID
          ID of the block.
 int blockIndexInTexture
          The index of the texture to be displayed for this block.
static Block blockLapis
           
 Material blockMaterial
          Block material definition.
 float blockParticleGravity
           
static Block[] blocksList
          List of ly/ff (BlockType) containing the already registered blocks.
static Block blockSnow
           
static Block blockSteel
           
static Block bookShelf
           
static Block brewingStand
           
static Block brick
           
static Block cactus
           
static Block cake
           
static boolean[] canBlockGrass
          Array of booleans that tells if a block can grass
static Block carrot
           
static Block cauldron
           
static Block chest
           
static Block cloth
           
static Block cobblestone
           
static Block cobblestoneMossy
           
static Block cobblestoneWall
           
static Block cocoaPlant
           
static Block commandBlock
           
static Block crops
           
static BlockDeadBush deadBush
           
static Block dirt
           
static Block dispenser
           
static Block doorSteel
           
static Block doorWood
           
static Block dragonEgg
           
static Block enchantmentTable
           
static Block enderChest
           
static Block endPortal
           
static Block endPortalFrame
           
static Block fence
           
static Block fenceGate
           
static Block fenceIron
           
static BlockFire fire
           
static Block flowerPot
           
static Block glass
           
static Block glowStone
           
static BlockGrass grass
           
static Block gravel
           
static Block ice
           
 boolean isDefaultTexture
           
static Block jukebox
           
static Block ladder
           
static Block lavaMoving
           
static Block lavaStill
          Stationary lava source block
static BlockLeaves leaves
           
static Block lever
           
static int[] lightOpacity
          How much light is subtracted for going through this block
static int[] lightValue
          Amount of light emitted
static Block lockedChest
          April fools secret locked chest, only spawns on new chunks on 1st April.
static Block melon
           
static Block melonStem
           
static Block mobSpawner
           
static BlockFlower mushroomBrown
           
static Block mushroomCapBrown
           
static Block mushroomCapRed
           
static BlockFlower mushroomRed
           
static Block music
           
static BlockMycelium mycelium
           
static Block netherBrick
           
static Block netherFence
           
static Block netherrack
           
static Block netherStalk
           
static Block obsidian
           
static boolean[] opaqueCubeLookup
          An array of 4096 booleans corresponding to the result of the isOpaqueCube() method for each block ID
static Block oreCoal
           
static Block oreDiamond
           
static Block oreEmerald
           
static Block oreGold
           
static Block oreIron
           
static Block oreLapis
           
static Block oreRedstone
           
static Block oreRedstoneGlowing
           
static Block pistonBase
           
static BlockPistonExtension pistonExtension
           
static BlockPistonMoving pistonMoving
           
static Block pistonStickyBase
           
static Block planks
           
static BlockFlower plantRed
           
static BlockFlower plantYellow
           
static BlockPortal portal
          The purple teleport blocks inside the obsidian circle
static Block potato
           
static Block pressurePlatePlanks
           
static Block pressurePlateStone
           
static Block pumpkin
           
static Block pumpkinLantern
           
static Block pumpkinStem
           
static Block rail
           
static Block railDetector
           
static Block railPowered
           
static Block redstoneLampActive
           
static Block redstoneLampIdle
           
static Block redstoneRepeaterActive
           
static Block redstoneRepeaterIdle
           
static Block redstoneWire
           
static Block reed
           
static boolean[] requiresSelfNotify
           
static Block sand
           
static Block sandStone
           
static Block sapling
           
static Block signPost
           
static Block signWall
           
static Block silverfish
           
static Block skull
           
 float slipperiness
          Determines how much velocity is maintained while moving on top of this block
static Block slowSand
           
static Block snow
           
static StepSound soundAnvilFootstep
           
static StepSound soundClothFootstep
           
static StepSound soundGlassFootstep
           
static StepSound soundGrassFootstep
           
static StepSound soundGravelFootstep
           
static StepSound soundLadderFootstep
           
static StepSound soundMetalFootstep
           
static StepSound soundPowderFootstep
           
static StepSound soundSandFootstep
           
static StepSound soundSnowFootstep
           
static StepSound soundStoneFootstep
           
static StepSound soundWoodFootstep
           
static Block sponge
           
static Block stairCompactCobblestone
           
static Block stairCompactPlanks
           
static Block stairsBrick
           
static Block stairsNetherBrick
           
static Block stairsSandStone
           
static Block stairsStoneBrickSmooth
           
static Block stairsWoodBirch
           
static Block stairsWoodJungle
           
static Block stairsWoodSpruce
           
 StepSound stepSound
          Sound of stepping on the block
static Block stone
           
static Block stoneBrick
           
static Block stoneButton
           
static BlockHalfSlab stoneDoubleSlab
          stoneDoubleSlab
static Block stoneOvenActive
           
static Block stoneOvenIdle
           
static BlockHalfSlab stoneSingleSlab
          stoneSingleSlab
static BlockTallGrass tallGrass
           
static Block thinGlass
           
static Block tilledField
           
static Block tnt
           
static Block torchRedstoneActive
           
static Block torchRedstoneIdle
           
static Block torchWood
           
static Block trapdoor
           
static Block tripWire
           
static BlockTripWireSource tripWireSource
           
static boolean[] useNeighborBrightness
          Flag if block ID should use the brightest neighbor light value as its own
static Block vine
           
static Block waterlily
           
static Block waterMoving
           
static Block waterStill
           
static Block web
           
static Block whiteStone
          The rock found in The End.
static Block wood
           
static BlockHalfSlab woodDoubleSlab
           
static Block woodenButton
           
static BlockHalfSlab woodSingleSlab
           
static Block workbench
           
 
Constructor Summary
Block(int par1, int par2, Material par3Material)
           
Block(int par1, Material par2Material)
           
 
Method Summary
 boolean addBlockDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer)
          Spawn particles for when the block is destroyed.
 boolean addBlockHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer)
          Spawn a digging particle effect in the world, this is a wrapper around EffectRenderer.addBlockHitEffects to allow the block more control over the particles.
 void addCollidingBlockToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
          if the specified block is in the given AABB, add its collision bounding box to the given list
 void addCreativeItems(ArrayList itemList)
          Called when a new CreativeContainer is opened, populate the list with all of the items for this block you want a player in creative mode to have access to.
 void beginLeavesDecay(World world, int x, int y, int z)
          Called when a leaf should start its decay process.
 void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
          ejects contained items into the world, and notifies neighbours of an update, as appropriate
 boolean canBeReplacedByLeaves(World world, int x, int y, int z)
          Used during tree growth to determine if newly generated leaves can replace this block.
 boolean canBlockStay(World par1World, int par2, int par3, int par4)
          Can this block stay at this position.
 boolean canCollideCheck(int par1, boolean par2)
          Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
 boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side)
          Determine if this block can make a redstone connection on the side provided, Useful to control which sides are inputs and outputs for redstone wires.
 boolean canCreatureSpawn(EnumCreatureType type, World world, int x, int y, int z)
          Determines if a specified mob type can spawn on this block, returning false will prevent any mob from spawning on the block.
 boolean canDragonDestroy(World world, int x, int y, int z)
          Determines if this block is destroyed when a ender dragon tries to fly through it.
 boolean canDropFromExplosion(Explosion par1Explosion)
          Return whether this block can drop from an explosion.
 boolean canHarvestBlock(EntityPlayer player, int meta)
          Determines if the player can harvest this block, obtaining it's drops when the block is destroyed.
 boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
          Checks to see if its valid to put this block at the specified coordinates.
 boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
          checks to see if you can place this block can be placed on that side of a block: BlockLever overrides
 boolean canPlaceTorchOnTop(World world, int x, int y, int z)
          Determines if a torch can be placed on the top surface of this block.
 boolean canProvidePower()
          Can this block provide power.
 boolean canRenderInPass(int pass)
          Determines if this block should render in this pass.
 boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata)
          Return true from this function if the player with silk touch can harvest this block directly, and not it's normal drops.
 boolean canSustainLeaves(World world, int x, int y, int z)
          Determines if this block can prevent leaves connected to it from decaying.
 boolean canSustainPlant(World world, int x, int y, int z, ForgeDirection direction, IPlantable plant)
          Determines if this block can support the passed in plant, allowing it to be planted and grow.
 MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3)
          Ray traces through the blocks collision from start vector to end vector returning a ray trace hit.
 int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
           
 TileEntity createTileEntity(World world, int metadata)
          Called throughout the code as a replacement for BlockContainer.getBlockEntity Return the same thing you would from that function.
 int damageDropped(int par1)
          Determines the damage on the item the block drops.
 void dropBlockAsItem(World par1World, int par2, int par3, int par4, int par5, int par6)
          Drops the specified block items
 void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
          Drops the block items with a specified chance of dropping the specified items
 void fillWithRain(World par1World, int par2, int par3, int par4)
          currently only used by BlockCauldron to incrament meta-data during rain
 boolean func_82505_u_()
           
 boolean func_82506_l()
           
 float getAmbientOcclusionLightValue(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
           
 int getBedDirection(IBlockAccess world, int x, int y, int z)
          Returns the direction of the block.
 ChunkCoordinates getBedSpawnPosition(World world, int x, int y, int z, EntityPlayer player)
          Returns the position that the player is moved to upon waking up, or respawning at the bed.
 double getBlockBoundsMaxX()
          returns the block bounderies maxX value
 double getBlockBoundsMaxY()
          returns the block bounderies maxY value
 double getBlockBoundsMaxZ()
          returns the block bounderies maxZ value
 double getBlockBoundsMinX()
          returns the block bounderies minX value
 double getBlockBoundsMinY()
          returns the block bounderies minY value
 double getBlockBoundsMinZ()
          returns the block bounderies minZ value
 float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
           
 int getBlockColor()
           
 ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
          This returns a complete list of items dropped from this block.
 float getBlockHardness(World par1World, int par2, int par3, int par4)
          Returns the block hardness at a location.
 String getBlockName()
           
 boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
           
 int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
           
 int getBlockTextureFromSide(int par1)
          Returns the block texture based on the side being looked at.
 int getBlockTextureFromSideAndMetadata(int par1, int par2)
          From the specified side and block metadata retrieves the blocks texture.
 AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
          Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been cleared to be reused)
 CreativeTabs getCreativeTabToDisplayOn()
           
 int getDamageValue(World par1World, int par2, int par3, int par4)
          Get the block's damage value (for use with pick block).
 boolean getEnableStats()
          Return the state of blocks statistics flags - if the block is counted for mined and placed.
 float getExplosionResistance(Entity par1Entity)
          Returns how much this block can resist explosions from the passed in entity.
 float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ)
          Location sensitive version of getExplosionRestance
 int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, ForgeDirection face)
          Called when fire is updating on a neighbor block.
 int getFlammability(IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face)
          Chance that fire will spread and consume this block.
 int getLightOpacity(World world, int x, int y, int z)
          Location aware and overrideable version of the lightOpacity array, return the number to subtract from the light value when it passes through this block.
 int getLightValue(IBlockAccess world, int x, int y, int z)
          Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15
 int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
           
 int getMobilityFlag()
          Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and stop pistons
 ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
          Called when a user uses the creative pick block button on this block
 float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5)
          Gets the hardness of block at the given coordinates in the given world, relative to the ability of the given EntityPlayer.
 int getRenderBlockPass()
           
 int getRenderColor(int par1)
           
 int getRenderType()
          The type of render function that is called for this block
 AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
           
 void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
           
 String getTextureFile()
          Grabs the current texture file used for this block
 boolean getTickRandomly()
          Returns whether or not this block is of a type that needs random ticking.
 void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
          Called when the player destroys a block with an item that can harvest it.
 boolean hasTileEntity()
          Deprecated. 
 boolean hasTileEntity(int metadata)
          Called throughout the code as a replacement for block instanceof BlockContainer Moving this to the Block base class allows for mods that wish to extend vinella blocks, and also want to have a tile entity on that block, may.
 int idDropped(int par1, Random par2Random, int par3)
          Returns the ID of the items to drop on destruction.
 int idPicked(World par1World, int par2, int par3, int par4)
           
 boolean isAirBlock(World world, int x, int y, int z)
          Determines this block should be treated as an air block by the rest of the code.
 boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
          Determines if this block can be used as the base of a beacon.
 boolean isBed(World world, int x, int y, int z, EntityLiving player)
          Determines if this block is classified as a Bed, Allowing players to sleep in it, though the block has to specifically perform the sleeping functionality in it's activated event.
 boolean isBedFoot(IBlockAccess world, int x, int y, int z)
          Determines if the current block is the foot half of the bed.
 boolean isBlockBurning(World world, int x, int y, int z)
          Determines if this block should set fire and deal fire damage to entities coming into contact with it.
 boolean isBlockFoliage(World world, int x, int y, int z)
          Used by getTopSolidOrLiquidBlock while placing biome decorations, villages, etc Also used to determine if the player can spawn on this block.
 boolean isBlockNormalCube(World world, int x, int y, int z)
          Return true if the block is a normal, solid cube.
 boolean isBlockReplaceable(World world, int x, int y, int z)
          Determines if a new block can be replace the space occupied by this one, Used in the player's placement code to make the block act like water, and lava.
 boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
          Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the adjacent block is at the given coordinates.
 boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
          Checks if the block is a solid face on the given side, used by placement logic.
 boolean isCollidable()
          Returns if this block is collidable (only used by Fire).
 boolean isFertile(World world, int x, int y, int z)
          Checks if this soil is fertile, typically this means that growth rates of plants on this soil will be slightly sped up.
 boolean isFireSource(World world, int x, int y, int z, int metadata, ForgeDirection side)
          Currently only called by fire when it is on top of this block.
 boolean isFlammable(IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face)
          Called when fire is updating, checks if a block face can catch fire.
 boolean isGenMineableReplaceable(World world, int x, int y, int z)
          Determines if the current block is replaceable by Ore veins during world generation.
 boolean isLadder(World world, int x, int y, int z)
          Checks if a player or entity can use this block to 'climb' like a ladder.
 boolean isLeaves(World world, int x, int y, int z)
          Determines if this block is considered a leaf block, used to apply the leaf decay and generation system.
static boolean isNormalCube(int par0)
           
 boolean isOpaqueCube()
          Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
 boolean isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
          Returns true if the block is emitting direct/strong redstone power on the specified side.
 boolean isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
          Returns true if the block is emitting indirect/weak redstone power on the specified side.
 boolean isWood(World world, int x, int y, int z)
           
 boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
          Called upon block activation (right click on the block.)
 void onBlockAdded(World par1World, int par2, int par3, int par4)
          Called whenever the block is added into the world.
 void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
          Called when the block is clicked by a player.
 void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4)
          Called upon the block being destroyed by an explosion
 void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
          Called right before the block is destroyed by a player.
 void onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6)
          Called when the block receives a BlockEvent - see World.addBlockEvent.
 void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
          Called when the block is attempted to be harvested
 int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
          Called when a block is placed using its ItemBlock.
 void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
          Called when the block is placed in the world.
 void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
          Triggered whenever an entity collides with this block (enters into the block).
 void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity)
          Called whenever an entity is walking on top of this block.
 void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6)
          Block's chance to react to an entity falling on it.
 void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
          Lets the block know when one of its neighbor changes.
 void onPostBlockPlaced(World par1World, int par2, int par3, int par4, int par5)
          Called after a block is placed
 void onSetBlockIDWithMetaData(World par1World, int par2, int par3, int par4, int par5)
          Called when this block is set (with meta data).
 int quantityDropped(int meta, int fortune, Random random)
          Metadata and fortune sensitive version, this replaces the old (int meta, Random rand) version in 1.1.
 int quantityDropped(Random par1Random)
          Returns the quantity of items to drop on block destruction.
 int quantityDroppedWithBonus(int par1, Random par2Random)
          Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive).
 void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
           
 boolean removeBlockByPlayer(World world, EntityPlayer player, int x, int y, int z)
          Called when a player removes a block.
 boolean renderAsNormalBlock()
          If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
 void setBedOccupied(World world, int x, int y, int z, EntityPlayer player, boolean occupied)
          Called when a user either starts or stops sleeping in the bed.
 void setBlockBounds(float par1, float par2, float par3, float par4, float par5, float par6)
          Sets the bounds of the block.
 void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
          Updates the blocks bounds based on its current state.
 void setBlockBoundsForItemRender()
          Sets the block's bounds for rendering it as an item
 Block setBlockName(String par1Str)
          set name of block from language file
 Block setBlockUnbreakable()
          This method will make the hardness of the block equals to -1, and the block is indestructible.
static void setBurnProperties(int id, int encouragement, int flammability)
          Called by BlockFire to setup the burn values of vanilla blocks.
 Block setCreativeTab(CreativeTabs par1CreativeTabs)
          Sets the CreativeTab to display this block on.
 Block setHardness(float par1)
          Sets how many hits it takes to break a block.
 Block setLightOpacity(int par1)
          Sets how much light is blocked going through this block.
 Block setLightValue(float par1)
          Sets the amount of light emitted by a block from 0.0f to 1.0f (converts internally to 0-15).
 Block setRequiresSelfNotify()
          Blocks with this attribute will not notify all near blocks when it's metadata change.
 Block setResistance(float par1)
          Sets the the blocks resistance to explosions.
 Block setStepSound(StepSound par1StepSound)
          Sets the footstep sound for the block.
 Block setTextureFile(String texture)
          Sets the current texture file for this block, used when rendering.
 Block setTickRandomly(boolean par1)
          Sets whether this block type will receive random update ticks
 boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
           
 int tickRate()
          How many world ticks before ticking
 String translateBlockName()
          gets the localized version of the name of this block using StatCollector.translateToLocal.
 void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
          Ticks the block if it's been scheduled
 void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3)
          Can add to the passed in vector for a movement vector to be applied to the entity.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isDefaultTexture

public boolean isDefaultTexture

soundPowderFootstep

public static final StepSound soundPowderFootstep

soundWoodFootstep

public static final StepSound soundWoodFootstep

soundGravelFootstep

public static final StepSound soundGravelFootstep

soundGrassFootstep

public static final StepSound soundGrassFootstep

soundStoneFootstep

public static final StepSound soundStoneFootstep

soundMetalFootstep

public static final StepSound soundMetalFootstep

soundGlassFootstep

public static final StepSound soundGlassFootstep

soundClothFootstep

public static final StepSound soundClothFootstep

soundSandFootstep

public static final StepSound soundSandFootstep

soundSnowFootstep

public static final StepSound soundSnowFootstep

soundLadderFootstep

public static final StepSound soundLadderFootstep

soundAnvilFootstep

public static final StepSound soundAnvilFootstep

blocksList

public static final Block[] blocksList
List of ly/ff (BlockType) containing the already registered blocks.


opaqueCubeLookup

public static final boolean[] opaqueCubeLookup
An array of 4096 booleans corresponding to the result of the isOpaqueCube() method for each block ID


lightOpacity

public static final int[] lightOpacity
How much light is subtracted for going through this block


canBlockGrass

public static final boolean[] canBlockGrass
Array of booleans that tells if a block can grass


lightValue

public static final int[] lightValue
Amount of light emitted


requiresSelfNotify

public static final boolean[] requiresSelfNotify

useNeighborBrightness

public static boolean[] useNeighborBrightness
Flag if block ID should use the brightest neighbor light value as its own


stone

public static final Block stone

grass

public static final BlockGrass grass

dirt

public static final Block dirt

cobblestone

public static final Block cobblestone

planks

public static final Block planks

sapling

public static final Block sapling

bedrock

public static final Block bedrock

waterMoving

public static final Block waterMoving

waterStill

public static final Block waterStill

lavaMoving

public static final Block lavaMoving

lavaStill

public static final Block lavaStill
Stationary lava source block


sand

public static final Block sand

gravel

public static final Block gravel

oreGold

public static final Block oreGold

oreIron

public static final Block oreIron

oreCoal

public static final Block oreCoal

wood

public static final Block wood

leaves

public static final BlockLeaves leaves

sponge

public static final Block sponge

glass

public static final Block glass

oreLapis

public static final Block oreLapis

blockLapis

public static final Block blockLapis

dispenser

public static final Block dispenser

sandStone

public static final Block sandStone

music

public static final Block music

bed

public static final Block bed

railPowered

public static final Block railPowered

railDetector

public static final Block railDetector

pistonStickyBase

public static final Block pistonStickyBase

web

public static final Block web

tallGrass

public static final BlockTallGrass tallGrass

deadBush

public static final BlockDeadBush deadBush

pistonBase

public static final Block pistonBase

pistonExtension

public static final BlockPistonExtension pistonExtension

cloth

public static final Block cloth

pistonMoving

public static final BlockPistonMoving pistonMoving

plantYellow

public static final BlockFlower plantYellow

plantRed

public static final BlockFlower plantRed

mushroomBrown

public static final BlockFlower mushroomBrown

mushroomRed

public static final BlockFlower mushroomRed

blockGold

public static final Block blockGold

blockSteel

public static final Block blockSteel

stoneDoubleSlab

public static final BlockHalfSlab stoneDoubleSlab
stoneDoubleSlab


stoneSingleSlab

public static final BlockHalfSlab stoneSingleSlab
stoneSingleSlab


brick

public static final Block brick

tnt

public static final Block tnt

bookShelf

public static final Block bookShelf

cobblestoneMossy

public static final Block cobblestoneMossy

obsidian

public static final Block obsidian

torchWood

public static final Block torchWood

fire

public static final BlockFire fire

mobSpawner

public static final Block mobSpawner

stairCompactPlanks

public static final Block stairCompactPlanks

chest

public static final Block chest

redstoneWire

public static final Block redstoneWire

oreDiamond

public static final Block oreDiamond

blockDiamond

public static final Block blockDiamond

workbench

public static final Block workbench

crops

public static final Block crops

tilledField

public static final Block tilledField

stoneOvenIdle

public static final Block stoneOvenIdle

stoneOvenActive

public static final Block stoneOvenActive

signPost

public static final Block signPost

doorWood

public static final Block doorWood

ladder

public static final Block ladder

rail

public static final Block rail

stairCompactCobblestone

public static final Block stairCompactCobblestone

signWall

public static final Block signWall

lever

public static final Block lever

pressurePlateStone

public static final Block pressurePlateStone

doorSteel

public static final Block doorSteel

pressurePlatePlanks

public static final Block pressurePlatePlanks

oreRedstone

public static final Block oreRedstone

oreRedstoneGlowing

public static final Block oreRedstoneGlowing

torchRedstoneIdle

public static final Block torchRedstoneIdle

torchRedstoneActive

public static final Block torchRedstoneActive

stoneButton

public static final Block stoneButton

snow

public static final Block snow

ice

public static final Block ice

blockSnow

public static final Block blockSnow

cactus

public static final Block cactus

blockClay

public static final Block blockClay

reed

public static final Block reed

jukebox

public static final Block jukebox

fence

public static final Block fence

pumpkin

public static final Block pumpkin

netherrack

public static final Block netherrack

slowSand

public static final Block slowSand

glowStone

public static final Block glowStone

portal

public static final BlockPortal portal
The purple teleport blocks inside the obsidian circle


pumpkinLantern

public static final Block pumpkinLantern

cake

public static final Block cake

redstoneRepeaterIdle

public static final Block redstoneRepeaterIdle

redstoneRepeaterActive

public static final Block redstoneRepeaterActive

lockedChest

public static final Block lockedChest
April fools secret locked chest, only spawns on new chunks on 1st April.


trapdoor

public static final Block trapdoor

silverfish

public static final Block silverfish

stoneBrick

public static final Block stoneBrick

mushroomCapBrown

public static final Block mushroomCapBrown

mushroomCapRed

public static final Block mushroomCapRed

fenceIron

public static final Block fenceIron

thinGlass

public static final Block thinGlass

melon

public static final Block melon

pumpkinStem

public static final Block pumpkinStem

melonStem

public static final Block melonStem

vine

public static final Block vine

fenceGate

public static final Block fenceGate

stairsBrick

public static final Block stairsBrick

stairsStoneBrickSmooth

public static final Block stairsStoneBrickSmooth

mycelium

public static final BlockMycelium mycelium

waterlily

public static final Block waterlily

netherBrick

public static final Block netherBrick

netherFence

public static final Block netherFence

stairsNetherBrick

public static final Block stairsNetherBrick

netherStalk

public static final Block netherStalk

enchantmentTable

public static final Block enchantmentTable

brewingStand

public static final Block brewingStand

cauldron

public static final Block cauldron

endPortal

public static final Block endPortal

endPortalFrame

public static final Block endPortalFrame

whiteStone

public static final Block whiteStone
The rock found in The End.


dragonEgg

public static final Block dragonEgg

redstoneLampIdle

public static final Block redstoneLampIdle

redstoneLampActive

public static final Block redstoneLampActive

woodDoubleSlab

public static final BlockHalfSlab woodDoubleSlab

woodSingleSlab

public static final BlockHalfSlab woodSingleSlab

cocoaPlant

public static final Block cocoaPlant

stairsSandStone

public static final Block stairsSandStone

oreEmerald

public static final Block oreEmerald

enderChest

public static final Block enderChest

tripWireSource

public static final BlockTripWireSource tripWireSource

tripWire

public static final Block tripWire

blockEmerald

public static final Block blockEmerald

stairsWoodSpruce

public static final Block stairsWoodSpruce

stairsWoodBirch

public static final Block stairsWoodBirch

stairsWoodJungle

public static final Block stairsWoodJungle

commandBlock

public static final Block commandBlock

beacon

public static final Block beacon

cobblestoneWall

public static final Block cobblestoneWall

flowerPot

public static final Block flowerPot

carrot

public static final Block carrot

potato

public static final Block potato

woodenButton

public static final Block woodenButton

skull

public static final Block skull

anvil

public static final Block anvil

blockIndexInTexture

public int blockIndexInTexture
The index of the texture to be displayed for this block. May vary based on graphics settings. Mostly seems to come from terrain.png, and the index is 0-based (grass is 0).


blockID

public final int blockID
ID of the block.


stepSound

public StepSound stepSound
Sound of stepping on the block


blockParticleGravity

public float blockParticleGravity

blockMaterial

public final Material blockMaterial
Block material definition.


slipperiness

public float slipperiness
Determines how much velocity is maintained while moving on top of this block

Constructor Detail

Block

public Block(int par1,
             Material par2Material)

Block

public Block(int par1,
             int par2,
             Material par3Material)
Method Detail

setRequiresSelfNotify

public Block setRequiresSelfNotify()
Blocks with this attribute will not notify all near blocks when it's metadata change. The default behavior is always notify every neightbor block when anything changes.


setStepSound

public Block setStepSound(StepSound par1StepSound)
Sets the footstep sound for the block. Returns the object for convenience in constructing.


setLightOpacity

public Block setLightOpacity(int par1)
Sets how much light is blocked going through this block. Returns the object for convenience in constructing.


setLightValue

public Block setLightValue(float par1)
Sets the amount of light emitted by a block from 0.0f to 1.0f (converts internally to 0-15). Returns the object for convenience in constructing.


setResistance

public Block setResistance(float par1)
Sets the the blocks resistance to explosions. Returns the object for convenience in constructing.


isNormalCube

public static boolean isNormalCube(int par0)

renderAsNormalBlock

public boolean renderAsNormalBlock()
If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)


getBlocksMovement

public boolean getBlocksMovement(IBlockAccess par1IBlockAccess,
                                 int par2,
                                 int par3,
                                 int par4)

getRenderType

public int getRenderType()
The type of render function that is called for this block


setHardness

public Block setHardness(float par1)
Sets how many hits it takes to break a block.


setBlockUnbreakable

public Block setBlockUnbreakable()
This method will make the hardness of the block equals to -1, and the block is indestructible.


getBlockHardness

public float getBlockHardness(World par1World,
                              int par2,
                              int par3,
                              int par4)
Returns the block hardness at a location. Args: world, x, y, z


setTickRandomly

public Block setTickRandomly(boolean par1)
Sets whether this block type will receive random update ticks


getTickRandomly

public boolean getTickRandomly()
Returns whether or not this block is of a type that needs random ticking. Called for ref-counting purposes by ExtendedBlockStorage in order to broadly cull a chunk from the random chunk update list for efficiency's sake.


hasTileEntity

@Deprecated
public boolean hasTileEntity()
Deprecated. 


setBlockBounds

public final void setBlockBounds(float par1,
                                 float par2,
                                 float par3,
                                 float par4,
                                 float par5,
                                 float par6)
Sets the bounds of the block. minX, minY, minZ, maxX, maxY, maxZ


getBlockBrightness

public float getBlockBrightness(IBlockAccess par1IBlockAccess,
                                int par2,
                                int par3,
                                int par4)

getMixedBrightnessForBlock

public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess,
                                      int par2,
                                      int par3,
                                      int par4)

shouldSideBeRendered

public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess,
                                    int par2,
                                    int par3,
                                    int par4,
                                    int par5)

isBlockSolid

public boolean isBlockSolid(IBlockAccess par1IBlockAccess,
                            int par2,
                            int par3,
                            int par4,
                            int par5)
Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side


getBlockTexture

public int getBlockTexture(IBlockAccess par1IBlockAccess,
                           int par2,
                           int par3,
                           int par4,
                           int par5)

getBlockTextureFromSideAndMetadata

public int getBlockTextureFromSideAndMetadata(int par1,
                                              int par2)
From the specified side and block metadata retrieves the blocks texture. Args: side, metadata


getBlockTextureFromSide

public int getBlockTextureFromSide(int par1)
Returns the block texture based on the side being looked at. Args: side


addCollidingBlockToList

public void addCollidingBlockToList(World par1World,
                                    int par2,
                                    int par3,
                                    int par4,
                                    AxisAlignedBB par5AxisAlignedBB,
                                    List par6List,
                                    Entity par7Entity)
if the specified block is in the given AABB, add its collision bounding box to the given list


getSelectedBoundingBoxFromPool

public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World,
                                                    int par2,
                                                    int par3,
                                                    int par4)

getCollisionBoundingBoxFromPool

public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World,
                                                     int par2,
                                                     int par3,
                                                     int par4)
Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been cleared to be reused)


isOpaqueCube

public boolean isOpaqueCube()
Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.


canCollideCheck

public boolean canCollideCheck(int par1,
                               boolean par2)
Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag


isCollidable

public boolean isCollidable()
Returns if this block is collidable (only used by Fire). Args: x, y, z


updateTick

public void updateTick(World par1World,
                       int par2,
                       int par3,
                       int par4,
                       Random par5Random)
Ticks the block if it's been scheduled


randomDisplayTick

public void randomDisplayTick(World par1World,
                              int par2,
                              int par3,
                              int par4,
                              Random par5Random)

onBlockDestroyedByPlayer

public void onBlockDestroyedByPlayer(World par1World,
                                     int par2,
                                     int par3,
                                     int par4,
                                     int par5)
Called right before the block is destroyed by a player. Args: world, x, y, z, metaData


onNeighborBlockChange

public void onNeighborBlockChange(World par1World,
                                  int par2,
                                  int par3,
                                  int par4,
                                  int par5)
Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor blockID


tickRate

public int tickRate()
How many world ticks before ticking


onBlockAdded

public void onBlockAdded(World par1World,
                         int par2,
                         int par3,
                         int par4)
Called whenever the block is added into the world. Args: world, x, y, z


breakBlock

public void breakBlock(World par1World,
                       int par2,
                       int par3,
                       int par4,
                       int par5,
                       int par6)
ejects contained items into the world, and notifies neighbours of an update, as appropriate


quantityDropped

public int quantityDropped(Random par1Random)
Returns the quantity of items to drop on block destruction.


idDropped

public int idDropped(int par1,
                     Random par2Random,
                     int par3)
Returns the ID of the items to drop on destruction.


getPlayerRelativeBlockHardness

public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer,
                                            World par2World,
                                            int par3,
                                            int par4,
                                            int par5)
Gets the hardness of block at the given coordinates in the given world, relative to the ability of the given EntityPlayer.


dropBlockAsItem

public final void dropBlockAsItem(World par1World,
                                  int par2,
                                  int par3,
                                  int par4,
                                  int par5,
                                  int par6)
Drops the specified block items


dropBlockAsItemWithChance

public void dropBlockAsItemWithChance(World par1World,
                                      int par2,
                                      int par3,
                                      int par4,
                                      int par5,
                                      float par6,
                                      int par7)
Drops the block items with a specified chance of dropping the specified items


damageDropped

public int damageDropped(int par1)
Determines the damage on the item the block drops. Used in cloth and wood.


getExplosionResistance

public float getExplosionResistance(Entity par1Entity)
Returns how much this block can resist explosions from the passed in entity.


collisionRayTrace

public MovingObjectPosition collisionRayTrace(World par1World,
                                              int par2,
                                              int par3,
                                              int par4,
                                              Vec3 par5Vec3,
                                              Vec3 par6Vec3)
Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, y, z, startVec, endVec


onBlockDestroyedByExplosion

public void onBlockDestroyedByExplosion(World par1World,
                                        int par2,
                                        int par3,
                                        int par4)
Called upon the block being destroyed by an explosion


getRenderBlockPass

public int getRenderBlockPass()

canPlaceBlockOnSide

public boolean canPlaceBlockOnSide(World par1World,
                                   int par2,
                                   int par3,
                                   int par4,
                                   int par5)
checks to see if you can place this block can be placed on that side of a block: BlockLever overrides


canPlaceBlockAt

public boolean canPlaceBlockAt(World par1World,
                               int par2,
                               int par3,
                               int par4)
Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z


onBlockActivated

public boolean onBlockActivated(World par1World,
                                int par2,
                                int par3,
                                int par4,
                                EntityPlayer par5EntityPlayer,
                                int par6,
                                float par7,
                                float par8,
                                float par9)
Called upon block activation (right click on the block.)


onEntityWalking

public void onEntityWalking(World par1World,
                            int par2,
                            int par3,
                            int par4,
                            Entity par5Entity)
Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity


onBlockPlaced

public int onBlockPlaced(World par1World,
                         int par2,
                         int par3,
                         int par4,
                         int par5,
                         float par6,
                         float par7,
                         float par8,
                         int par9)
Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata


onBlockClicked

public void onBlockClicked(World par1World,
                           int par2,
                           int par3,
                           int par4,
                           EntityPlayer par5EntityPlayer)
Called when the block is clicked by a player. Args: x, y, z, entityPlayer


velocityToAddToEntity

public void velocityToAddToEntity(World par1World,
                                  int par2,
                                  int par3,
                                  int par4,
                                  Entity par5Entity,
                                  Vec3 par6Vec3)
Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d


setBlockBoundsBasedOnState

public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess,
                                       int par2,
                                       int par3,
                                       int par4)
Updates the blocks bounds based on its current state. Args: world, x, y, z


getBlockBoundsMinX

public final double getBlockBoundsMinX()
returns the block bounderies minX value


getBlockBoundsMaxX

public final double getBlockBoundsMaxX()
returns the block bounderies maxX value


getBlockBoundsMinY

public final double getBlockBoundsMinY()
returns the block bounderies minY value


getBlockBoundsMaxY

public final double getBlockBoundsMaxY()
returns the block bounderies maxY value


getBlockBoundsMinZ

public final double getBlockBoundsMinZ()
returns the block bounderies minZ value


getBlockBoundsMaxZ

public final double getBlockBoundsMaxZ()
returns the block bounderies maxZ value


getBlockColor

public int getBlockColor()

getRenderColor

public int getRenderColor(int par1)

colorMultiplier

public int colorMultiplier(IBlockAccess par1IBlockAccess,
                           int par2,
                           int par3,
                           int par4)

isProvidingWeakPower

public boolean isProvidingWeakPower(IBlockAccess par1IBlockAccess,
                                    int par2,
                                    int par3,
                                    int par4,
                                    int par5)
Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.


canProvidePower

public boolean canProvidePower()
Can this block provide power. Only wire currently seems to have this change based on its state.


onEntityCollidedWithBlock

public void onEntityCollidedWithBlock(World par1World,
                                      int par2,
                                      int par3,
                                      int par4,
                                      Entity par5Entity)
Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity


isProvidingStrongPower

public boolean isProvidingStrongPower(IBlockAccess par1IBlockAccess,
                                      int par2,
                                      int par3,
                                      int par4,
                                      int par5)
Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.


setBlockBoundsForItemRender

public void setBlockBoundsForItemRender()
Sets the block's bounds for rendering it as an item


harvestBlock

public void harvestBlock(World par1World,
                         EntityPlayer par2EntityPlayer,
                         int par3,
                         int par4,
                         int par5,
                         int par6)
Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block and l is the block's subtype/damage.


quantityDroppedWithBonus

public int quantityDroppedWithBonus(int par1,
                                    Random par2Random)
Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive).


canBlockStay

public boolean canBlockStay(World par1World,
                            int par2,
                            int par3,
                            int par4)
Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.


onBlockPlacedBy

public void onBlockPlacedBy(World par1World,
                            int par2,
                            int par3,
                            int par4,
                            EntityLiving par5EntityLiving)
Called when the block is placed in the world.


onPostBlockPlaced

public void onPostBlockPlaced(World par1World,
                              int par2,
                              int par3,
                              int par4,
                              int par5)
Called after a block is placed


setBlockName

public Block setBlockName(String par1Str)
set name of block from language file


translateBlockName

public String translateBlockName()
gets the localized version of the name of this block using StatCollector.translateToLocal. Used for the statistic page.


getBlockName

public String getBlockName()

onBlockEventReceived

public void onBlockEventReceived(World par1World,
                                 int par2,
                                 int par3,
                                 int par4,
                                 int par5,
                                 int par6)
Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity at this location. Args: world, x, y, z, blockID, EventID, event parameter


getEnableStats

public boolean getEnableStats()
Return the state of blocks statistics flags - if the block is counted for mined and placed.


getMobilityFlag

public int getMobilityFlag()
Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and stop pistons


getAmbientOcclusionLightValue

public float getAmbientOcclusionLightValue(IBlockAccess par1IBlockAccess,
                                           int par2,
                                           int par3,
                                           int par4)

onFallenUpon

public void onFallenUpon(World par1World,
                         int par2,
                         int par3,
                         int par4,
                         Entity par5Entity,
                         float par6)
Block's chance to react to an entity falling on it.


idPicked

public int idPicked(World par1World,
                    int par2,
                    int par3,
                    int par4)

getDamageValue

public int getDamageValue(World par1World,
                          int par2,
                          int par3,
                          int par4)
Get the block's damage value (for use with pick block).


getSubBlocks

public void getSubBlocks(int par1,
                         CreativeTabs par2CreativeTabs,
                         List par3List)

setCreativeTab

public Block setCreativeTab(CreativeTabs par1CreativeTabs)
Sets the CreativeTab to display this block on.


onBlockHarvested

public void onBlockHarvested(World par1World,
                             int par2,
                             int par3,
                             int par4,
                             int par5,
                             EntityPlayer par6EntityPlayer)
Called when the block is attempted to be harvested


getCreativeTabToDisplayOn

public CreativeTabs getCreativeTabToDisplayOn()

onSetBlockIDWithMetaData

public void onSetBlockIDWithMetaData(World par1World,
                                     int par2,
                                     int par3,
                                     int par4,
                                     int par5)
Called when this block is set (with meta data).


fillWithRain

public void fillWithRain(World par1World,
                         int par2,
                         int par3,
                         int par4)
currently only used by BlockCauldron to incrament meta-data during rain


func_82505_u_

public boolean func_82505_u_()

func_82506_l

public boolean func_82506_l()

canDropFromExplosion

public boolean canDropFromExplosion(Explosion par1Explosion)
Return whether this block can drop from an explosion.


getLightValue

public int getLightValue(IBlockAccess world,
                         int x,
                         int y,
                         int z)
Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15

Parameters:
world - The current world
x - X Position
y - Y position
z - Z position
Returns:
The light value

isLadder

public boolean isLadder(World world,
                        int x,
                        int y,
                        int z)
Checks if a player or entity can use this block to 'climb' like a ladder.

Parameters:
world - The current world
x - X Position
y - Y position
z - Z position
Returns:
True if the block should act like a ladder

isBlockNormalCube

public boolean isBlockNormalCube(World world,
                                 int x,
                                 int y,
                                 int z)
Return true if the block is a normal, solid cube. This determines indirect power state, entity ejection from blocks, and a few others.

Parameters:
world - The current world
x - X Position
y - Y position
z - Z position
Returns:
True if the block is a full cube

isBlockSolidOnSide

public boolean isBlockSolidOnSide(World world,
                                  int x,
                                  int y,
                                  int z,
                                  ForgeDirection side)
Checks if the block is a solid face on the given side, used by placement logic.

Parameters:
world - The current world
x - X Position
y - Y position
z - Z position
side - The side to check
Returns:
True if the block is solid on the specified side.

isBlockReplaceable

public boolean isBlockReplaceable(World world,
                                  int x,
                                  int y,
                                  int z)
Determines if a new block can be replace the space occupied by this one, Used in the player's placement code to make the block act like water, and lava.

Parameters:
world - The current world
x - X Position
y - Y position
z - Z position
Returns:
True if the block is replaceable by another block

isBlockBurning

public boolean isBlockBurning(World world,
                              int x,
                              int y,
                              int z)
Determines if this block should set fire and deal fire damage to entities coming into contact with it.

Parameters:
world - The current world
x - X Position
y - Y position
z - Z position
Returns:
True if the block should deal damage

isAirBlock

public boolean isAirBlock(World world,
                          int x,
                          int y,
                          int z)
Determines this block should be treated as an air block by the rest of the code. This method is primarily useful for creating pure logic-blocks that will be invisible to the player and otherwise interact as air would.

Parameters:
world - The current world
x - X Position
y - Y position
z - Z position
Returns:
True if the block considered air

canHarvestBlock

public boolean canHarvestBlock(EntityPlayer player,
                               int meta)
Determines if the player can harvest this block, obtaining it's drops when the block is destroyed.

Parameters:
player - The player damaging the block, may be null
meta - The block's current metadata
Returns:
True to spawn the drops

removeBlockByPlayer

public boolean removeBlockByPlayer(World world,
                                   EntityPlayer player,
                                   int x,
                                   int y,
                                   int z)
Called when a player removes a block. This is responsible for actually destroying the block, and the block is intact at time of call. This is called regardless of whether the player can harvest the block or not. Return true if the block is actually destroyed. Note: When used in multiplayer, this is called on both client and server sides!

Parameters:
world - The current world
player - The player damaging the block, may be null
x - X Position
y - Y position
z - Z position
Returns:
True if the block is actually destroyed.

addCreativeItems

public void addCreativeItems(ArrayList itemList)
Called when a new CreativeContainer is opened, populate the list with all of the items for this block you want a player in creative mode to have access to.

Parameters:
itemList - The list of items to display on the creative inventory.

getFlammability

public int getFlammability(IBlockAccess world,
                           int x,
                           int y,
                           int z,
                           int metadata,
                           ForgeDirection face)
Chance that fire will spread and consume this block. 300 being a 100% chance, 0, being a 0% chance.

Parameters:
world - The current world
x - The blocks X position
y - The blocks Y position
z - The blocks Z position
metadata - The blocks current metadata
face - The face that the fire is coming from
Returns:
A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire

isFlammable

public boolean isFlammable(IBlockAccess world,
                           int x,
                           int y,
                           int z,
                           int metadata,
                           ForgeDirection face)
Called when fire is updating, checks if a block face can catch fire.

Parameters:
world - The current world
x - The blocks X position
y - The blocks Y position
z - The blocks Z position
metadata - The blocks current metadata
face - The face that the fire is coming from
Returns:
True if the face can be on fire, false otherwise.

getFireSpreadSpeed

public int getFireSpreadSpeed(World world,
                              int x,
                              int y,
                              int z,
                              int metadata,
                              ForgeDirection face)
Called when fire is updating on a neighbor block. The higher the number returned, the faster fire will spread around this block.

Parameters:
world - The current world
x - The blocks X position
y - The blocks Y position
z - The blocks Z position
metadata - The blocks current metadata
face - The face that the fire is coming from
Returns:
A number that is used to determine the speed of fire growth around the block

isFireSource

public boolean isFireSource(World world,
                            int x,
                            int y,
                            int z,
                            int metadata,
                            ForgeDirection side)
Currently only called by fire when it is on top of this block. Returning true will prevent the fire from naturally dying during updating. Also prevents firing from dying from rain.

Parameters:
world - The current world
x - The blocks X position
y - The blocks Y position
z - The blocks Z position
metadata - The blocks current metadata
side - The face that the fire is coming from
Returns:
True if this block sustains fire, meaning it will never go out.

setBurnProperties

public static void setBurnProperties(int id,
                                     int encouragement,
                                     int flammability)
Called by BlockFire to setup the burn values of vanilla blocks.

Parameters:
id - The block id
encouragement - How much the block encourages fire to spread
flammability - how easy a block is to catch fire

hasTileEntity

public boolean hasTileEntity(int metadata)
Called throughout the code as a replacement for block instanceof BlockContainer Moving this to the Block base class allows for mods that wish to extend vinella blocks, and also want to have a tile entity on that block, may. Return true from this function to specify this block has a tile entity.

Parameters:
metadata - Metadata of the current block
Returns:
True if block has a tile entity, false otherwise

createTileEntity

public TileEntity createTileEntity(World world,
                                   int metadata)
Called throughout the code as a replacement for BlockContainer.getBlockEntity Return the same thing you would from that function. This will fall back to BlockContainer.getBlockEntity if this block is a BlockContainer.

Parameters:
metadata - The Metadata of the current block
Returns:
A instance of a class extending TileEntity

quantityDropped

public int quantityDropped(int meta,
                           int fortune,
                           Random random)
Metadata and fortune sensitive version, this replaces the old (int meta, Random rand) version in 1.1.

Parameters:
meta - Blocks Metadata
fortune - Current item fortune level
random - Random number generator
Returns:
The number of items to drop

getBlockDropped

public ArrayList<ItemStack> getBlockDropped(World world,
                                            int x,
                                            int y,
                                            int z,
                                            int metadata,
                                            int fortune)
This returns a complete list of items dropped from this block.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
metadata - Current metadata
fortune - Breakers fortune level
Returns:
A ArrayList containing all items this block drops

canSilkHarvest

public boolean canSilkHarvest(World world,
                              EntityPlayer player,
                              int x,
                              int y,
                              int z,
                              int metadata)
Return true from this function if the player with silk touch can harvest this block directly, and not it's normal drops.

Parameters:
world - The world
player - The player doing the harvesting
x - X Position
y - Y Position
z - Z Position
metadata - The metadata
Returns:
True if the block can be directly harvested using silk touch

canCreatureSpawn

public boolean canCreatureSpawn(EnumCreatureType type,
                                World world,
                                int x,
                                int y,
                                int z)
Determines if a specified mob type can spawn on this block, returning false will prevent any mob from spawning on the block.

Parameters:
type - The Mob Category Type
world - The current world
x - The X Position
y - The Y Position
z - The Z Position
Returns:
True to allow a mob of the specified category to spawn, false to prevent it.

isBed

public boolean isBed(World world,
                     int x,
                     int y,
                     int z,
                     EntityLiving player)
Determines if this block is classified as a Bed, Allowing players to sleep in it, though the block has to specifically perform the sleeping functionality in it's activated event.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
player - The player or camera entity, null in some cases.
Returns:
True to treat this as a bed

getBedSpawnPosition

public ChunkCoordinates getBedSpawnPosition(World world,
                                            int x,
                                            int y,
                                            int z,
                                            EntityPlayer player)
Returns the position that the player is moved to upon waking up, or respawning at the bed.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
player - The player or camera entity, null in some cases.
Returns:
The spawn position

setBedOccupied

public void setBedOccupied(World world,
                           int x,
                           int y,
                           int z,
                           EntityPlayer player,
                           boolean occupied)
Called when a user either starts or stops sleeping in the bed.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
player - The player or camera entity, null in some cases.
occupied - True if we are occupying the bed, or false if they are stopping use of the bed

getBedDirection

public int getBedDirection(IBlockAccess world,
                           int x,
                           int y,
                           int z)
Returns the direction of the block. Same values that are returned by BlockDirectional

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
Returns:
Bed direction

isBedFoot

public boolean isBedFoot(IBlockAccess world,
                         int x,
                         int y,
                         int z)
Determines if the current block is the foot half of the bed.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
Returns:
True if the current block is the foot side of a bed.

beginLeavesDecay

public void beginLeavesDecay(World world,
                             int x,
                             int y,
                             int z)
Called when a leaf should start its decay process.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position

canSustainLeaves

public boolean canSustainLeaves(World world,
                                int x,
                                int y,
                                int z)
Determines if this block can prevent leaves connected to it from decaying.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
Returns:
true if the presence this block can prevent leaves from decaying.

isLeaves

public boolean isLeaves(World world,
                        int x,
                        int y,
                        int z)
Determines if this block is considered a leaf block, used to apply the leaf decay and generation system.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
Returns:
true if this block is considered leaves.

canBeReplacedByLeaves

public boolean canBeReplacedByLeaves(World world,
                                     int x,
                                     int y,
                                     int z)
Used during tree growth to determine if newly generated leaves can replace this block.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
Returns:
true if this block can be replaced by growing leaves.

isWood

public boolean isWood(World world,
                      int x,
                      int y,
                      int z)
Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
Returns:
true if the block is wood (logs)

isGenMineableReplaceable

public boolean isGenMineableReplaceable(World world,
                                        int x,
                                        int y,
                                        int z)
Determines if the current block is replaceable by Ore veins during world generation.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
Returns:
True to allow this block to be replaced by a ore

getTextureFile

public String getTextureFile()
Grabs the current texture file used for this block


setTextureFile

public Block setTextureFile(String texture)
Sets the current texture file for this block, used when rendering. Default is "/terrain.png"

Parameters:
texture - The texture file

getExplosionResistance

public float getExplosionResistance(Entity par1Entity,
                                    World world,
                                    int x,
                                    int y,
                                    int z,
                                    double explosionX,
                                    double explosionY,
                                    double explosionZ)
Location sensitive version of getExplosionRestance

Parameters:
par1Entity - The entity that caused the explosion
world - The current world
x - X Position
y - Y Position
z - Z Position
explosionX - Explosion source X Position
explosionY - Explosion source X Position
explosionZ - Explosion source X Position
Returns:
The amount of the explosion absorbed.

canConnectRedstone

public boolean canConnectRedstone(IBlockAccess world,
                                  int x,
                                  int y,
                                  int z,
                                  int side)
Determine if this block can make a redstone connection on the side provided, Useful to control which sides are inputs and outputs for redstone wires. Side: -1: UP 0: NORTH 1: EAST 2: SOUTH 3: WEST

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
side - The side that is trying to make the connection
Returns:
True to make the connection

canPlaceTorchOnTop

public boolean canPlaceTorchOnTop(World world,
                                  int x,
                                  int y,
                                  int z)
Determines if a torch can be placed on the top surface of this block. Useful for creating your own block that torches can be on, such as fences.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z Position
Returns:
True to allow the torch to be placed

canRenderInPass

public boolean canRenderInPass(int pass)
Determines if this block should render in this pass.

Parameters:
pass - The pass in question
Returns:
True to render

getPickBlock

public ItemStack getPickBlock(MovingObjectPosition target,
                              World world,
                              int x,
                              int y,
                              int z)
Called when a user uses the creative pick block button on this block

Parameters:
target - The full target the player is looking at
Returns:
A ItemStack to add to the player's inventory, Null if nothing should be added.

isBlockFoliage

public boolean isBlockFoliage(World world,
                              int x,
                              int y,
                              int z)
Used by getTopSolidOrLiquidBlock while placing biome decorations, villages, etc Also used to determine if the player can spawn on this block.

Returns:
False to disallow spawning

addBlockHitEffects

public boolean addBlockHitEffects(World worldObj,
                                  MovingObjectPosition target,
                                  EffectRenderer effectRenderer)
Spawn a digging particle effect in the world, this is a wrapper around EffectRenderer.addBlockHitEffects to allow the block more control over the particles. Useful when you have entirely different texture sheets for different sides/locations in the world.

Parameters:
world - The current world
target - The target the player is looking at {x/y/z/side/sub}
effectRenderer - A reference to the current effect renderer.
Returns:
True to prevent vanilla digging particles form spawning.

addBlockDestroyEffects

public boolean addBlockDestroyEffects(World world,
                                      int x,
                                      int y,
                                      int z,
                                      int meta,
                                      EffectRenderer effectRenderer)
Spawn particles for when the block is destroyed. Due to the nature of how this is invoked, the x/y/z locations are not always guaranteed to host your block. So be sure to do proper sanity checks before assuming that the location is this block.

Parameters:
world - The current world
x - X position to spawn the particle
y - Y position to spawn the particle
z - Z position to spawn the particle
meta - The metadata for the block before it was destroyed.
effectRenderer - A reference to the current effect renderer.
Returns:
True to prevent vanilla break particles from spawning.

canSustainPlant

public boolean canSustainPlant(World world,
                               int x,
                               int y,
                               int z,
                               ForgeDirection direction,
                               IPlantable plant)
Determines if this block can support the passed in plant, allowing it to be planted and grow. Some examples: Reeds check if its a reed, or if its sand/dirt/grass and adjacent to water Cacti checks if its a cacti, or if its sand Nether types check for soul sand Crops check for tilled soil Caves check if it's a colid surface Plains check if its grass or dirt Water check if its still water

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z position
direction - The direction relative to the given position the plant wants to be, typically its UP
plant - The plant that wants to check
Returns:
True to allow the plant to be planted/stay.

isFertile

public boolean isFertile(World world,
                         int x,
                         int y,
                         int z)
Checks if this soil is fertile, typically this means that growth rates of plants on this soil will be slightly sped up. Only vanilla case is tilledField when it is within range of water.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z position
Returns:
True if the soil should be considered fertile.

getLightOpacity

public int getLightOpacity(World world,
                           int x,
                           int y,
                           int z)
Location aware and overrideable version of the lightOpacity array, return the number to subtract from the light value when it passes through this block. This is not guaranteed to have the tile entity in place before this is called, so it is Recommended that you have your tile entity call relight after being placed if you rely on it for light info.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z position
Returns:
The amount of light to block, 0 for air, 255 for fully opaque.

canDragonDestroy

public boolean canDragonDestroy(World world,
                                int x,
                                int y,
                                int z)
Determines if this block is destroyed when a ender dragon tries to fly through it. The block will be set to 0, nothing will drop.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z position
Returns:
True to allow the ender dragon to destroy this block

isBeaconBase

public boolean isBeaconBase(World worldObj,
                            int x,
                            int y,
                            int z,
                            int beaconX,
                            int beaconY,
                            int beaconZ)
Determines if this block can be used as the base of a beacon.

Parameters:
world - The current world
x - X Position
y - Y Position
z - Z position
beaconX - Beacons X Position
beaconY - Beacons Y Position
beaconZ - Beacons Z Position
Returns:
True, to support the beacon, and make it active with this block.