half working spigots, new foods.

master
NathanSalapat 2015-04-09 16:45:27 -05:00
parent 53eed96731
commit 65b5e4730d
7 changed files with 176 additions and 117 deletions

View File

@ -73,6 +73,15 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'survival:energy_bar 1',
recipe = {
{'default:apple', 'default:apple', 'default:apple'},
{'survival:sugar', 'survival:sugar', 'survival:sugar'},
{'farming:seed_wheat', 'farming:seed_wheat', 'farming:seed_wheat'},
}
})
minetest.register_craft({
type = 'cooking',
output = 'survival:slug_cooked',
@ -131,3 +140,10 @@ minetest.register_craft({
replacements = {{'survival:mussel_raw', 'survival:shell'}},
})
minetest.register_craft({
type = 'cooking',
output = 'survival:sugar',
recipe = 'survival:bucket_sap',
cooktime = 30,
replacements = {{'survival:bucket_sap', 'bucket:bucket_empty'}},
})

View File

@ -2,3 +2,7 @@ minetest.register_craftitem('survival:shell', {
description = 'old shell',
inventory_image = 'survival_shell.png',
})
minetest.register_craftitem('survival:bucket_sap', {
description = 'bucket with sap',
inventory_image = 'survival_bucket_sap.png',
})

View File

@ -87,3 +87,9 @@ minetest.register_craftitem('survival:mussel_cooked', {
inventory_image = 'survival_mussel_cooked.png',
on_use = minetest.item_eat(.6)
})
minetest.register_craftitem('survival:sugar', {
description = 'sugar',
inventory_image = 'survival_sugar.png',
on_use = minetest.item_eat(.75)
})

View File

@ -1,71 +1,114 @@
# Blender v2.74 (sub 2) OBJ File: ''
# Blender v2.74 (sub 4) OBJ File: ''
# www.blender.org
mtllib spigot.mtl
o Cube.001
v 0.307936 -0.492564 0.308081
v -0.308226 -0.492564 0.308081
v -0.308226 -0.492564 -0.308081
v 0.307936 -0.492564 -0.308081
v -0.308226 -0.398667 0.308081
v -0.308226 -0.398667 -0.308081
v 0.307936 -0.398668 -0.308081
v -0.048586 -0.398667 -0.048442
v 0.048297 -0.398667 -0.048442
v 0.307936 -0.398668 0.308081
v -0.048586 0.192762 -0.188080
v 0.048297 0.192762 -0.188080
v 0.048297 -0.398667 0.048442
v -0.048586 -0.398667 0.048442
v -0.048586 0.192762 -0.091197
v 0.048297 0.192762 -0.091197
v 0.048297 0.075353 -0.160359
v 0.048297 0.075353 -0.063476
v -0.048586 0.075353 -0.063476
v -0.048586 0.075353 -0.160359
v 0.048297 0.026619 -0.148853
v 0.048297 0.057857 -0.004072
v -0.048586 0.057857 -0.004072
v -0.048586 0.026619 -0.148853
v 0.048297 -0.032571 -0.134878
v 0.048297 -0.032571 -0.037995
v -0.048586 -0.032571 -0.037995
v -0.048586 -0.032571 -0.134878
vn 0.000000 -1.000000 0.000000
vn -1.000000 0.000000 0.000000
vn 0.000000 1.000000 -0.000000
vn 1.000000 0.000000 0.000000
vn -0.000000 0.000000 -1.000000
vn -0.000000 0.000000 1.000000
vn 0.000000 -0.229800 -0.973200
vn 0.000000 0.687600 0.726100
vn 0.000000 0.229800 0.973200
vn 0.000000 0.446400 0.894800
vn 0.000000 -0.063500 0.998000
usemtl None
s 1
f 1//1 2//1 3//1 4//1
f 2//2 5//2 6//2 3//2
f 7//3 6//3 8//3 9//3
f 10//4 1//4 4//4 7//4
f 4//5 3//5 6//5 7//5
f 10//6 5//6 2//6 1//6
f 17//7 20//7 11//7 12//7
f 10//3 7//3 9//3 13//3
f 5//3 10//3 13//3 14//3
f 6//3 5//3 14//3 8//3
f 15//3 16//3 12//3 11//3
f 18//4 17//4 12//4 16//4
f 19//8 18//8 16//9 15//9
f 20//2 19//2 15//2 11//2
f 24//2 23//2 19//2 20//2
f 23//10 22//10 18//8 19//8
f 22//4 21//4 17//4 18//4
f 21//7 24//7 20//7 17//7
f 25//7 28//7 24//7 21//7
f 26//4 25//4 21//4 22//4
f 27//11 26//11 22//10 23//10
f 28//2 27//2 23//2 24//2
f 8//2 14//2 27//2 28//2
f 14//9 13//9 26//11 27//11
f 13//4 9//4 25//4 26//4
f 9//7 8//7 28//7 25//7
v 0.307936 0.455513 0.501121
v -0.308226 0.455513 0.501121
v -0.308226 -0.160649 0.501121
v 0.307936 -0.160649 0.501121
v -0.308226 0.455513 0.407224
v -0.308226 -0.160649 0.407224
v 0.307936 -0.160649 0.407225
v -0.048586 0.098990 0.407224
v 0.048297 0.098990 0.407224
v 0.307936 0.455513 0.407225
v 0.048297 0.004616 0.163012
v -0.048586 0.004616 0.163012
v -0.048586 -0.023105 0.045603
v 0.048297 -0.023105 0.045603
v 0.048297 0.195874 0.407224
v -0.048586 0.195874 0.407224
v -0.048586 0.073778 0.045603
v 0.048297 0.073778 0.045603
v 0.048297 0.101499 0.163012
v -0.048586 0.101499 0.163012
v -0.048586 0.016122 0.211746
v -0.048586 0.164411 0.206822
v 0.048297 0.164411 0.206822
v 0.048297 0.016122 0.211746
v 0.048297 0.040105 0.289449
v -0.048586 0.040105 0.289449
v 0.048297 0.131006 0.255931
v -0.048586 0.131006 0.255931
vt 0.681152 0.000000
vt 0.765129 0.000000
vt 0.765129 0.618256
vt 0.681152 0.618256
vt 0.551066 0.618256
vt 0.000000 0.618256
vt 0.232210 0.357734
vt 0.318857 0.357734
vt 0.849105 0.618256
vt 0.849105 0.000000
vt 0.930565 0.000000
vt 0.930565 0.618256
vt 1.000000 0.000000
vt 1.000000 0.618256
vt 0.000000 0.878964
vt 0.086648 0.878964
vt 0.086648 1.000000
vt 0.000000 1.000000
vt 0.551066 0.000000
vt 0.318857 0.260521
vt 0.000000 0.000000
vt 0.232210 0.260521
vt 0.173295 0.618256
vt 0.259943 0.618256
vt 0.259943 0.715468
vt 0.173295 0.715468
vt 0.596823 0.663874
vt 0.681152 0.686212
vt 0.681152 0.807259
vt 0.596823 0.784921
vt 0.332820 0.618256
vt 0.332820 0.715468
vt 0.681152 0.121047
vt 0.596823 0.143385
vt 0.596823 0.022338
vt 0.681152 0.171291
vt 0.551066 0.200673
vt 0.389086 0.618256
vt 0.389086 0.715468
vt 0.551066 0.606586
vt 0.681152 0.635968
vt 0.000000 0.828725
vt 0.086648 0.828725
vt 0.000000 0.747247
vt 0.086648 0.747247
vt 0.590236 0.566331
vt 0.676245 0.554557
vt 0.086648 0.707166
vt 0.173295 0.707166
vt 0.173295 0.766762
vt 0.086648 0.766762
vt 0.676245 0.252702
vt 0.590236 0.240928
vt 0.649194 0.381291
vt 0.564865 0.403630
vt 0.086648 0.618256
vt 0.649194 0.425968
s off
f 2/1 5/2 6/3 3/4
f 7/5 6/6 8/7 9/8
f 10/9 1/3 4/2 7/10
f 4/11 3/12 6/9 7/10
f 10/12 5/11 2/13 1/14
f 11/15 12/16 13/17 14/18
f 10/19 7/5 9/8 15/20
f 5/21 10/19 15/20 16/22
f 6/6 5/21 16/22 8/7
f 17/23 18/24 14/25 13/26
f 19/27 11/28 14/29 18/30
f 20/25 19/24 18/31 17/32
f 12/33 20/34 17/35 13/1
f 21/36 22/37 20/34 12/33
f 22/32 23/31 19/38 20/39
f 23/40 24/41 11/28 19/27
f 24/42 21/43 12/16 11/15
f 25/44 26/45 21/43 24/42
f 27/46 25/47 24/41 23/40
f 28/48 27/49 23/50 22/51
f 26/52 28/53 22/37 21/36
f 8/54 16/55 28/53 26/52
f 16/56 15/23 27/49 28/48
f 15/55 9/57 25/47 27/46
f 9/6 8/56 26/45 25/44

View File

@ -7,6 +7,16 @@ local barrel_formspec =
"list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]"..
default.get_hotbar_bg(0,4.85)
local spigot_formspec =
'size[8,9]'..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[sap;main;2,4;1,1;]"..
"list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]"..
default.get_hotbar_bg(0,4.85)
minetest.register_node('survival:barrel', {
description = 'Barrel',
@ -17,7 +27,7 @@ minetest.register_node('survival:barrel', {
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", barrel_formspec)
meta:set_string("infotext", "Barrel")
@ -86,65 +96,45 @@ minetest.register_node('survival:spigot', {
drawtype = 'mesh',
mesh = 'spigot.obj',
tiles = {'default_cobble.png'},
-- inventory_image = 'new_mod_suzanne.png',
-- inventory_image = 'placeholder.png',
groups = {choppy=2, dig_immediate=2, attached_node=1},
paramtype = 'light',
paramtype2 = 'wallmounted',
paramtype2 = 'facedir',
selection_box = {
type = 'fixed',
fixed = {-.5, -.5, -.3, .5, .15, .4}, -- Right, Bottom, Back, Left, Top, Front
fixed = {-.35, -.2, 0, .35, .5, .5}, -- Right, Bottom, Back, Left, Top, Front
},
collision_box = {
type = 'fixed',
fixed = {-.5, -.5, -.3, .5, .15, .4}, -- Right, Bottom, Back, Left, Top, Front
fixed = {-.35, -.2, 0, .35, .5, .5}, -- Right, Bottom, Back, Left, Top, Front
},
--[[ Trying to get the spigot to fill containers with sap.
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
--[[ Currently this code crashes the game, not sure why
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta.get_inventory()
-- local timer = minetest.get_node_timer(pos)
meta:set_size('bucket', 1)
meta:set_string('infotext', 'Needs a bucket to collect sap.')
meta:set_string('formspec',
'size[8,9]'..
'list[nodemeta:'..pos..';frames_filled;2,1;1,1;]'..
'list[current_player;main;0,5;8,4;]'
end,
on_rightclick = function(pos, node, clicker, itemstack)
minetest.show_formspec(
clicker:get_player_name(),
'survival:spigot',
formspecs.survival:spigot(pos)
)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:contains_item('bucket:bucket_empty') then
timer:start(30)
inv:set_stack('bucket', 'survival:spigot')
return
end
end
else
meta:set_string('infotext', 'something is going on, not sure what though.')
timer:stop()
end
end,
]]
meta:set_string('formspec', spigot_formspec)
local inv = meta.get_inventory()
inv:set_size('main', 1*1)
end,]]
after_place_node = function(pos, placer, itemstack)
local n = minetest.get_node_or_nil(pos) --get the location of the placed node
local n = minetest.get_node(pos) --get the location of the placed node
if not n or not n.param2 then
minetest.remove_node(pos)
return true
end
local dir = minetest.facedir_to_dir(n.param2) --figure out what direction the node is facing
local p = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z}
local n2 = minetest.get_node_or_nil(p)
local def = minetest.registered_items[n2.name] or nil
if not n2 or not def or not def.buildable_to then --remove the node if it shouldn't be placeable.
minetest.remove_node(pos)
return true
end
local dir = minetest.facedir_to_dir(n.param2)
local p1 = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z} --node placed on
local p2 = {x=pos.x+dir.x, y=pos.y+1, z=pos.z+dir.z} --node above previous
local n2 = minetest.get_node_or_nil(p1)
local n3 = minetest.get_node_or_nil(p2)
if n2.name and n3.name ~= 'default:tree' then
minetest.remove_node(pos)
return true
--TODO make the spigot place one node above the ground.
end
end,
})
@ -167,12 +157,12 @@ minetest.register_node('survival:sleeping_bag', {
after_place_node = function(pos, placer, itemstack)
local n = minetest.get_node_or_nil(pos) --get the location of the placed node
if not n or not n.param2 then
minetest.remove_node(pos)
minetest.remove_node(pos) --???
return true
end
local dir = minetest.facedir_to_dir(n.param2) --figure out what direction the node is facing
local p = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z}
local n2 = minetest.get_node_or_nil(p)
local p = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z} --position
local n2 = minetest.get_node_or_nil(p) --what node is next in line after the node we placed?
local def = minetest.registered_items[n2.name] or nil
if not n2 or not def or not def.buildable_to then --remove the node if it shouldn't be placeable.
minetest.remove_node(pos)
@ -181,8 +171,8 @@ minetest.register_node('survival:sleeping_bag', {
end,
on_rightclick = function(pos, node, clicker)
beds.on_rightclick(pos, clicker)
-- local health = clicker:get_hp()
-- clicker:set_hp(health-2)
local health = clicker:get_hp() --should only damage if you sleep
clicker:set_hp(health-.5) --ya, like that last comment said.
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
textures/survival_sugar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B