Module:KnightMiner/DeprecatedSprites

From Minecraft Wiki
Jump to: navigation, search
[view | edit | history | purge]DocumentationJump to code ↴

This module pulls a list of deprecated sprites from one of the sprite ID modules and displays it in a simply formatted fashion.

Usage[edit]

To run p.deprecated, simply set the first parameter to the name of a sprite sheet; for example, Block

Example[edit]

{{#invoke:KnightMiner/DeprecatedSprites|deprecated|Block}}

BlockSprite
  • all-cloth
  • block-of-copper
  • bricks-revision-1
  • bricks-revision-2
  • capri-cloth
  • chair
  • chartreuse-cloth
  • cloth
  • cobblestone-revision-1
  • cobblestone-revision-2
  • cyan-cloth
  • dark-gray-cloth
  • diamond-block-bottom
  • diamond-block-side
  • diamond-block-top
  • dirt-revision-1
  • gold-block-bottom
  • gold-block-revision-1
  • gold-block-side
  • gold-block-top
  • grass-block-revision-1
  • grass-block-side-revision-1
  • grass-block-top-revision-1
  • gravel-revision-1
  • gravel-revision-2
  • green-cloth
  • iron-block-bottom
  • iron-block-revision-1
  • iron-block-side
  • iron-block-top
  • light-gray-cloth
  • magenta-cloth
  • mossy-cobblestone-revision-1
  • oak-leaves-fast-revision-1
  • oak-leaves-revision-1
  • obsidian-revision-1
  • orange-cloth
  • planks-revision-0
  • planks-revision-1
  • planks-revision-2
  • purple-cloth
  • rose-be
  • rose-cloth
  • rose-je
  • rose
  • sand-revision-1
  • sapling-revision-1
  • sapling-revision-2
  • sponge-revision-1
  • spring-green-cloth
  • stone-revision-1
  • table
  • ultramarine-cloth
  • unused
  • violet-cloth
  • white-cloth
  • wood-planks-revision-0
  • wood-planks-revision-1
  • wood-planks-revision-2
  • yellow-cloth
[view | edit | history | purge]The above documentation is transcluded from Module:KnightMiner/DeprecatedSprites/doc.
local p = {}
function p.deprecated( f )
	local name = f.args[1] .. 'Sprite'
	
	-- Load the list of sprites based on the name given
	local data = mw.loadData( 'Module:' .. name ).ids
	
	-- Go over every sprite to check for deprecated sprites
	local output = {}
	for k, v in pairs( data ) do
		if v.deprecated then
			table.insert( output, '<code>' .. k .. '</code>' )
		end
	end

	-- If we have results, then format them a bit and return results
	if #output > 0 then
		table.sort( output )

		-- Add a dummy item to make the list easier
		table.insert( output, 1, '' )

		local div = mw.html.create( 'div' ):css{
			        ['column-width'] = '15em',
			   ['-moz-column-width'] = '15em',
			['-webkit-column-width'] = '15em'
		}:wikitext( table.concat( output, '\n* ' ) )
		
		return '; [[Template:' .. name .. '|' .. name .. ']] \n' .. tostring( div )
	end
end

return p