]> git.lizzy.rs Git - xdecor.git/commitdiff
Convert some nodes to pixel nodeboxes
authorkilbith <jeanpatrick.guerrero@gmail.com>
Sat, 16 Jan 2016 16:25:00 +0000 (17:25 +0100)
committerkilbith <jeanpatrick.guerrero@gmail.com>
Sat, 16 Jan 2016 17:12:08 +0000 (18:12 +0100)
nodes.lua
recipes.lua
sitting.lua

index f9afb97f817f3391350a57b9fe9819035869e30b..86017f62e86bbc822271d509b47fa64c654374b1 100644 (file)
--- a/nodes.lua
+++ b/nodes.lua
@@ -412,13 +412,12 @@ xdecor.register("stonepath", {
        on_rotate = screwdriver.rotate_simple,
        sounds = default.node_sound_stone_defaults(),
        sunlight_propagates = true,
-       node_box = {
-               type = "fixed",
-               fixed = {{0, -0.5, 0, 0.375, -0.47, 0.375},
-                       {-0.4375, -0.5, -0.4375, -0.0625, -0.47, -0.0625},
-                       {-0.4375, -0.5, 0.125, -0.125, -0.47, 0.4375},
-                       {0.125, -0.5, -0.375, 0.375, -0.47, -0.125}}
-       },
+       node_box = xdecor.pixelnodebox(16, {
+               {8,  0,  8, 14, 0.5, 14},
+               {1,  0,  1,  7, 0.5,  7},
+               {1,  0, 10,  6, 0.5, 15},
+               {10, 0,  2, 14, 0.5,  6}
+       }),
        selection_box = xdecor.nodebox.slab_y(0.05)
 })
 
@@ -440,11 +439,9 @@ xdecor.register("table", {
        tiles = {"xdecor_wood.png"},
        groups = {choppy=3, oddly_breakable_by_hand=2, flammable=3},
        sounds = default.node_sound_wood_defaults(),
-       node_box = {
-               type = "fixed",
-               fixed = {{-0.5, 0.4, -0.5, 0.5, 0.5, 0.5},
-                       {-0.15, -0.5, -0.15, 0.15, 0.4, 0.15}}
-       }
+       node_box = xdecor.pixelnodebox(16, {
+               {0, 14, 0, 16, 16, 16}, {5.5, 0, 5.5, 10.5, 14, 10.5}
+       })
 })
 
 xdecor.register("tatami", {
@@ -452,9 +449,7 @@ xdecor.register("tatami", {
        tiles = {"xdecor_tatami.png"},
        wield_image = "xdecor_tatami.png",
        groups = {snappy=3, flammable=3},
-       node_box = {
-               type = "fixed", fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}}
-       }
+       node_box = xdecor.nodebox.slab_y(0.0625)
 })
 
 xdecor.register("tv", {
index c9df8f36e829244952343b955b90e547d2cabeff..2c7e77cb765dc3534df9a796c33524b830c8b762 100644 (file)
@@ -56,9 +56,9 @@ minetest.register_craft({
 })
 
 minetest.register_craft({
-       output = "xdecor:cushion 2",
+       output = "xdecor:cushion 3",
        recipe = {
-               {"wool:red", "wool:red"}
+               {"wool:red", "wool:red", "wool:red"}
        }
 })
 
index 170af7eb85dba41903d4c0e2e93559502d3b9a5d..8e36fa817d4fa45b27b230fb0d1f2da1db4d5e23 100644 (file)
@@ -17,6 +17,7 @@ local function sit(pos, node, clicker)
                default.player_set_animation(clicker, "stand", 30)
 
        elseif default.player_attached[player] ~= true and node.param2 <= 3 and
+                       clicker:get_player_control().sneak == false and
                        clicker:get_player_velocity().x == 0 and
                        clicker:get_player_velocity().y == 0 and
                        clicker:get_player_velocity().z == 0 then
@@ -59,15 +60,14 @@ xdecor.register("chair", {
        sounds = default.node_sound_wood_defaults(),
        groups = {choppy=3, oddly_breakable_by_hand=2, flammable=3},
        on_rotate = screwdriver.rotate_simple,
-       node_box = {
-               type = "fixed",
-               fixed = {{-0.3125, -0.5, 0.1875, -0.1875, 0.5, 0.3125},
-                       {0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
-                       {-0.1875, 0.025, 0.22, 0.1875, 0.45, 0.28},
-                       {-0.3125, -0.5, -0.3125, -0.1875, -0.125, -0.1875},
-                       {0.1875, -0.5, -0.3125, 0.3125, -0.125, -0.1875},
-                       {-0.3125, -0.125, -0.3125, 0.3125, 0, 0.1875}}
-       },
+       node_box = xdecor.pixelnodebox(16, {
+               {3,  0, 11,    5, 16, 13},
+               {11, 0, 11,   13, 16, 13},
+               {5,  9, 11.5, 11, 15, 12.5},
+               {3,  0,  3,    5,  6,  5},
+               {11, 0,  3,   13,  6,  5},
+               {3,  6,  3,   13,  8, 11}
+       }),
        can_dig = dig,
        on_rightclick = function(pos, node, clicker)
                pos.y = pos.y + 0  -- Sitting position.
@@ -80,7 +80,7 @@ xdecor.register("cushion", {
        tiles = {"xdecor_cushion.png"},
        groups = {snappy=3, flammable=3, fall_damage_add_percent=-50},
        on_place = minetest.rotate_node,
-       node_box = xdecor.nodebox.slab_y(-0.5, 0.5),
+       node_box = xdecor.nodebox.slab_y(0.5),
        can_dig = dig,
        on_rightclick = function(pos, node, clicker)
                pos.y = pos.y + 0