]> git.lizzy.rs Git - xdecor.git/commitdiff
Remove cushion shift+click combination + misc. cleaning
authorkilbith <jeanpatrick.guerrero@gmail.com>
Sat, 23 Apr 2016 19:35:32 +0000 (21:35 +0200)
committerkilbith <jeanpatrick.guerrero@gmail.com>
Sat, 23 Apr 2016 19:35:32 +0000 (21:35 +0200)
handlers/animations.lua
hive.lua
nodes.lua
recipes.lua

index 7a275032c1866851ada985b7bcef1c74911294a0..591a5fac73bfbb0eddf54f3d54c4c9c392753859 100644 (file)
@@ -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)
index 88c32bcbbf8c0e4ce7b140b10613c823848f7d67..604313512f3811ded7cbc48e7b1c339ed8d1553b 100644 (file)
--- 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()
 
index a725b6008c57fda9ae895a39035b8d6c91613c26..938723181f3b3c873a72fd029cae49bedea8baf5 100644 (file)
--- 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}
 })
index 860d4ae964f5abe02f583958aac8fb1a61d3700d..ba1812e12b4ba2c571074329b6603445ac499331 100644 (file)
@@ -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 = {