Exemplo n.º 1
0
  @Override
  /** Rotates safe so that it faces player. */
  protected boolean onHammerLeftClick(TEBase TE, EntityPlayer entityPlayer) {
    int facing = BlockProperties.getOppositeFacing(entityPlayer);
    ForgeDirection dir = BlockProperties.getDirectionFromFacing(facing);

    if (dir != Safe.getFacing(TE)) {
      Safe.setFacing(TE, facing);
      return true;
    } else {
      return false;
    }
  }
Exemplo n.º 2
0
  @Override
  /**
   * Checks if the block is a solid face on the given side, used by placement logic.
   *
   * @param world The current world
   * @param x X Position
   * @param y Y position
   * @param z Z position
   * @param side The side to check
   * @return True if the block is solid on the specified side.
   */
  public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
    TEBase TE = getTileEntityStrict(world, x, y, z);

    if (TE != null) {
      if (isBlockSolid(world, x, y, z)) {
        return side != Safe.getFacing(TE);
      }
    }

    return false;
  }