From 2297d0cb71566e994a48307e54fcdd600af674e3 Mon Sep 17 00:00:00 2001 From: kilbith Date: Sat, 23 Apr 2016 21:35:32 +0200 Subject: [PATCH] Remove cushion shift+click combination + misc. cleaning --- handlers/animations.lua | 2 +- hive.lua | 5 ++--- nodes.lua | 22 ++-------------------- recipes.lua | 8 ++++++++ 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/handlers/animations.lua b/handlers/animations.lua index 7a27503..591a5fa 100644 --- a/handlers/animations.lua +++ b/handlers/animations.lua @@ -25,7 +25,7 @@ function xdecor.sit(pos, node, clicker, pointed_thing) default.player_set_animation(clicker, "stand", 30) elseif not default.player_attached[player_name] and node.param2 <= 3 and not - ctrl.sneak and vel.x == 0 and vel.y == 0 and vel.z == 0 then + ctrl.sneak and vector.equals(vel, {x=0,y=0,z=0}) then clicker:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0}) clicker:set_physics_override(0, 0, 0) diff --git a/hive.lua b/hive.lua index 88c32bc..6043135 100644 --- a/hive.lua +++ b/hive.lua @@ -6,8 +6,7 @@ function hive.construct(pos) local inv = meta:get_inventory() local formspec = [[ size[8,5;] - label[1.35,0;Bees are making honey] - label[1.35,0.5;with pollen around...] + label[0.5,0;Bees are busy making honey...] image[6,0;1,1;hive_bee.png] image[5,0;1,1;hive_layout.png] list[context;honey;5,0;1,1;] @@ -26,7 +25,7 @@ function hive.timer(pos) local time = (minetest.get_timeofday() or 0) * 24000 if time < 5500 or time > 18500 then return true end - local inv = minetest.get_meta(pos):get_inventory() + local inv = minetest.get_meta(pos):get_inventory() local honeystack = inv:get_stack("honey", 1) local honey = honeystack:get_count() diff --git a/nodes.lua b/nodes.lua index a725b60..9387231 100644 --- a/nodes.lua +++ b/nodes.lua @@ -202,29 +202,11 @@ xdecor.register("cushion", { groups = {snappy=3, flammable=3, fall_damage_add_percent=-50}, on_place = minetest.rotate_node, node_box = xdecor.nodebox.slab_y(0.5), - can_dig = xdecor.sit_dig, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - pos.y = pos.y + 0 - xdecor.sit(pos, node, clicker, pointed_thing) - - local wield_item = clicker:get_wielded_item():get_name() - if wield_item == "xdecor:cushion" and clicker:get_player_control().sneak then - local player_name = clicker:get_player_name() - if minetest.is_protected(pos, player_name) then - minetest.record_protection_violation(pos, player_name) return - end - - minetest.set_node(pos, {name="xdecor:cushion_block", param2=node.param2}) - - if not minetest.setting_getbool("creative_mode") then - itemstack:take_item() - end - return itemstack - end - end + can_dig = xdecor.sit_dig }) xdecor.register("cushion_block", { + description = "Cushion Block", tiles = {"xdecor_cushion.png"}, groups = {snappy=3, flammable=3, fall_damage_add_percent=-75, not_in_creative_inventory=1} }) diff --git a/recipes.lua b/recipes.lua index 860d4ae..ba1812e 100644 --- a/recipes.lua +++ b/recipes.lua @@ -110,6 +110,14 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "xdecor:cushion_block", + recipe = { + {"xdecor:cushion"}, + {"xdecor:cushion"} + } +}) + minetest.register_craft({ output = "xdecor:desertstone_tile", recipe = {