Class BlockJukeBox

All Implemented Interfaces:
MechanicalBlock, ITileEntityProvider

public class BlockJukeBox extends BlockContainer implements MechanicalBlock
Metadata: 0b1100 - Tilt 0b0010 - Disk 0b0001 - Powered
  • Constructor Details

    • BlockJukeBox

      protected BlockJukeBox(int par1)
  • Method Details

    • tickRate

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

      public void onBlockAdded(World world, int i, int j, int k)
      Schedules initial block update
      Overrides:
      onBlockAdded in class BlockContainer
    • updateTick

      public void updateTick(World world, int i, int j, int k, Random rand)
      Update tick, checks for mechanical power and handles jukebox tipping
      Overrides:
      updateTick in class Block
    • onNeighborBlockChange

      public void onNeighborBlockChange(@NotNull @NotNull 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
    • getFacing

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

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

      public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int iFacing, float fClickX, float fClickY, float fClickZ)
      Called upon block activation (right click on the block.)
      Overrides:
      onBlockActivated in class Block
    • insertRecord

      public void insertRecord(World world, int x, int y, int z, ItemStack stack)
      Insert the specified music disc in the jukebox at the given coordinates
    • ejectRecord

      public void ejectRecord(EntityPlayer player, World world, int x, int y, int z)
      Ejects the current record inside the jukebox.
    • onEntityCollidedWithBlock

      public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
      Disk insertion from world functionality
      Overrides:
      onEntityCollidedWithBlock 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 BlockContainer
    • dropBlockAsItemWithChance

      public void dropBlockAsItemWithChance(World world, int x, int y, int z, int par5, float par6, int par7)
      Drops the block items with a specified chance of dropping the specified items
      Overrides:
      dropBlockAsItemWithChance in class Block
    • createNewTileEntity

      public TileEntity createNewTileEntity(World world)
      Returns a new instance of a block's tile entity class. Called on placing the block.
      Specified by:
      createNewTileEntity in interface ITileEntityProvider
    • hasComparatorInputOverride

      public boolean hasComparatorInputOverride()
      If this returns true, then comparators facing away from this block will use the value from getComparatorInputOverride instead of the actual redstone signal strength.
      Overrides:
      hasComparatorInputOverride in class Block
    • getComparatorInputOverride

      public int getComparatorInputOverride(World world, int x, int y, int z, int par5)
      If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal strength when this block inputs to a comparator.
      Overrides:
      getComparatorInputOverride in class Block
    • canOutputMechanicalPower

      public boolean canOutputMechanicalPower()
      Specified by:
      canOutputMechanicalPower in interface MechanicalBlock
    • canInputMechanicalPower

      public boolean canInputMechanicalPower()
      Specified by:
      canInputMechanicalPower in interface MechanicalBlock
    • isInputtingMechanicalPower

      public boolean isInputtingMechanicalPower(World world, int i, int j, int k)
      Specified by:
      isInputtingMechanicalPower in interface MechanicalBlock
    • isOutputtingMechanicalPower

      public boolean isOutputtingMechanicalPower(World world, int i, int j, int k)
      Specified by:
      isOutputtingMechanicalPower in interface MechanicalBlock
    • canInputAxlePowerToFacing

      public boolean canInputAxlePowerToFacing(World world, int i, int j, int k, int iFacing)
      Specified by:
      canInputAxlePowerToFacing in interface MechanicalBlock
    • overpower

      public void overpower(World world, int i, int j, int k)
      Specified by:
      overpower in interface MechanicalBlock
    • getTiltFacing

      public int getTiltFacing(IBlockAccess iBlockAccess, int i, int j, int k)
      Gets the current horizontal tilt of the jukebox
    • getTiltFacing

      public int getTiltFacing(int metadata)
      Gets the current horizontal tilt of the jukebox
    • setTiltFacing

      public void setTiltFacing(World world, int i, int j, int k, int iFacing)
      Sets the current horizontal tilt of the jukebox.
    • isPowered

      public boolean isPowered(IBlockAccess iBlockAccess, int i, int j, int k)
      true if jukebox is powered.
    • isPowered

      public boolean isPowered(int meta)
      true if jukebox is powered.
    • getHasDiskFlag

      public boolean getHasDiskFlag(IBlockAccess iBlockAccess, int i, int j, int k)
      true if this jukebox contains a disk
    • setHasDiskFlag

      public void setHasDiskFlag(World world, int i, int j, int k, boolean bFlag)
      true if this jukebox contains a disk
    • 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

      @Environment(CLIENT) public Icon getIcon(int side, int meta)
      From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
      Overrides:
      getIcon in class Block
    • renderBlock

      public boolean renderBlock(RenderBlocks renderer, int i, int j, int k)
      Overrides:
      renderBlock in class Block