Advertisement
Doyousketch2

registrations.lua

Aug 26th, 2015
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. --[[
  2. More Blocks: registrations
  3. Copyright (c) 2011-2015 Calinou and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6.  
  7. local default_nodes = { -- Default stairs/slabs/panels/microblocks:
  8.     "stone",
  9.     "cobble",
  10.     "mossycobble",
  11.     "brick",
  12.     "sandstone",
  13.     "steelblock",
  14.     "goldblock",
  15.     "copperblock",
  16.     "bronzeblock",
  17.     "diamondblock",
  18.     "desert_stone",
  19.     "desert_cobble",
  20.     "meselamp",
  21.     "glass",
  22.     "tree",
  23.     "wood",
  24.     "jungletree",
  25.     "junglewood",
  26.     "pine_tree",
  27.     "pine_wood",
  28.     "acacia_tree",
  29.     "acacia_wood",
  30.     "obsidian",
  31.     "obsidian_glass",
  32.     "stonebrick",
  33.     "desert_stonebrick",
  34.     "sandstonebrick",
  35.     "obsidianbrick",
  36.     "wool_white",
  37.     "wool_grey",
  38.     "wool_black",
  39.     "wool_red",
  40.     "wool_yellow",
  41.     "wool_green",
  42.     "wool_cyan",
  43.     "wool_blue",
  44.     "wool_magenta",
  45.     "wool_orange",
  46.     "wool_violet",
  47.     "wool_brown",
  48.     "wool_pink",
  49.     "wool_dark_grey",
  50.     "wool_dark_green",
  51. }
  52.  
  53. for _, name in pairs(default_nodes) do
  54.     local nodename = "default:" .. name
  55.     local ndef = minetest.registered_nodes[nodename]
  56.     if ndef then
  57.         local groups = {}
  58.         for k, v in pairs(ndef.groups)
  59.             -- Ignore wood and stone groups to not make them usable in crafting:
  60.             do if k ~= "wood" and k ~= "stone" then
  61.                 groups[k] = v
  62.             end
  63.         end
  64.         local drop
  65.         if type(ndef.drop) == "string" then
  66.             drop = ndef.drop:sub(9)
  67.         end
  68.         stairsplus:register_all("moreblocks", name, nodename, {
  69.             description = ndef.description,
  70.             drop = drop,
  71.             groups = groups,
  72.             sounds = ndef.sounds,
  73.             tiles = ndef.tiles,
  74.             sunlight_propagates = true,
  75.             light_source = ndef.light_source
  76.         })
  77.     end
  78. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement