1 local S
= minetest
.get_translator("cups")
2 local has_default
= minetest
.get_modpath("default") ~= nil
3 local has_moreores
= minetest
.get_modpath("moreores") ~= nil
10 {-0.3,-0.5,-0.3,0.3,-0.4,0.3}, -- stand
11 {-0.1,-0.4,-0.1,0.1,0,0.1}, -- handle
12 {-0.3,0,-0.3,0.3,0.1,0.3}, -- cup (lower part)
13 -- the 4 sides of the upper part
14 {-0.2,0.1,-0.3,0.2,0.5,-0.2},
15 {-0.2,0.1,0.2,0.2,0.5,0.3},
16 {-0.3,0.1,-0.3,-0.2,0.5,0.3},
17 {0.2,0.1,-0.3,0.3,0.5,0.3},
24 {-0.3,-0.5,-0.3,0.3,-0.4,0.3}, -- stand
25 {-0.1,-0.4,-0.1,0.1,0,0.1}, -- handle
26 {-0.3,0,-0.3,0.3,0.5,0.3}, -- upper part
31 cups
.register_cup
= function(subname
, description
, tiles
, craftitem
, craft_count
, extra_groups
, extra_sounds
)
32 local groups
= { dig_immediate
=3, falling_node
=1, }
34 for k
,v
in pairs(extra_groups
) do
40 if default
.node_sound_metal_defaults
then
41 sounds
= default
.node_sound_defaults({
42 footstep
= { name
= "default_metal_footstep", gain
= 0.3 },
45 sounds
= default
.node_sound_defaults({
46 footstep
= { name
= "default_hard_footstep", gain
= 0.3 },
51 for k
,v
in pairs(extra_sounds
) do
55 local itemstring
= "cups:cup_"..subname
56 minetest
.register_node(itemstring
, {
57 description
= description
,
58 _doc_items_longdesc
= S("A decorative item which can be placed."),
62 node_box
= cupnodebox
,
63 is_ground_content
= false,
64 selection_box
= cupselbox
,
69 if craftitem
~= nil then
70 if craft_count
== nil then craft_count
= 1 end
73 minetest
.register_craft({
74 output
= "cups:cup_"..subname
.." "..craft_count
,
76 {craftitem
, "", craftitem
},
88 sound_hard
= default
.node_sound_defaults({ footstep
= { name
= "default_hard_footstep", gain
= 0.3 }})
90 cups
.register_cup("bronze", S("Bronze Cup"), { "cups_bronze.png" }, "default:bronze_ingot", 2)
91 cups
.register_cup("gold", S("Golden Cup"), { "cups_gold.png" }, "default:gold_ingot", 2)
92 cups
.register_cup("diamond", S("Diamond Cup"), { "cups_diamond.png" }, "default:diamond", 1, nil, sound_hard
)
94 cups
.register_cup("silver", S("Silver Cup"), { "cups_silver.png" }, "moreores:silver_ingot", 2)
98 minetest
.register_alias("mtg_plus:cup_bronze", "cups:cup_bronze")
99 minetest
.register_alias("mtg_plus:cup_gold", "cups:cup_gold")
100 minetest
.register_alias("mtg_plus:cup_diamond", "cups:cup_diamond")