-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.lua
60 lines (55 loc) · 1.47 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
dofile(minetest.get_modpath("chakram") .. "/wood.lua")
dofile(minetest.get_modpath("chakram") .. "/steel.lua")
dofile(minetest.get_modpath("chakram") .. "/mese.lua")
pvp=minetest.settings:get_bool("enable_pvp")
chakramshot_user=""
chakramshot_user_name=""
chakram_shot_chakram={}
chakram_max_number=10
function chakram_max(add)
local c=0
for i in pairs(chakram_shot_chakram) do
c=c+1
if chakram_shot_chakram[i]:get_pos()==nil then
table.remove(chakram_shot_chakram,c)
c=c-1
end
end
if c+1>chakram_max_number then return false end
if add then
table.insert(chakram_shot_chakram,add)
return true
end
return true
end
function chakram_def(pos,def)
local n=minetest.registered_nodes[minetest.get_node(pos).name]
return n and n[def]
end
minetest.register_craft({
output = "chakram:chakram",
recipe = {
{"default:steel_ingot","","default:steel_ingot"},
{"","default:steelblock",""},
{"default:steel_ingot","","default:steel_ingot"},
}
})
minetest.register_craft({
output = "chakram:chakram_mese",
recipe = {
{"default:mese_crystal","","default:mese_crystal"},
{"","default:mese",""},
{"default:mese_crystal","","default:mese_crystal"},
}
})
minetest.register_craft({
output = "chakram:chakram_wood",
recipe = {
{"default:stick","","default:stick"},
{"","group:wood",""},
{"default:stick","","default:stick"},
}
})
function chakram_drops(name)
return minetest.get_node_drops(name)[1] or "air"
end