Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.84 KB | None | 0 0
  1. --fireplace 0.1 tumeninodes Jan. 09 2018
  2.  
  3. minetest.register_node("fireplace:fireplace_lg", {
  4.     description = "Large Fireplace",
  5.     drawtype = "mesh",
  6.     mesh = "fireplace_lg.obj",
  7.     inventory_image = minetest.inventorycube("fireplace_01_top.png", "fireplace_01_side.png", "fireplace_01_front.png"),
  8.     wield_image = "fireplace_01_front.png",
  9.     tiles = {"default_wood.png", "default_stone_brick.png"},
  10.     paramtype = "light",
  11.     paramtype2 = "facedir",
  12.     legacy_facedir_simple = true,
  13.     is_ground_content = false,
  14.     groups = {cracky=2, stone=1, oddly_breakable_by_hand=3},
  15.     sounds = default.node_sound_stone_defaults(),
  16.     selection_box = {
  17.         type = "fixed",
  18.         fixed = {
  19.             {-1.5, -0.5, -0.5, -0.5, 2.5, 0.5},
  20.             {0.5, -0.5, -0.5, 1.5, 2.5, 0.5},
  21.             {-0.5, 0.5, -0.5, 0.5, 2.5, 0.5},
  22.         },
  23.     },
  24.     collision_box = {
  25.         type = "fixed",
  26.         fixed = {
  27.             {-1.5, -0.5, -0.5, -0.5, 2.5, 0.5},
  28.             {0.5, -0.5, -0.5, 1.5, 2.5, 0.5},
  29.             {-0.5, 0.5, -0.5, 0.5, 2.5, 0.5},
  30.         },
  31.     },
  32. })
  33.  
  34. minetest.register_node("fireplace:fireplace_01", {
  35.     description = "Fireplace 01",
  36.     drawtype = "mesh",
  37.     mesh = "fireplace.obj",
  38.     inventory_image = minetest.inventorycube("fireplace_01_top.png", "fireplace_01_side.png", "fireplace_01_front.png"),
  39.     wield_image = "fireplace_01_front.png",
  40.     tiles = {
  41.         "fireplace_01_top.png", "fireplace_01_bottom.png",
  42.         "fireplace_01_side.png", "fireplace_01_side.png",
  43.         "fireplace_01_front.png", "fireplace_01_side.png"},
  44.     paramtype = "light",
  45.     paramtype2 = "facedir",
  46.     legacy_facedir_simple = true,
  47.     is_ground_content = false,
  48.     groups = {cracky=2, stone=1, oddly_breakable_by_hand=3},
  49.     sounds = default.node_sound_stone_defaults(),
  50.     selection_box = {
  51.         type = "fixed",
  52.         fixed = {
  53.             {-0.5, -0.5, 0, 1.5, 1.5, 0.5},
  54.         },
  55.     },
  56.     collision_box = {
  57.         type = "fixed",
  58.         fixed = {
  59.             {-0.5, -0.5, 0, 1.5, 1.5, 0.5},
  60.         },
  61.     },
  62.    
  63.     on_rightclick = function(pos, node, puncher)
  64.         local handle = minetest.sound_play("fire_small", {pos = pos, gain = 0.20, max_hear_distance = 10, loop = true})
  65.         minetest.get_meta(pos):set_int("handle", 2)
  66.         minetest.swap_node(pos, {name = "fireplace:fireplace_01_active", param2 = node.param2})
  67.     end
  68. })
  69.  
  70. minetest.register_node("fireplace:fireplace_01_active", {
  71.     description = "Fireplace_01_Active",
  72.     drawtype = "mesh",
  73.     mesh = "fireplace.obj",
  74.     tiles = {
  75.         "fireplace_01_top.png", "fireplace_01_bottom.png",
  76.     "fireplace_01_side.png", "fireplace_01_side.png",
  77.         {
  78.             image = "fireplace_01_active.png",
  79.             backface_culling = false,
  80.             animation = {
  81.                 type = "vertical_frames",
  82.                 aspect_w = 32,
  83.                 aspect_h = 32,
  84.                 length = 1.9
  85.             },
  86.         }, "fireplace_01_side.png",
  87.     },
  88.     light_source = 8,
  89.     paramtype = "light",
  90.     paramtype2 = "facedir",
  91.     legacy_facedir_simple = true,
  92.     is_ground_content = false,
  93.     groups = {not_in_creative_inventory = 1},
  94.     sounds = default.node_sound_stone_defaults(),
  95.     selection_box = {
  96.         type = "fixed",
  97.         fixed = {
  98.             {-0.5, -0.5, 0, 1.5, 1.5, 0.5},
  99.         },
  100.     },
  101.     collision_box = {
  102.         type = "fixed",
  103.         fixed = {
  104.             {-0.5, -0.5, 0, 1.5, 1.5, 0.5},
  105.         },
  106.     },
  107.  
  108.     on_rightclick = function(pos, node, puncher)
  109.     local handle = minetest.get_meta(pos):get_int("handle")
  110.     minetest.after(2, function()
  111.         if handle
  112.         then minetest.sound_stop(handle) minetest.get_meta(pos):set_int("handle", nil)
  113.         minetest.sound_stop(handle)
  114.         end
  115.     end)
  116.         minetest.swap_node(pos, {name = "fireplace:fireplace_01", param2 = node.param2})
  117.     end,
  118.     drop = "fireplace:fireplace_01",
  119. })
  120.  
  121. minetest.register_node("fireplace:mini_fireplace_01", {
  122.     description = "Mini Fireplace 01",
  123.     tiles = {"fireplace_01_top.png", "fireplace_01_bottom.png",
  124.         "fireplace_01_side.png", "fireplace_01_side.png",
  125.         "fireplace_01_side.png","fireplace_01_front.png"},
  126.     paramtype2 = "facedir",
  127.     legacy_facedir_simple = true,
  128.     is_ground_content = false,
  129.     sounds = default.node_sound_wood_defaults(),
  130.     groups = {cracky=2, stone=1, oddly_breakable_by_hand=3},
  131.  
  132.     on_rightclick = function(pos, node, puncher)
  133.         minetest.sound_play("fire_small", {pos = pos, gain = 0.20, max_hear_distance = 10, loop = true})
  134.         minetest.swap_node(pos, {name = "fireplace:mini_fireplace_01_active", param2 = node.param2})
  135.     end
  136. })
  137.  
  138. minetest.register_node("fireplace:mini_fireplace_01_active", {
  139.     description = "Mini Fireplace 01 Active",
  140.     tiles = {"fireplace_01_top.png", "fireplace_01_bottom.png",
  141.         "fireplace_01_side.png", "fireplace_01_side.png",
  142.         "fireplace_01_side.png",
  143.         {
  144.             image = "fireplace_01_active.png",
  145.             backface_culling = false,
  146.             animation = {
  147.                 type = "vertical_frames",
  148.                 aspect_w = 16,
  149.                 aspect_h = 16,
  150.                 length = 1.9
  151.             },
  152.         }
  153.     },
  154.     light_source = 6,
  155.     paramtype2 = "facedir",
  156.     legacy_facedir_simple = true,
  157.     is_ground_content = false,
  158.     groups = {not_in_creative_inventory = 1},
  159.    
  160.     on_rightclick = function(pos, node, puncher)
  161.         minetest.swap_node(pos, {name = "fireplace:mini_fireplace_01", param2 = node.param2})
  162.     end
  163. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement