Class BlockRedstoneLogic

Direct Known Subclasses:
BlockComparator, BlockRedstoneRepeater

public abstract class BlockRedstoneLogic extends BlockDirectional
  • Field Details

    • isRepeaterPowered

      protected final boolean isRepeaterPowered
      Tells whether the repeater is powered or not
  • Constructor Details

    • BlockRedstoneLogic

      protected BlockRedstoneLogic(int par1, boolean par2)
  • Method Details

    • 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
    • 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
    • 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.
      Overrides:
      canBlockStay in class Block
    • updateTick

      public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
      Ticks the block if it's been scheduled
      Overrides:
      updateTick in class Block
    • 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
    • shouldSideBeRendered

      public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
      Returns true if the given side of this block type should be rendered, if the adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side
      Overrides:
      shouldSideBeRendered in class Block
    • getRenderType

      public int getRenderType()
      The type of render function that is called for this block
      Overrides:
      getRenderType in class Block
    • func_96470_c

      protected boolean func_96470_c(int par1)
    • isProvidingStrongPower

      public int 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.
      Overrides:
      isProvidingStrongPower in class Block
    • isProvidingWeakPower

      public int 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.
      Overrides:
      isProvidingWeakPower 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
    • func_94479_f

      protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5)
    • func_94476_e

      public boolean func_94476_e(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
    • isGettingInput

      protected boolean isGettingInput(World par1World, int par2, int par3, int par4, int par5)
    • getInputStrength

      protected int getInputStrength(World par1World, int par2, int par3, int par4, int par5)
      Returns the signal strength at one input of the block. Args: world, X, Y, Z, side
    • func_94482_f

      protected int func_94482_f(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
    • func_94488_g

      protected int func_94488_g(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
    • canProvidePower

      public boolean canProvidePower()
      Can this block provide power. Only wire currently seems to have this change based on its state.
      Overrides:
      canProvidePower in class Block
    • onBlockPlacedBy

      public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
      Called when the block is placed in the world.
      Overrides:
      onBlockPlacedBy 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
    • func_94483_i_

      protected void func_94483_i_(World world, int x, int y, int z)
    • 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
      Overrides:
      onBlockDestroyedByPlayer 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
    • func_94477_d

      protected boolean func_94477_d(int par1)
    • func_94480_d

      protected int func_94480_d(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
    • isRedstoneRepeaterBlockID

      public static boolean isRedstoneRepeaterBlockID(int par0)
    • func_94487_f

      public boolean func_94487_f(int par1)
    • func_83011_d

      public boolean func_83011_d(World par1World, int par2, int par3, int par4, int par5)
    • func_94486_g

      protected int func_94486_g(int par1)
    • func_94481_j_

      protected abstract int func_94481_j_(int var1)
    • func_94485_e

      protected abstract BlockRedstoneLogic func_94485_e()
    • func_94484_i

      protected abstract BlockRedstoneLogic func_94484_i()
    • isAssociatedBlockID

      public boolean isAssociatedBlockID(int par1)
      Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and redstoneTorchOff, and vice versa. Most blocks only match themselves.
      Overrides:
      isAssociatedBlockID in class Block
    • updateNeighborsInDirection

      protected void updateNeighborsInDirection(World world, int x, int y, int z, int direction)
    • onBlockPlaced

      public int onBlockPlaced(World world, int x, int y, int z, int facing, float clickX, float clickY, float clickZ, int metadata)
      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
    • triggersBuddy

      public boolean triggersBuddy()
      Description copied from class: Block
      Whether or not the block sets off Buddy Blocks. Set to false for stuff like redstone blocks that can cause feedback loops.
      Overrides:
      triggersBuddy in class Block
    • canRotateOnTurntable

      public boolean canRotateOnTurntable(IBlockAccess blockAccess, int x, int y, int z)
      Overrides:
      canRotateOnTurntable in class Block
    • rotateAroundJAxis

      public boolean rotateAroundJAxis(World world, int x, int y, int z, boolean reverse)
      Description copied from class: Block
      Returns true if the facing has actually changed as a result of this call
      Overrides:
      rotateAroundJAxis in class Block
    • renderBlock

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