Default: update and add Green Apple

This commit is contained in:
MoNTE48 2021-06-15 00:36:28 +02:00
parent c05307e12b
commit 5fa0394331
11 changed files with 69 additions and 26 deletions

View File

@ -1 +1,2 @@
default
default
dungeon_loot?

View File

@ -288,3 +288,17 @@ minetest.register_privilege("bucket", {
description = "Can use the bucket at any height",
give_to_singleplayer = false
})
-- Register buckets as dungeon loot
if minetest.global_exists("dungeon_loot") then
dungeon_loot.register({
{name = "bucket:bucket_empty", chance = 0.55},
-- water in deserts/ice or above ground, lava otherwise
{name = "bucket:bucket_water", chance = 0.45,
types = {"sandstone", "desert", "ice"}},
{name = "bucket:bucket_water", chance = 0.45, y = {0, 32768},
types = {"normal"}},
{name = "bucket:bucket_lava", chance = 0.45, y = {-32768, -1},
types = {"normal"}}
})
end

View File

@ -242,6 +242,15 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "default:quartz_chiseled 3",
recipe = {
{"default:quartz_pillar"},
{"default:quartz_pillar"},
{"default:quartz_pillar"}
}
})
minetest.register_craft({
output = "default:glowstone",
recipe = {
@ -283,7 +292,7 @@ minetest.register_craft({
output = "default:apple_gold",
recipe = {
{"", "default:gold_ingot", ""},
{"default:gold_ingot", "default:apple", "default:gold_ingot"},
{"default:gold_ingot", "group:apple", "default:gold_ingot"},
{"", "default:gold_ingot", ""}
}
})

View File

@ -10,7 +10,7 @@ local function book_on_use(itemstack, user)
-- Backwards compatibility
local old_data = minetest.deserialize(itemstack:get_metadata())
if old_data then
meta:from_table({ fields = old_data })
meta:from_table({fields = old_data})
end
local data = meta:to_table().fields
@ -21,7 +21,7 @@ local function book_on_use(itemstack, user)
owner = data.owner
for str in (text .. "\n"):gmatch("([^\n]*)[\n]") do
lines[#lines+1] = str
lines[#lines + 1] = str
end
if data.page then
@ -62,8 +62,8 @@ local function book_on_use(itemstack, user)
end
local max_text_size = 10000
local max_title_size = 80
local short_title_size = 35
local max_title_size = 50
local short_title_size = 30
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "default:book" then return end
local inv = player:get_inventory()
@ -103,14 +103,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)
if new_stack then
new_stack:get_meta():from_table({ fields = data })
new_stack:get_meta():from_table({fields = data})
if inv:room_for_item("main", new_stack) then
inv:add_item("main", new_stack)
else
minetest.add_item(player:get_pos(), new_stack)
end
else
stack:get_meta():from_table({ fields = data })
stack:get_meta():from_table({fields = data})
end
elseif fields.book_next or fields.book_prev then
@ -378,7 +378,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = "default:sugar",
output = "default:sugar 2",
recipe = {
{"default:sugarcane"}
}

View File

@ -385,7 +385,7 @@ minetest.register_node("default:leaves", {
})
minetest.register_node("default:apple", {
description = "Apple",
description = "Red Apple",
drawtype = "plantlike",
visual_scale = 0.75,
tiles = {"default_apple.png"},
@ -399,7 +399,27 @@ minetest.register_node("default:apple", {
fixed = {-3/16, -0.5, -3/16, 3/16, 1/4, 3/16}
},
groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1, food = 1},
leafdecay = 3, leafdecay_drop = 1, apple = 1, food = 1},
on_use = minetest.item_eat(3),
sounds = default.node_sound_leaves_defaults()
})
minetest.register_node("default:apple_green", {
description = "Green Apple",
drawtype = "plantlike",
visual_scale = 0.75,
tiles = {"default_apple_green.png"},
inventory_image = "default_apple_green.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
is_ground_content = false,
selection_box = {
type = "fixed",
fixed = {-3/16, -0.5, -3/16, 3/16, 1/4, 3/16}
},
groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1, apple = 1, food = 1},
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults()
})
@ -691,7 +711,7 @@ minetest.register_node("default:birch_leaves", {
paramtype = "light",
walkable = false,
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, speed = -20},
drop = {
max_items = 1,
items = {
@ -1249,10 +1269,11 @@ minetest.register_node("default:bush_stem", {
minetest.register_node("default:bush_leaves", {
description = "Bush Leaves",
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_leaves.png"},
paramtype = "light",
walkable = false,
groups = {snappy = 3, flammable = 2, leaves = 1},
groups = {snappy = 3, flammable = 2, leaves = 1, speed = -20},
drop = {
max_items = 1,
items = {
@ -1320,10 +1341,11 @@ minetest.register_node("default:blueberry_bush_stem", {
minetest.register_node("default:blueberry_bush_leaves_with_berries", {
description = "Blueberry Bush Leaves with Berries",
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_blueberry_bush_leaves.png^default_blueberry_overlay.png"},
paramtype = "light",
walkable = false,
groups = {snappy = 3, flammable = 2, leaves = 1, dig_immediate = 2},
groups = {snappy = 3, flammable = 2, leaves = 1, dig_immediate = 2, speed = -20},
drop = "default:blueberries",
sounds = default.node_sound_leaves_defaults({
dig = {name = "default_dig_snappy", gain = 0.5}
@ -1343,10 +1365,11 @@ minetest.register_node("default:blueberry_bush_leaves_with_berries", {
minetest.register_node("default:blueberry_bush_leaves", {
description = "Blueberry Bush Leaves",
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_blueberry_bush_leaves.png"},
paramtype = "light",
walkable = false,
groups = {snappy = 3, flammable = 2, leaves = 1},
groups = {snappy = 3, flammable = 2, leaves = 1, speed = -20},
drop = {
max_items = 1,
items = {
@ -1422,10 +1445,11 @@ minetest.register_node("default:acacia_bush_stem", {
minetest.register_node("default:acacia_bush_leaves", {
description = "Acacia Bush Leaves",
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_acacia_leaves.png"},
paramtype = "light",
walkable = false,
groups = {snappy = 3, flammable = 2, leaves = 1},
groups = {snappy = 3, flammable = 2, leaves = 1, speed = -20},
drop = {
max_items = 1,
items = {

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

View File

@ -1,11 +1,4 @@
dungeon_loot.registered_loot = {
-- buckets
{name = "bucket:bucket_empty", chance = 0.55},
-- water in deserts or above ground, lava otherwise
{name = "bucket:bucket_water", chance = 0.45, types = {"sandstone", "desert"}},
{name = "bucket:bucket_water", chance = 0.45, y = {0, 256}, types = {"normal"}},
{name = "bucket:bucket_lava", chance = 0.45, y = {-64, -1}, types = {"normal"}},
-- various items
{name = "default:stick", chance = 0.6, count = {3, 6}},
{name = "default:flint", chance = 0.4, count = {1, 3}},
@ -13,7 +6,8 @@ dungeon_loot.registered_loot = {
{name = "carts:rail", chance = 0.35, count = {1, 6}},
-- farming / consumable
{name = "default:apple", chance = 0.4, count = {1, 4}},
{name = "default:apple", chance = 0.3, count = {1, 3}},
{name = "default:apple_green", chance = 0.3, count = {1, 3}},
{name = "default:cactus", chance = 0.4, count = {1, 4}, types = {"sandstone", "desert"}},
-- trees sappling

View File

@ -62,7 +62,8 @@ Apple Tree=Яблочное Дерево
Apple Wood Planks=Доски Яблони
Apple Tree Sapling=Деревце Яблони
Apple Tree Leaves=Яблочные Листья
Apple=Яблоко
Red Apple=Красное Яблоко
Green Apple=Зелёное Яблоко
Golden Apple=Золотое Яблоко
Jungle Tree=Джунгли-дерево
Jungle Wood Planks=Доски из Джунгли-дерева

View File

@ -39,7 +39,7 @@ mobs:register_mob("mobs_animal:pig", {
walk_start = 61, walk_end = 80,
punch_start = 90, punch_end = 110
},
follow = {"default:apple", "farming_addons:carrot", "farming_addons:potato"},
follow = {"group:apple", "farming_addons:carrot", "farming_addons:potato"},
on_rightclick = function(self, clicker)
mobs:feed_tame(self, clicker, 8, true, true)