Module: Fishbans::PlayerSkins

Included in:
Fishbans
Defined in:
lib/player_skins.rb

Instance Method Summary collapse

Instance Method Details

#get_player_front(username, size = 100) ⇒ ChunkyPNG::Image

Gets the image for the entire front of the player.

Parameters:

  • username (String)

    See #get_player_head.

  • size (Integer) (defaults to: 100)

    See #get_player_head.

Returns:

  • (ChunkyPNG::Image)

    The ChunkyPNG::Image instance of that front.

Raises:

  • see #get



20
21
22
# File 'lib/player_skins.rb', line 20

def get_player_front(username, size = 100)
  get_player_image(username, 'player', size)
end

#get_player_head(username, size = 100) ⇒ ChunkyPNG::Image

Gets the image for the front face of the player head.

Parameters:

  • username (String)

    The username to get the head of.

  • size (Integer) (defaults to: 100)

    The width of the image to get.

Returns:

  • (ChunkyPNG::Image)

    The ChunkyPNG::Image instance of that head.

Raises:

  • see #get



11
12
13
# File 'lib/player_skins.rb', line 11

def get_player_head(username, size = 100)
  get_player_image(username, 'helm', size)
end

#get_player_skin(username, size = 64) ⇒ ChunkyPNG::Image

Gets the image for the player’s raw skin.

Parameters:

  • username (String)

    See #get_player_head.

  • size (Integer) (defaults to: 64)

    See #get_player_head.

Returns:

  • (ChunkyPNG::Image)

    The ChunkyPNG::Image instance of that skin.

Raises:

  • see #get



29
30
31
# File 'lib/player_skins.rb', line 29

def get_player_skin(username, size = 64)
  get_player_image(username, 'skin', size)
end