[xdecor] Update

master
LeMagnesium 2016-05-14 18:00:59 +02:00
parent dd0ca17557
commit b56781957f
14 changed files with 86 additions and 50 deletions

View File

@ -8,6 +8,8 @@
| freesound.org/people/Audionautics/sounds/133901/ |
| - xdecor_enchanting.ogg - by Timbre - CC BY-SA-NC |
| freesound.org/people/Timbre/sounds/221683/ |
| - xdecor_bouncy.ogg - by Blender Foundation - CC BY 3.0 |
| opengameart.org/content/funny-comic-cartoon-bounce-sound |
+----------------------------------------------------------------------+

View File

@ -0,0 +1 @@
A decoration mod meant to be simple and well-featured.

View File

@ -24,8 +24,8 @@ function xdecor.sit(pos, node, clicker, pointed_thing)
default.player_attached[player_name] = false
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
elseif not default.player_attached[player_name] and node.param2 <= 3 and
not 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)

View File

@ -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()

View File

@ -94,7 +94,7 @@ function mailbox.put(pos, listname, _, stack, player)
if inv:room_for_item("mailbox", stack) then
return -1
else
minetest.chat_send_player(player:get_player_name(), "[!] The mailbox is full")
minetest.chat_send_player(player:get_player_name(), "The mailbox is full")
end
end
return 0

1
mods/xdecor/mod.conf Normal file
View File

@ -0,0 +1 @@
name = xdecor

View File

@ -48,12 +48,21 @@ xdecor.register_pane("wood_frame", "Wood Frame", {
xdecor.register("baricade", {
description = "Baricade",
drawtype = "plantlike",
walkable = false,
paramtype2 = "facedir",
inventory_image = "xdecor_baricade.png",
tiles = {"xdecor_baricade.png"},
groups = {choppy=2, oddly_breakable_by_hand=1, flammable=2},
damage_per_second = 4,
selection_box = xdecor.nodebox.slab_y(0.3)
selection_box = xdecor.nodebox.slab_y(0.3),
collision_box = xdecor.pixelbox(2, {{0, 0, 1, 2, 2, 0}})
})
xdecor.register("barrel", {
description = "Barrel",
tiles = {"xdecor_barrel_top.png", "xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
on_place = minetest.rotate_node,
groups = {choppy=2, oddly_breakable_by_hand=1, flammable=2},
sounds = default.node_sound_wood_defaults()
})
function xdecor.register_storage(name, desc, def)
@ -70,11 +79,6 @@ function xdecor.register_storage(name, desc, def)
})
end
xdecor.register_storage("barrel", "Barrel", {
tiles = {"xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
on_place = minetest.rotate_node
})
xdecor.register_storage("cabinet", "Wooden Cabinet", {
on_rotate = screwdriver.rotate_simple,
tiles = {"xdecor_cabinet_sides.png", "xdecor_cabinet_sides.png",
@ -137,7 +141,7 @@ xdecor.register("chair", {
{11, 0, 3, 2, 6, 2}, {3, 6, 3, 10, 2, 8}
}),
can_dig = xdecor.sit_dig,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
on_rightclick = function(pos, node, clicker, _, pointed_thing)
pos.y = pos.y + 0 -- Sitting position.
xdecor.sit(pos, node, clicker, pointed_thing)
end
@ -156,7 +160,7 @@ xdecor.register("cobweb", {
liquid_range = 0,
walkable = false,
selection_box = {type = "regular"},
groups = {dig_immediate=3, liquid=3, flammable=3},
groups = {snappy=3, liquid=3, flammable=3},
sounds = default.node_sound_leaves_defaults()
})
@ -203,28 +207,14 @@ xdecor.register("cushion", {
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
on_rightclick = function(pos, node, clicker, _, pointed_thing)
pos.y = pos.y + 0 -- Sitting position.
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
})
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}
})
@ -299,7 +289,7 @@ xdecor.register("ivy", {
drawtype = "signlike",
walkable = false,
climbable = true,
groups = {dig_immediate=3, flammable=3, plant=1},
groups = {snappy=3, flora=1, attached_node=1, plant=1, flammable=3},
paramtype2 = "wallmounted",
selection_box = {type="wallmounted"},
tiles = {"xdecor_ivy.png"},
@ -316,7 +306,7 @@ xdecor.register("lantern", {
wield_image = "xdecor_lantern_inv.png",
paramtype2 = "wallmounted",
walkable = false,
groups = {dig_immediate=3, attached_node=1},
groups = {snappy=3, attached_node=1},
tiles = {{name = "xdecor_lantern.png", animation = {type="vertical_frames", length=1.5}}},
selection_box = xdecor.pixelbox(16, {{4, 0, 4, 8, 16, 8}})
})
@ -336,7 +326,7 @@ for _, f in pairs({"dandelion_white", "dandelion_yellow", "geranium",
xdecor.register("potted_"..f, {
description = "Potted "..f:gsub("%f[%w]%l", string.upper):gsub("_", " "),
walkable = false,
groups = {dig_immediate=3, flammable=3, plant=1, flower=1},
groups = {snappy=3, flammable=3, plant=1, flower=1},
tiles = {"xdecor_"..f.."_pot.png"},
inventory_image = "xdecor_"..f.."_pot.png",
drawtype = "plantlike",
@ -369,11 +359,22 @@ xdecor.register("painting_1", {
groups = {choppy=3, oddly_breakable_by_hand=2, flammable=2, attached_node=1},
sounds = default.node_sound_wood_defaults(),
node_box = painting_box,
on_construct = function(pos)
local node = minetest.get_node(pos)
local random = math.random(4)
if random == 1 then return end
minetest.set_node(pos, {name="xdecor:painting_"..random, param2=node.param2})
node_placement_prediction = "",
on_place = function(itemstack, placer, pointed_thing)
local player_name = placer:get_player_name()
local pos = pointed_thing.above
if not minetest.is_protected(pos, player_name) then
local num = math.random(4)
local dir = minetest.dir_to_wallmounted(placer:get_look_dir())
minetest.set_node(pos, {name="xdecor:painting_"..num, param2=dir})
else
minetest.chat_send_player(player_name, "This area is protected")
end
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
return itemstack
end
end
})
@ -443,13 +444,22 @@ xdecor.register("tatami", {
tiles = {"xdecor_tatami.png"},
wield_image = "xdecor_tatami.png",
groups = {snappy=3, flammable=3},
sunlight_propagates = true,
node_box = xdecor.nodebox.slab_y(0.0625)
})
xdecor.register("trampoline", {
description = "Trampoline",
tiles = {"xdecor_trampoline.png", "mailbox_blank16.png", "xdecor_trampoline_sides.png"},
groups = {cracky=3, oddly_breakable_by_hand=1, fall_damage_add_percent=-80, bouncy=90},
node_box = xdecor.nodebox.slab_y(0.5),
sounds = {footstep = {name="xdecor_bouncy", gain=0.8}}
})
xdecor.register("tv", {
description = "Television",
light_source = 11,
groups = {snappy=3},
groups = {cracky=3, oddly_breakable_by_hand=2},
on_rotate = screwdriver.rotate_simple,
tiles = {"xdecor_television_left.png^[transformR270",
"xdecor_television_left.png^[transformR90",
@ -462,6 +472,7 @@ xdecor.register("tv", {
xdecor.register("woodframed_glass", {
description = "Wood Framed Glass",
drawtype = "glasslike_framed",
sunlight_propagates = true,
tiles = {"xdecor_woodframed_glass.png", "xdecor_woodframed_glass_detail.png"},
groups = {cracky=2, oddly_breakable_by_hand=1},
sounds = default.node_sound_glass_defaults()

View 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 = {
@ -316,6 +324,15 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "xdecor:trampoline",
recipe = {
{"farming:string", "farming:string", "farming:string"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "", "default:steel_ingot"}
}
})
minetest.register_craft({
output = "xdecor:tv",
recipe = {

View File

@ -47,7 +47,7 @@ xdecor.register("rope", {
drawtype = "plantlike",
walkable = false,
climbable = true,
groups = {dig_immediate=3, flammable=3},
groups = {snappy=3, flammable=3},
tiles = {"xdecor_rope.png"},
inventory_image = "xdecor_rope_inv.png",
wield_image = "xdecor_rope_inv.png",

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

View File

@ -5,14 +5,19 @@ screwdriver = screwdriver or {}
-- Only the regular, solid blocks without metas or explosivity can be cut.
local nodes = {}
for node, def in pairs(minetest.registered_nodes) do
if def.name:find("default:mese") or ((def.drawtype == "normal" or def.drawtype:find("glass")) and
(def.groups.cracky or def.groups.choppy) and not
def.on_construct and not def.after_place_node and not
def.after_place_node and not def.on_rightclick and not
def.on_blast and not def.allow_metadata_inventory_take and not
(def.groups.not_in_creative_inventory == 1) and not
def.groups.wool and not def.description:find("Ore") and
def.description and def.description ~= "" and def.light_source == 0)
if def.name:find("default:mese") or ((def.drawtype == "normal" or def.drawtype:sub(1,5) == "glass") and
(def.groups.cracky or def.groups.choppy) and
not def.on_construct and
not def.after_place_node and
not def.on_rightclick and
not def.on_blast and
not def.allow_metadata_inventory_take and
not (def.groups.not_in_creative_inventory == 1) and
not def.groups.wool and
not def.description:find("Ore") and
def.description and
def.description ~= "" and
def.light_source == 0)
then
nodes[#nodes+1] = node
end