Class CampfireBlock

All Implemented Interfaces:
ITileEntityProvider

public class CampfireBlock extends BlockContainer
  • Field Details

    • fireLevel

      public final int fireLevel
    • CAMPFIRE_FUEL_STATE_NORMAL

      public static final int CAMPFIRE_FUEL_STATE_NORMAL
      See Also:
    • CAMPFIRE_FUEL_STATE_BURNED_OUT

      public static final int CAMPFIRE_FUEL_STATE_BURNED_OUT
      See Also:
    • CAMPFIRE_FUEL_STATE_SMOULDERING

      public static final int CAMPFIRE_FUEL_STATE_SMOULDERING
      See Also:
    • fireLevelBlockArray

      public static CampfireBlock[] fireLevelBlockArray
    • campfireChangingState

      public static boolean campfireChangingState
  • Constructor Details

    • CampfireBlock

      public CampfireBlock(int iBlockID, int iFireLevel)
  • Method Details

    • createNewTileEntity

      public TileEntity createNewTileEntity(World world)
      Description copied from interface: ITileEntityProvider
      Returns a new instance of a block's tile entity class. Called on placing the block.
    • breakBlock

      public void breakBlock(World world, int i, int j, int k, int iBlockID, int iMetadata)
      Description copied from class: BlockContainer
      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 BlockContainer
    • isOpaqueCube

      public boolean isOpaqueCube()
      Description copied from class: Block
      // +++START EDIT+++ // ---END EDIT--- 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
    • renderAsNormalBlock

      public boolean renderAsNormalBlock()
      Description copied from class: Block
      If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
      Overrides:
      renderAsNormalBlock in class Block
    • getCollisionBoundingBoxFromPool

      public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
      Overrides:
      getCollisionBoundingBoxFromPool in class Block
    • getBlockBoundsFromPoolBasedOnState

      public AxisAlignedBB getBlockBoundsFromPoolBasedOnState(IBlockAccess blockAccess, int i, int j, int k)
      Overrides:
      getBlockBoundsFromPoolBasedOnState in class Block
    • canSilkHarvest

      protected boolean canSilkHarvest()
      Description copied from class: Block
      Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
      Overrides:
      canSilkHarvest in class Block
    • canPlaceBlockAt

      public boolean canPlaceBlockAt(World world, int i, int j, int k)
      Description copied from class: Block
      Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
      Overrides:
      canPlaceBlockAt in class Block
    • onBlockPlaced

      public int onBlockPlaced(World world, int i, int j, int k, int iFacing, float fClickX, float fClickY, float fClickZ, int iMetadata)
      Description copied from class: Block
      Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
      Overrides:
      onBlockPlaced in class Block
    • onBlockPlacedBy

      public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack stack)
      Description copied from class: Block
      Called when the block is placed in the world. // +++START EDIT+++ FCNOTE: Called AFTER the block is placed, unlike onBlockPlaced() // ---END EDIT---
      Overrides:
      onBlockPlacedBy in class Block
    • idDropped

      public int idDropped(int iMetadata, Random rand, int iFortuneModifier)
      Description copied from class: Block
      Returns the ID of the items to drop on destruction.
      Overrides:
      idDropped in class Block
    • tickRate

      public int tickRate(World world)
      Description copied from class: Block
      How many world ticks before ticking
      Overrides:
      tickRate in class Block
    • onNeighborBlockChange

      public void onNeighborBlockChange(World world, int i, int j, int k, int iBlockID)
      Description copied from class: Block
      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 // +++START EDIT+++ FCNOTE: Only called on server // ---END EDIT---
      Overrides:
      onNeighborBlockChange in class Block
    • updateTick

      public void updateTick(World world, int i, int j, int k, Random rand)
      Description copied from class: Block
      Ticks the block if it's been scheduled // +++START EDIT+++ FCNOTE: Called on server only // ---END EDIT---
      Overrides:
      updateTick in class Block
    • getCanBeSetOnFireDirectly

      public boolean getCanBeSetOnFireDirectly(IBlockAccess blockAccess, int i, int j, int k)
      Description copied from class: Block
      Whether the block itself can be set on fire, rather than a neighboring block being set to a fire block
      Overrides:
      getCanBeSetOnFireDirectly in class Block
    • setOnFireDirectly

      public boolean setOnFireDirectly(World world, int x, int y, int z)
      Overrides:
      setOnFireDirectly in class Block
    • getChanceOfFireSpreadingDirectlyTo

      public int getChanceOfFireSpreadingDirectlyTo(IBlockAccess blockAccess, int i, int j, int k)
      Overrides:
      getChanceOfFireSpreadingDirectlyTo in class Block
    • onBlockActivated

      public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int iFacing, float fXClick, float fYClick, float fZClick)
      Description copied from class: Block
      Called upon block activation (right click on the block.)
      Overrides:
      onBlockActivated in class Block
    • shouldDeleteTileEntityOnBlockChange

      public boolean shouldDeleteTileEntityOnBlockChange(int iNewBlockID)
      Overrides:
      shouldDeleteTileEntityOnBlockChange in class Block
    • onEntityCollidedWithBlock

      public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
      Description copied from class: Block
      Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
      Overrides:
      onEntityCollidedWithBlock in class Block
    • getDoesFireDamageToEntities

      public boolean getDoesFireDamageToEntities(World world, int i, int j, int k, Entity entity)
      Overrides:
      getDoesFireDamageToEntities in class Block
    • getCanBlockLightItemOnFire

      public boolean getCanBlockLightItemOnFire(IBlockAccess blockAccess, int i, int j, int k)
      Overrides:
      getCanBlockLightItemOnFire in class Block
    • collisionRayTrace

      public MovingObjectPosition collisionRayTrace(World world, int i, int j, int k, Vec3 startRay, Vec3 endRay)
      Overrides:
      collisionRayTrace in class Block
    • onFluidFlowIntoBlock

      public void onFluidFlowIntoBlock(World world, int i, int j, int k, BlockFluid newBlock)
      Overrides:
      onFluidFlowIntoBlock in class Block
    • canBeCrushedByFallingEntity

      public boolean canBeCrushedByFallingEntity(World world, int i, int j, int k, EntityFallingSand entity)
      Overrides:
      canBeCrushedByFallingEntity in class Block
    • onCrushedByFallingEntity

      public void onCrushedByFallingEntity(World world, int i, int j, int k, EntityFallingSand entity)
      Overrides:
      onCrushedByFallingEntity in class Block
    • getFacing

      public int getFacing(int iMetadata)
      Overrides:
      getFacing in class Block
    • setFacing

      public int setFacing(int iMetadata, int iFacing)
      Overrides:
      setFacing in class Block
    • canRotateOnTurntable

      public boolean canRotateOnTurntable(IBlockAccess iBlockAccess, int i, int j, int k)
      Overrides:
      canRotateOnTurntable in class Block
    • rotateAroundJAxis

      public boolean rotateAroundJAxis(World world, int i, int j, int k, boolean bReverse)
      Description copied from class: Block
      Returns true if the facing has actually changed as a result of this call
      Overrides:
      rotateAroundJAxis in class Block
    • rotateMetadataAroundYAxis

      public int rotateMetadataAroundYAxis(int iMetadata, boolean bReverse)
      Overrides:
      rotateMetadataAroundYAxis in class Block
    • canGroundCoverRestOnBlock

      public boolean canGroundCoverRestOnBlock(World world, int i, int j, int k)
      Overrides:
      canGroundCoverRestOnBlock in class Block
    • groundCoverRestingOnVisualOffset

      public float groundCoverRestingOnVisualOffset(IBlockAccess blockAccess, int i, int j, int k)
      Overrides:
      groundCoverRestingOnVisualOffset in class Block
    • setIAligned

      public void setIAligned(World world, int i, int j, int k, boolean bIAligned)
    • setIAligned

      public int setIAligned(int iMetadata, boolean bIAligned)
    • getIsIAligned

      public boolean getIsIAligned(IBlockAccess blockAccess, int i, int j, int k)
    • getIsIAligned

      public boolean getIsIAligned(int iMetadata)
    • isFacingIAligned

      public boolean isFacingIAligned(int iFacing)
    • setHasSpit

      public void setHasSpit(World world, int i, int j, int k, boolean bHasSpit)
    • setHasSpit

      public int setHasSpit(int iMetadata, boolean bHasSpit)
    • getHasSpit

      public boolean getHasSpit(IBlockAccess blockAccess, int i, int j, int k)
    • getHasSpit

      public boolean getHasSpit(int iMetadata)
    • setFuelState

      public void setFuelState(World world, int i, int j, int k, int iCampfireState)
    • setFuelState

      public int setFuelState(int iMetadata, int iCampfireState)
    • getFuelState

      public int getFuelState(IBlockAccess blockAccess, int i, int j, int k)
    • getFuelState

      public int getFuelState(int iMetadata)
    • isValidCookItem

      public boolean isValidCookItem(ItemStack stack)
    • extinguishFire

      public void extinguishFire(World world, int i, int j, int k, boolean bSmoulder)
    • relightFire

      public void relightFire(World world, int i, int j, int k)
    • stopSmouldering

      public void stopSmouldering(World world, int i, int j, int k)
    • changeFireLevel

      public void changeFireLevel(World world, int i, int j, int k, int iFireLevel, int iMetadata)
    • isRainingOnCampfire

      public boolean isRainingOnCampfire(World world, int i, int j, int k)
    • idPicked

      @Environment(CLIENT) public int idPicked(World world, int x, int y, int z)
      Description copied from class: Block
      only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) // +++START EDIT+++ FCNOTE: Client only // ---END EDIT---
      Overrides:
      idPicked in class Block
    • registerIcons

      @Environment(CLIENT) public void registerIcons(IconRegister register)
      Description copied from class: Block
      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
    • getIcon

      public Icon getIcon(int side, int meta)
      Description copied from class: Block
      From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
      Overrides:
      getIcon in class Block
    • shouldSideBeRendered

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

      @Environment(CLIENT) public CampfireModel getBlockModel()
      Gets appropriate block model
    • renderBlock

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

      @Environment(CLIENT) public void renderBlockSecondPass(RenderBlocks renderer, int i, int j, int k, boolean bFirstPassResult)
      Description copied from class: Block
      If the block has a second pass, like a kiln cooking overlay texture, it should Override this method. This method does not call the overlay by default to cut down on rendering time, since this function is called by every single loaded block. Note that this function is necessary to prevent potential recursion within RenderBlock, if it were to call its own overlays directly, and then potentially get called with a texture overlay itself through RenderBlockWithTexture.
      Overrides:
      renderBlockSecondPass in class Block
    • renderBlockAsItem

      @Environment(CLIENT) public void renderBlockAsItem(RenderBlocks render, int iItemDamage, float fBrightness)
      Overrides:
      renderBlockAsItem in class Block
    • randomDisplayTick

      @Environment(CLIENT) public void randomDisplayTick(World world, int i, int j, int k, Random rand)
      Description copied from class: Block
      A randomly called display update to be able to add particles or other items for display
      Overrides:
      randomDisplayTick in class Block