SHARE
TWEET

cheater

TumeniNodes Jul 11th, 2018 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. walls = {}
  2.  
  3. walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sounds)
  4.     -- inventory node, and pole-type wall start item
  5.     minetest.register_node(wall_name, {
  6.         description = wall_desc,
  7.         drawtype = "nodebox",
  8.         node_box = {
  9.             type = "connected",
  10.             fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}},
  11.             -- connect_bottom =
  12.             connect_front = {{-3/16, -1/2, -1/2,  3/16, 3/8, -1/4}},
  13.             connect_left = {{-1/2, -1/2, -3/16, -1/4, 3/8,  3/16}},
  14.             connect_back = {{-3/16, -1/2,  1/4,  3/16, 3/8,  1/2}},
  15.             connect_right = {{ 1/4, -1/2, -3/16,  1/2, 3/8,  3/16}},
  16.         },
  17.         connects_to = {"group:wall", "group:stone", "group:fence"},
  18.         paramtype = "light",
  19.         is_ground_content = false,
  20.         tiles = { wall_texture, },
  21.         walkable = true,
  22.         groups = { cracky = 3, wall = 1, stone = 2 },
  23.         sounds = wall_sounds,
  24.         after_place_node = function(pos, placer, itemstack, pointed_thing)
  25.             local pos_under = {x = pos.x, y = pos.y - 1, z = pos.z}
  26.             local pos_above = {x = pos.x, y = pos.y + 1, z = pos.z}
  27.             local node_under = string.gsub(minetest.get_node(pos_under).name, "_full$", "")
  28.             local node_above = string.gsub(minetest.get_node(pos_above).name, "_full$", "")
  29.  
  30.             if minetest.get_item_group(node_under, "wall") == 1 then
  31.                 minetest.set_node(pos_under, {name = node_under .. "_full"})
  32.             end
  33.             if minetest.get_item_group(node_above, "wall") == 1 then
  34.                 minetest.set_node(pos, {name = name .. "_full"})
  35.             end
  36.         end,
  37.         after_dig_node = function(pos, oldnode, oldmetadata, digger)
  38.             local pos_under = {x = pos.x, y = pos.y - 1, z = pos.z}
  39.             local node_under = string.gsub(minetest.get_node(pos_under).name, "_full$", "")
  40.             if minetest.get_item_group(node_under, "wall") == 1 and
  41.                     digger and digger:is_player() then
  42.                 minetest.set_node(pos_under, {name = node_under})
  43.             end
  44.         end,
  45.     })
  46.  
  47.     minetest.register_node(wall_name .. "_full", {
  48.         description = wall_desc,
  49.         drawtype = "nodebox",
  50.         paramtype = "light",
  51.         tiles = { wall_texture, },
  52.         groups = {cracky = 3, wall = 1, stone = 2, not_in_creative_inventory = 1},
  53.         node_box = {
  54.             type = "connected",
  55.             fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}},
  56.             connect_front = {{-3/16, -1/2, -1/2,  3/16, 1/2, -1/4}},
  57.             connect_left = {{-1/2, -1/2, -3/16, -1/4, 1/2,  3/16}},
  58.             connect_back = {{-3/16, -1/2,  1/4,  3/16, 1/2,  1/2}},
  59.             connect_right = {{ 1/4, -1/2, -3/16,  1/2, 1/2,  3/16}},
  60.         },
  61.         connects_to = {"group:wall", "group:stone", "group:fence"},
  62.         sounds = wall_sounds,
  63.         drop = name,
  64.         after_dig_node = function(pos, oldnode, oldmetadata, digger)
  65.             local pos_under = {x = pos.x, y = pos.y - 1, z = pos.z}
  66.             local node_under = string.gsub(minetest.get_node(pos_under).name, "_full$", "")
  67.             if minetest.get_item_group(node_under, "wall") == 1 and
  68.                     digger and digger:is_player() then
  69.                 minetest.set_node(pos_under, {name = node_under})
  70.             end
  71.         end,
  72.     })
  73.  
  74.     minetest.register_node(wall_name .. "_filler", {
  75.         description = wall_desc,
  76.         paramtype = "light",
  77.         is_ground_content = false,
  78.         tiles = { wall_texture, },
  79.         walkable = true,
  80.         groups = { cracky = 3, wall = 1, stone = 2 },
  81.         sounds = wall_sounds,
  82.         drawtype = "nodebox",
  83.         node_box = {
  84.             type = "connected",
  85.             fixed = {{-1/2, -1/2, -3/16, 1/2, 3/8, 3/16}},
  86.             connect_top = {{-1/2, -1/2, -3/16, 1/2, 1/2, 3/16}},
  87.         },
  88.         connects_to = {"group:wall", "group:stone", "group:fence"},
  89.     })
  90.  
  91.     minetest.register_node(wall_name .. "_filler2", {
  92.         description = wall_desc,
  93.         paramtype = "light",
  94.         is_ground_content = false,
  95.         tiles = { wall_texture, },
  96.         walkable = true,
  97.         groups = { cracky = 3, wall = 1, stone = 2 },
  98.         sounds = wall_sounds,
  99.         drawtype = "nodebox",
  100.         node_box = {
  101.             type = "connected",
  102.             fixed = {{-3/16, -1/2, -1/2, 3/16, 3/8, 1/2}},
  103.             connect_top = {{-3/16, -1/2, -1/2, 3/16, 1/2, 1/2}},
  104.         },
  105.         connects_to = {"group:wall", "group:stone", "group:fence"},
  106.     })
  107.  
  108.     -- crafting recipe
  109.     minetest.register_craft({
  110.         output = wall_name .. " 6",
  111.         recipe = {
  112.             { '', '', '' },
  113.             { wall_mat, wall_mat, wall_mat},
  114.             { wall_mat, wall_mat, wall_mat},
  115.         }
  116.     })
  117.  
  118. end
  119.  
  120. walls.register("walls:stone", "Stone Wall", "default_stone.png",
  121.         "default:stone", default.node_sound_stone_defaults())
  122.  
  123. walls.register("walls:stonebrick", "Stone Brick Wall", "default_stone_brick.png",
  124.         "default:stonebrick", default.node_sound_stone_defaults())
  125.  
  126. walls.register("walls:stone_block", "Stone Block Wall", "default_stone_block.png",
  127.         "default:stone_block", default.node_sound_stone_defaults())
  128.  
  129. walls.register("walls:cobble", "Cobblestone Wall", "default_cobble.png",
  130.         "default:cobble", default.node_sound_stone_defaults())
  131.  
  132. walls.register("walls:mossycobble", "Mossy Cobblestone Wall", "default_mossycobble.png",
  133.         "default:mossycobble", default.node_sound_stone_defaults())
  134.  
  135. walls.register("walls:desert_stone", "Desert Stone Wall", "default_desert_stone.png",
  136.         "default:desert_stone", default.node_sound_stone_defaults())
  137.  
  138. walls.register("walls:desert_stonebrick", "Desert Stone Brick Wall", "default_desert_stone_brick.png",
  139.         "default:desert_stonebrick", default.node_sound_stone_defaults())
  140.  
  141. walls.register("walls:desert_stone_block", "Desert Stone Block Wall", "default_desert_stone_block.png",
  142.         "default:desert_stone_block", default.node_sound_stone_defaults())
  143.  
  144. walls.register("walls:desertcobble", "Desert Cobblestone Wall", "default_desert_cobble.png",
  145.         "default:desert_cobble", default.node_sound_stone_defaults())
  146.  
  147. walls.register("walls:sandstone", "Sandstone Wall", "default_sandstone.png",
  148.         "default:sandstone", default.node_sound_stone_defaults())
  149.  
  150. walls.register("walls:sandstone_brick", "Sandstone Brick Wall", "default_sandstone_brick.png",
  151.         "default:sandstone_brick", default.node_sound_stone_defaults())
  152.  
  153. walls.register("walls:sandstone_block", "Sandstone Block Wall", "default_sandstone_block.png",
  154.         "default:sandstone_block", default.node_sound_stone_defaults())
  155.  
  156. walls.register("walls:desert_sandstone", "Desert Sandstone Wall", "default_desert_sandstone.png",
  157.         "default:desert_sandstone", default.node_sound_stone_defaults())
  158.  
  159. walls.register("walls:desert_sandstone_brick", "Desert Sandstone Brick Wall", "default_desert_sandstone_brick.png",
  160.         "default:desert_sandstone_brick", default.node_sound_stone_defaults())
  161.  
  162. walls.register("walls:desert_sandstone_block", "Desert Sandstone Block Wall", "default_desert_sandstone_block.png",
  163.         "default:desert_sandstone_block", default.node_sound_stone_defaults())
  164.  
  165. walls.register("walls:silver_sandstone", "Silver Sandstone Wall", "default_silver_sandstone.png",
  166.         "default:silver_sandstone", default.node_sound_stone_defaults())
  167.  
  168. walls.register("walls:silver_sandstone_brick", "Silver Sandstone Brick Wall", "default_silver_sandstone_brick.png",
  169.         "default:silver_sandstone_brick", default.node_sound_stone_defaults())
  170.  
  171. walls.register("walls:silver_sandstone_block", "Silver Sandstone Block Wall", "default_silver_sandstone_block.png",
  172.         "default:silver_sandstone_block", default.node_sound_stone_defaults())
  173.  
  174. walls.register("walls:obsidian", "Obsidian Wall", "default_obsidian.png",
  175.         "default:obsidian", default.node_sound_stone_defaults())
  176.  
  177. walls.register("walls:obsidianbrick", "Obsidian Brick Wall", "default_obsidian_brick.png",
  178.         "default:obsidianbrick", default.node_sound_stone_defaults())
  179.  
  180. walls.register("walls:obsidian_block", "Obsidian Block Wall", "default_obsidian_block.png",
  181.         "default:obsidian_block", default.node_sound_stone_defaults())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top