Fixed deprecated calls. Minor file cleanup. (#3)
This commit is contained in:
parent
aabecb3595
commit
548904328a
12
init.lua
12
init.lua
@ -17,7 +17,7 @@ for i, size in ipairs(sizes) do
|
|||||||
local description
|
local description
|
||||||
local drop
|
local drop
|
||||||
local tiles
|
local tiles
|
||||||
|
|
||||||
if slice == 0 then
|
if slice == 0 then
|
||||||
name = "cake:cake"
|
name = "cake:cake"
|
||||||
description = S("Cake")
|
description = S("Cake")
|
||||||
@ -28,7 +28,7 @@ for i, size in ipairs(sizes) do
|
|||||||
drop = ''
|
drop = ''
|
||||||
tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png", "cake_inner.png", "cake_side.png", "cake_side.png"}
|
tiles = {"cake_top.png", "cake_bottom.png", "cake_side.png", "cake_inner.png", "cake_side.png", "cake_side.png"}
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node(name, {
|
minetest.register_node(name, {
|
||||||
description = description,
|
description = description,
|
||||||
drop = drop,
|
drop = drop,
|
||||||
@ -48,7 +48,7 @@ for i, size in ipairs(sizes) do
|
|||||||
},
|
},
|
||||||
on_rightclick = function(pos, node, clicker)
|
on_rightclick = function(pos, node, clicker)
|
||||||
clicker:set_hp(clicker:get_hp() + 1)
|
clicker:set_hp(clicker:get_hp() + 1)
|
||||||
|
|
||||||
if i < #sizes then
|
if i < #sizes then
|
||||||
minetest.swap_node(pos, {name="cake:cake_"..i})
|
minetest.swap_node(pos, {name="cake:cake_"..i})
|
||||||
else
|
else
|
||||||
@ -64,7 +64,7 @@ if not minetest.get_modpath("food") then
|
|||||||
inventory_image = "cake_sugar.png",
|
inventory_image = "cake_sugar.png",
|
||||||
groups = {food_sugar=1}
|
groups = {food_sugar=1}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "cake:sugar",
|
output = "cake:sugar",
|
||||||
@ -80,7 +80,7 @@ minetest.register_craft({
|
|||||||
recipe = {"farming:flour", "group:water_bucket", "group:food_sugar", "group:food_sugar"},
|
recipe = {"farming:flour", "group:water_bucket", "group:food_sugar", "group:food_sugar"},
|
||||||
replacements = {
|
replacements = {
|
||||||
{"group:water_bucket", "bucket:bucket_empty"},
|
{"group:water_bucket", "bucket:bucket_empty"},
|
||||||
|
|
||||||
-- Not needed >0.4.13
|
-- Not needed >0.4.13
|
||||||
{"bucket:bucket_water", "bucket:bucket_empty"},
|
{"bucket:bucket_water", "bucket:bucket_empty"},
|
||||||
{"bucket:bucket_river_water", "bucket:bucket_empty"}
|
{"bucket:bucket_river_water", "bucket:bucket_empty"}
|
||||||
@ -123,7 +123,7 @@ minetest.register_entity("cake:cake_entity", {
|
|||||||
if throwable_cake then
|
if throwable_cake then
|
||||||
minetest.override_item("cake:cake", {
|
minetest.override_item("cake:cake", {
|
||||||
on_use = function(itemstack, player, pointed_thing)
|
on_use = function(itemstack, player, pointed_thing)
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
local playerpos = player:getpos()
|
local playerpos = player:getpos()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user