Class BlockDoor

java.lang.Object
net.minecraft.src.Block
net.minecraft.src.BlockDoor
Direct Known Subclasses:
DoorBlockWood

public class BlockDoor extends Block
  • Field Details

    • doorSoundID

      protected int doorSoundID
  • Constructor Details

    • BlockDoor

      protected BlockDoor(int par1, Material par2Material)
  • Method Details

    • setDoorSound

      protected void setDoorSound(Material par2Material)
    • getIcon

      public Icon getIcon(int par1, int par2)
      From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
      Overrides:
      getIcon in class Block
    • getBlockTexture

      public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
      Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
      Overrides:
      getBlockTexture in class Block
    • registerIcons

      public void registerIcons(IconRegister par1IconRegister)
      When this method is called, your block should register all the icons it needs with the given IconRegister. This is the only chance you get to register icons.
      Overrides:
      registerIcons 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
    • getBlocksMovement

      public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
      Description copied from class: Block
      FCNOTE: This is misnamed and returns true if the block *doesn't* block movement
      Overrides:
      getBlocksMovement 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
    • getSelectedBoundingBoxFromPool

      @Environment(CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z)
      Returns the bounding box of the wired rectangular prism to render.
      Overrides:
      getSelectedBoundingBoxFromPool in class Block
    • getCollisionBoundingBoxFromPool

      public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
      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
    • 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
    • getBlockBoundsFromPoolBasedOnState

      public AxisAlignedBB getBlockBoundsFromPoolBasedOnState(IBlockAccess blockAccess, int x, int y, int z)
      Overrides:
      getBlockBoundsFromPoolBasedOnState in class Block
    • getDoorOrientation

      public int getDoorOrientation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
      Returns 0, 1, 2 or 3 depending on where the hinge is.
    • isDoorOpen

      public boolean isDoorOpen(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
    • isBottomDoorPart

      public boolean isBottomDoorPart(IBlockAccess blockAccess, int x, int y, int z)
    • isBottomDoorPart

      public boolean isBottomDoorPart(int 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
      Overrides:
      onBlockClicked in class Block
    • 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.)
      Overrides:
      onBlockActivated in class Block
    • onPoweredBlockChange

      public void onPoweredBlockChange(World world, int x, int y, int z, boolean open)
      A function to open a door.
    • onNeighborBlockChange

      public void onNeighborBlockChange(World world, int x, int y, int z, int neighborID)
      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
    • onDestroyedByFire

      public void onDestroyedByFire(World world, int x, int y, int z, int fireAge, boolean forcedFireSpread)
      Overrides:
      onDestroyedByFire in class Block
    • getCanBlockBeIncinerated

      public boolean getCanBlockBeIncinerated(World world, int i, int j, int k)
      Description copied from class: Block
      Used by Hibachi to determine if it can remove the block above it when lit
      Overrides:
      getCanBlockBeIncinerated in class Block
    • getPreventsFluidFlow

      public boolean getPreventsFluidFlow(World world, int i, int j, int k, Block fluidBlock)
      Overrides:
      getPreventsFluidFlow in class Block
    • idDropped

      public int idDropped(int par1, Random par2Random, int par3)
      Returns the ID of the items to drop on destruction.
      Overrides:
      idDropped in class Block
    • collisionRayTrace

      public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startRay, Vec3 endRay)
      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
    • shouldOffsetPositionIfPathingOutOf

      public boolean shouldOffsetPositionIfPathingOutOf(IBlockAccess blockAccess, int x, int y, int z, Entity entity, PathFinder pathFinder)
      Description copied from class: Block
      Used to determine if entities who start their pathing from within this block should instead start pathing from a neighbor block instead, to prevent getting stuck in this one. Mostly applies to stuff like chickens getting stuck in fences.
      Overrides:
      shouldOffsetPositionIfPathingOutOf 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
    • 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
    • getFullMetadata

      public int getFullMetadata(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
      Returns the full metadata value created by combining the metadata of both blocks the door takes up.
    • idPicked

      public int idPicked(World par1World, int par2, int par3, int par4)
      only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
      Overrides:
      idPicked in class Block
    • 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
      Overrides:
      onBlockHarvested in class Block
    • onAIOpenDoor

      public void onAIOpenDoor(World world, int i, int j, int k, boolean bOpen)
    • renderBlock

      @Environment(CLIENT) public boolean renderBlock(RenderBlocks renderer, int i, int j, int k)
      Overrides:
      renderBlock in class Block
    • shouldSideBeRendered

      @Environment(CLIENT) public boolean shouldSideBeRendered(IBlockAccess blockAccess, int iNeighborI, int iNeighborJ, int iNeighborK, int iSide)
      Overrides:
      shouldSideBeRendered in class Block