mg76

riventest_registration

Dec 25th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.33 KB | None | 0 0
  1. local riventest_nodes = { -- Default stairs/slabs/panels/microblocks:
  2.  
  3.         "rt1",
  4.         "rt2",
  5.         "rt5",
  6.         "rt3",
  7.         "rt4",
  8.         "rt7",
  9.         "rt8",
  10.         "rt10",
  11.         "rt11",
  12.         "rt12",
  13.         "wood",
  14.         "inward-squared brownstone",
  15.         "flower-patterned metal",
  16.         "lined brownestone",
  17.         "metal block",
  18.         "golden block",
  19.         "outward-squared brownstone",
  20.         "cobble brightstone",
  21.         "rusted metal block",
  22.         "flower-patterned brightstone",
  23.         "mosaic brightstone",
  24.         "bluewood"
  25.  
  26. }
  27.        
  28.    
  29.         for _, name in pairs(cave_nodes) do
  30.     local nodename = "riventest:"..name
  31.     local a,b = string.find(name, ":")
  32.     if b then
  33.         nodename = name
  34.         name = string.sub(name, b+1)
  35.     end
  36.     local ndef = minetest.registered_nodes[nodename]
  37.     if ndef then
  38.         local drop
  39.         if type(ndef.drop) == "string" then
  40.             drop = ndef.drop:sub((b or 8)+1)
  41.         end
  42.  
  43.         local tiles = ndef.tiles
  44.         if #ndef.tiles > 1 and ndef.drawtype:find("glass") then
  45.             tiles = { ndef.tiles[1] }
  46.         end
  47.  
  48.         stairsplus:register_all("riventest", name, nodename, {
  49.             description = ndef.description,
  50.             drop = drop,
  51.             groups = ndef.groups,
  52.             sounds = ndef.sounds,
  53.             tiles = tiles,
  54.             sunlight_propagates = true,
  55.             light_source = ndef.light_source
  56.         })
  57.     end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment