mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 17:50:37 +01:00
Fixed nether's apples' crash
- Updated API used to increase hunger by nether apples causing crash
This commit is contained in:
parent
1f9c1a484d
commit
eaf7d1460e
@ -367,7 +367,7 @@ minetest.register_node("nether:apple", {
|
|||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
local p_hunger = tonumber(hud.hunger[user:get_player_name()])
|
local p_hunger = tonumber(hbhunger.hunger[user:get_player_name()])
|
||||||
if not p_hunger then
|
if not p_hunger then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -375,8 +375,8 @@ minetest.register_node("nether:apple", {
|
|||||||
if p_hunger > 30 then
|
if p_hunger > 30 then
|
||||||
p_hunger = 30
|
p_hunger = 30
|
||||||
end
|
end
|
||||||
hud.hunger[user:get_player_name()] = p_hunger
|
hbhunger.hunger[user:get_player_name()] = p_hunger
|
||||||
hud.set_hunger(user)
|
hbhunger.set_hunger(user)
|
||||||
|
|
||||||
local amount = math.random(4, 6)
|
local amount = math.random(4, 6)
|
||||||
inv:add_item("main", {name="nether:blood_extracted", count=math.floor(amount/3)})
|
inv:add_item("main", {name="nether:blood_extracted", count=math.floor(amount/3)})
|
||||||
|
Loading…
Reference in New Issue
Block a user