net.minecraft.block

## Class BlockRailBase

- java.lang.Object
- - net.minecraft.block.Block
  - - net.minecraft.block.BlockRailBase

- Direct Known Subclasses:
    BlockDetectorRail, BlockRail, BlockRailPowered

      public abstract class BlockRailBase
      extends Block

- - ### Field Summary

    - ### Fields inherited from class net.minecraft.block.Block

      `anvil, beacon, bed, bedrock, blockClay, blockDiamond, blockEmerald, blockGold, blockHardness, blockID, blockIron, blockLapis, blockMaterial, blockNetherQuartz, blockParticleGravity, blockRedstone, blockResistance, blocksList, blockSnow, bookShelf, brewingStand, brick, cactus, cake, canBlockGrass, carpet, carrot, cauldron, chest, chestTrapped, cloth, coalBlock, cobblestone, cobblestoneMossy, cobblestoneWall, cocoaPlant, commandBlock, crops, daylightSensor, deadBush, dirt, dispenser, doorIron, doorWood, dragonEgg, dropper, enchantmentTable, enderChest, endPortal, endPortalFrame, fence, fenceGate, fenceIron, fire, flowerPot, furnaceBurning, furnaceIdle, glass, glowStone, grass, gravel, hardenedClay, hay, hopperBlock, ice, jukebox, ladder, lavaMoving, lavaStill, leaves, lever, lightOpacity, lightValue, lockedChest, melon, melonStem, mobSpawner, mushroomBrown, mushroomCapBrown, mushroomCapRed, mushroomRed, music, mycelium, netherBrick, netherFence, netherrack, netherStalk, obsidian, opaqueCubeLookup, oreCoal, oreDiamond, oreEmerald, oreGold, oreIron, oreLapis, oreNetherQuartz, oreRedstone, oreRedstoneGlowing, pistonBase, pistonExtension, pistonMoving, pistonStickyBase, planks, plantRed, plantYellow, portal, potato, pressurePlateGold, pressurePlateIron, pressurePlatePlanks, pressurePlateStone, pumpkin, pumpkinLantern, pumpkinStem, rail, railActivator, railDetector, railPowered, redstoneComparatorActive, redstoneComparatorIdle, redstoneLampActive, redstoneLampIdle, redstoneRepeaterActive, redstoneRepeaterIdle, redstoneWire, reed, sand, sandStone, sapling, signPost, signWall, silverfish, skull, slipperiness, slowSand, snow, soundAnvilFootstep, soundClothFootstep, soundGlassFootstep, soundGrassFootstep, soundGravelFootstep, soundLadderFootstep, soundMetalFootstep, soundPowderFootstep, soundSandFootstep, soundSnowFootstep, soundStoneFootstep, soundWoodFootstep, sponge, stainedClay, stairsBrick, stairsCobblestone, stairsNetherBrick, stairsNetherQuartz, stairsSandStone, stairsStoneBrick, stairsWoodBirch, stairsWoodJungle, stairsWoodOak, stairsWoodSpruce, stepSound, stone, stoneBrick, stoneButton, stoneDoubleSlab, stoneSingleSlab, tallGrass, thinGlass, tilledField, tnt, torchRedstoneActive, torchRedstoneIdle, torchWood, trapdoor, tripWire, tripWireSource, useNeighborBrightness, vine, waterlily, waterMoving, waterStill, web, whiteStone, wood, woodDoubleSlab, woodenButton, woodSingleSlab, workbench`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)` Called on server worlds only when the block has been replaced by a different block ID, or the same block with a different metadata value, but before the new metadata value is set.
    `boolean` | `canMakeSlopes(World world, int x, int y, int z)` Returns true if the rail can make up and down slopes.
    `boolean` | `canPlaceBlockAt(World par1World, int par2, int par3, int par4)` Checks to see if its valid to put this block at the specified coordinates.
    `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` | `getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z)` Return the rail's metadata (without the power bit if the rail uses one).
    `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)
    `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
    `float` | `getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z)` Returns the max speed of the rail at the specified position.
    `int` | `getRenderType()` The type of render function that is called for this block
    `boolean` | `isFlexibleRail(World world, int y, int x, int z)` Return true if the rail can make corners.
    `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` | `isPowered()` Returns true if the block is power related rail.
    `static boolean` | `isRailBlock(int par0)` Return true if the parameter is a blockID for a valid rail block (current is rail, powered or detector).
    `static boolean` | `isRailBlockAt(World par0World, int par1, int par2, int par3)` Returns true if the block at the coordinates of world passed is a valid rail block (current is rail, powered or detector).
    `void` | `onBlockAdded(World par1World, int par2, int par3, int par4)` Called whenever the block is added into the world.
    `void` | `onMinecartPass(World world, EntityMinecart cart, int y, int x, int z)` This function is called by any minecart that passes over this rail.
    `void` | `onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)` Lets the block know when one of its neighbor changes.
    `int` | `quantityDropped(Random par1Random)` Returns the quantity of items to drop on block destruction.
    `boolean` | `renderAsNormalBlock()` If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
    `void` | `setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)` Updates the blocks bounds based on its current state.
    `void` | `setRenderType(int value)`

    - ### Methods inherited from class net.minecraft.block.Block

      `addBlockDestroyEffects, addBlockHitEffects, addCollisionBoxesToList, addCreativeItems, beginLeavesDecay, canBeReplacedByLeaves, canBlockStay, canCollideCheck, canConnectRedstone, canCreatureSpawn, canDragonDestroy, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canPlaceBlockOnSide, canPlaceBlockOnSide, canPlaceTorchOnTop, canProvidePower, canRenderInPass, canSilkHarvest, canSustainLeaves, canSustainPlant, colorMultiplier, createTileEntity, damageDropped, dropBlockAsItem, dropBlockAsItemWithChance, dropXpOnBlockBreak, fillWithRain, func_82506_l, getAmbientOcclusionLightValue, getBedDirection, getBedSpawnPosition, getBlockBoundsMaxX, getBlockBoundsMaxY, getBlockBoundsMaxZ, getBlockBoundsMinX, getBlockBoundsMinY, getBlockBoundsMinZ, getBlockBrightness, getBlockColor, getBlockDropped, getBlockHardness, getBlocksMovement, getBlockTexture, getBlockTextureFromSide, getComparatorInputOverride, getCreativeTabToDisplayOn, getDamageValue, getEnableStats, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getExplosionResistance, getFilledPercentage, getFireSpreadSpeed, getFlammability, getIcon, getItemIconName, getLightOpacity, getLightValue, getLocalizedName, getMixedBrightnessForBlock, getPickBlock, getPlayerRelativeBlockHardness, getRenderBlockPass, getRenderColor, getSelectedBoundingBoxFromPool, getSubBlocks, getTickRandomly, getUnlocalizedName, getValidRotations, harvestBlock, hasComparatorInputOverride, hasTileEntity, hasTileEntity, idDropped, idPicked, isAirBlock, isAssociatedBlockID, isAssociatedBlockID, isBeaconBase, isBed, isBedFoot, isBlockBurning, isBlockFoliage, isBlockNormalCube, isBlockReplaceable, isBlockSolid, isBlockSolidOnSide, isCollidable, isFertile, isFireSource, isFlammable, isFlowerPot, isGenMineableReplaceable, isLadder, isLeaves, isNormalCube, isProvidingStrongPower, isProvidingWeakPower, isWood, onBlockActivated, onBlockClicked, onBlockDestroyedByExplosion, onBlockDestroyedByPlayer, onBlockEventReceived, onBlockExploded, onBlockHarvested, onBlockPlaced, onBlockPlacedBy, onBlockPreDestroy, onEntityCollidedWithBlock, onEntityWalking, onFallenUpon, onNeighborTileChange, onPlantGrow, onPostBlockPlaced, quantityDropped, quantityDroppedWithBonus, randomDisplayTick, recolourBlock, registerIcons, removeBlockByPlayer, rotateBlock, setBedOccupied, setBlockBounds, setBlockBoundsForItemRender, setBlockUnbreakable, setBurnProperties, setCreativeTab, setHardness, setLightOpacity, setLightValue, setResistance, setStepSound, setTextureName, setTickRandomly, setUnlocalizedName, shouldCheckWeakPower, shouldSideBeRendered, tickRate, updateTick, velocityToAddToEntity, weakTileChanges`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### isRailBlockAt

          public static final boolean isRailBlockAt(World par0World,
                              int par1,
                              int par2,
                              int par3)

      Returns true if the block at the coordinates of world passed is a valid rail block (current is rail, powered or detector).

    - #### isRailBlock

          public static final boolean isRailBlock(int par0)

      Return true if the parameter is a blockID for a valid rail block (current is rail, powered or detector).

    - #### isPowered

          public boolean isPowered()

      Returns true if the block is power related rail.

    - #### 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)
      Overrides:
        `getCollisionBoundingBoxFromPool` in class `Block`

    - #### 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.
      Overrides:
        `isOpaqueCube` in class `Block`

    - #### 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
      Overrides:
        `collisionRayTrace` in class `Block`

    - #### 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
      Overrides:
        `setBlockBoundsBasedOnState` in class `Block`

    - #### renderAsNormalBlock

          public boolean renderAsNormalBlock()

      If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
      Overrides:
        `renderAsNormalBlock` in class `Block`

    - #### getRenderType

          public int getRenderType()

      The type of render function that is called for this block
      Overrides:
        `getRenderType` in class `Block`

    - #### quantityDropped

          public int quantityDropped(Random par1Random)

      Returns the quantity of items to drop on block destruction.
      Overrides:
        `quantityDropped` in class `Block`

    - #### 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
      Overrides:
        `canPlaceBlockAt` in class `Block`

    - #### 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
      Overrides:
        `onBlockAdded` in class `Block`

    - #### 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
      Overrides:
        `onNeighborBlockChange` in class `Block`

    - #### 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
      Overrides:
        `getMobilityFlag` in class `Block`

    - #### breakBlock

          public void breakBlock(World par1World,
                        int par2,
                        int par3,
                        int par4,
                        int par5,
                        int par6)

      Called on server worlds only when the block has been replaced by a different block ID, or the same block with a different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata
      Overrides:
        `breakBlock` in class `Block`

    - #### isFlexibleRail

          public boolean isFlexibleRail(World world,
                               int y,
                               int x,
                               int z)

      Return true if the rail can make corners. Used by placement logic.
      Parameters:
        `world` - The world.
        `x` - The rail X coordinate.
        `y` - The rail Y coordinate.
        `z` - The rail Z coordinate.
      Returns:
        True if the rail can make corners.

    - #### canMakeSlopes

          public boolean canMakeSlopes(World world,
                              int x,
                              int y,
                              int z)

      Returns true if the rail can make up and down slopes. Used by placement logic.
      Parameters:
        `world` - The world.
        `x` - The rail X coordinate.
        `y` - The rail Y coordinate.
        `z` - The rail Z coordinate.
      Returns:
        True if the rail can make slopes.

    - #### getBasicRailMetadata

          public int getBasicRailMetadata(IBlockAccess world,
                                 EntityMinecart cart,
                                 int x,
                                 int y,
                                 int z)

      Return the rail's metadata (without the power bit if the rail uses one). Can be used to make the cart think the rail something other than it is, for example when making diamond junctions or switches. The cart parameter will often be null unless it it called from EntityMinecart. Valid rail metadata is defined as follows: 0x0: flat track going North-South 0x1: flat track going West-East 0x2: track ascending to the East 0x3: track ascending to the West 0x4: track ascending to the North 0x5: track ascending to the South 0x6: WestNorth corner (connecting East and South) 0x7: EastNorth corner (connecting West and South) 0x8: EastSouth corner (connecting West and North) 0x9: WestSouth corner (connecting East and North)
      Parameters:
        `world` - The world.
        `cart` - The cart asking for the metadata, null if it is not called by EntityMinecart.
        `y` - The rail X coordinate.
        `x` - The rail Y coordinate.
        `z` - The rail Z coordinate.
      Returns:
        The metadata.

    - #### getRailMaxSpeed

          public float getRailMaxSpeed(World world,
                              EntityMinecart cart,
                              int y,
                              int x,
                              int z)

      Returns the max speed of the rail at the specified position.
      Parameters:
        `world` - The world.
        `cart` - The cart on the rail, may be null.
        `x` - The rail X coordinate.
        `y` - The rail Y coordinate.
        `z` - The rail Z coordinate.
      Returns:
        The max speed of the current rail.

    - #### onMinecartPass

          public void onMinecartPass(World world,
                            EntityMinecart cart,
                            int y,
                            int x,
                            int z)

      This function is called by any minecart that passes over this rail. It is called once per update tick that the minecart is on the rail.
      Parameters:
        `world` - The world.
        `cart` - The cart on the rail.
        `y` - The rail X coordinate.
        `x` - The rail Y coordinate.
        `z` - The rail Z coordinate.

    - #### setRenderType

          public void setRenderType(int value)