Remove cushion shift+click combination + misc. cleaning
This commit is contained in:
parent
fa0d47380c
commit
2297d0cb71
@ -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)
|
||||
|
5
hive.lua
5
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()
|
||||
|
||||
|
22
nodes.lua
22
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}
|
||||
})
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user