From d54d5fe2b00f7144a58192883a9350bd670fd782 Mon Sep 17 00:00:00 2001 From: kilbith Date: Sat, 16 Jan 2016 17:25:00 +0100 Subject: [PATCH] Convert some nodes to pixel nodeboxes --- nodes.lua | 25 ++++++++++--------------- recipes.lua | 4 ++-- sitting.lua | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/nodes.lua b/nodes.lua index f9afb97..86017f6 100644 --- 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", { diff --git a/recipes.lua b/recipes.lua index c9df8f3..2c7e77c 100644 --- a/recipes.lua +++ b/recipes.lua @@ -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"} } }) diff --git a/sitting.lua b/sitting.lua index 170af7e..8e36fa8 100644 --- a/sitting.lua +++ b/sitting.lua @@ -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