1
0
Fork 0

Compare commits

..

No commits in common. "mod-master" and "master" have entirely different histories.

6 changed files with 12 additions and 87 deletions

View File

@ -68,67 +68,18 @@ minetest.register_node("mcl_honey:honeycomb_block", {
})
-- Honey
-- rewirtten mobitems' drink_milk_delayed for honey
local function drink_honey_delayed(itemstack, player, pointed_thing)
if pointed_thing.type == "node" then
local node = minetest.get_node(pointed_thing.under)
if player and not player:get_player_control().sneak then
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, player, itemstack) or itemstack
end
end
elseif pointed_thing.type == "object" then
return itemstack
end
local function drink_honey(itemstack, player, pointed_thing)
-- Check if we were allowed to drink this (eat delay check)
if mcl_hunger.active and (
player:get_inventory():get_stack("main", player:get_wield_index(), itemstack) == "mcl_honey:honey_bottle" or
minetest.is_creative_enabled(player:get_player_name())
) then
-- mcl_hunger.stop_poison(player)
end
mcl_potions.clear_effect(player, "poison")
end
-- Wrapper for handling mcl_hunger delayed eating
local name = player:get_player_name()
local hunger_internal = mcl_hunger.eat_internal[name]
hunger_internal._custom_itemstack = itemstack -- Used as comparison to make sure the custom wrapper executes only when the same item is eaten
hunger_internal._custom_var = {
itemstack = itemstack,
player = player,
pointed_thing = pointed_thing,
}
hunger_internal._custom_func = drink_honey
hunger_internal._custom_wrapper = function(name)
local hunger_internal2 = mcl_hunger.eat_internal[name]
hunger_internal2._custom_func(
hunger_internal2._custom_var.itemstack,
hunger_internal2._custom_var.player,
hunger_internal2._custom_var.pointed_thing
)
end
minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, player, pointed_thing)
end
-- Register the honey bottle item
minetest.register_craftitem("mcl_honey:honey_bottle", {
description = S("Honey Bottle"),
docitems_longdesc = S("Honey Bottle is used to craft honey blocks and to restore hunger points. It also stops poisoning"),
docitems_usagehelp = S("Drinking will restore 6 hunger points and stop poison. Can also be used to craft honey blocks."),
inventory_image = "mcl_honey_honey_bottle.png",
groups = { craftitem = 1, food = 3, eatable = 6, can_eat_when_full = 1 },
on_place = drink_honey_delayed,
on_secondary_use = drink_honey_delayed,
mclsaturation = 1.2,
stack_max = 16,
description = S("Honey Bottle"),
_doc_items_longdesc = S("Honey Bottle is used to craft honey blocks and to restore hunger points."),
_doc_items_usagehelp = S("Drinking will restore 6 hunger points. Can also be used to craft honey blocks."),
inventory_image = "mcl_honey_honey_bottle.png",
groups = { craftitem = 1, food = 3, eatable = 6, can_eat_when_full = 1 },
on_place = minetest.item_eat(6, "mcl_potions:glass_bottle"),
on_secondary_use = minetest.item_eat(6, "mcl_potions:glass_bottle"),
_mcl_saturation = 1.2,
stack_max = 16,
})
minetest.register_node("mcl_honey:honey_block", {
description = S("Honey Block"),
_doc_items_longdesc = S("Honey Block. Used as a decoration and in redstone. Is sticky on some sides."),

View File

@ -440,22 +440,6 @@ minetest.register_craftitem("mcl_mobitems:heart_of_the_sea", {
local horse_armor_use = S("Place it on a horse to put on the horse armor. Donkeys and mules can't wear horse armor.")
-- https://minecraft.fandom.com/wiki/Armor#Damage_protection
minetest.register_craftitem("mcl_mobitems:leather_horse_armor", {
description = S("Leather Horse Armor"),
_doc_items_longdesc = S("Leather horse armor can be worn by horses to increase their protection from harm a little."),
_doc_items_usagehelp = horse_armor_use,
inventory_image = "mcl_mobitems_leather_horse_armor.png",
_horse_overlay_image = "mcl_mobitems_horse_armor_leather.png",
sounds = {
_mcl_armor_equip = "mcl_armor_equip_leather",
},
stack_max = 1,
groups = { horse_armor = 88 },
})
minetest.register_craftitem("mcl_mobitems:iron_horse_armor", {
description = S("Iron Horse Armor"),
_doc_items_longdesc = S("Iron horse armor can be worn by horses to increase their protection from harm a bit."),
@ -466,10 +450,9 @@ minetest.register_craftitem("mcl_mobitems:iron_horse_armor", {
_mcl_armor_equip = "mcl_armor_equip_iron",
},
stack_max = 1,
groups = { horse_armor = 80 },
groups = { horse_armor = 85 },
})
minetest.register_craftitem("mcl_mobitems:gold_horse_armor", {
description = S("Golden Horse Armor"),
_doc_items_longdesc = S("Golden horse armor can be worn by horses to increase their protection from harm."),
@ -480,7 +463,7 @@ minetest.register_craftitem("mcl_mobitems:gold_horse_armor", {
_mcl_armor_equip = "mcl_armor_equip_iron",
},
stack_max = 1,
groups = { horse_armor = 72 },
groups = { horse_armor = 60 },
})
minetest.register_craftitem("mcl_mobitems:diamond_horse_armor", {
@ -493,7 +476,7 @@ minetest.register_craftitem("mcl_mobitems:diamond_horse_armor", {
_mcl_armor_equip = "mcl_armor_equip_diamond",
},
stack_max = 1,
groups = { horse_armor = 56 },
groups = { horse_armor = 45 },
})
minetest.register_alias("mobs_mc:iron_horse_armor", "mcl_mobitems:iron_horse_armor")
@ -635,13 +618,6 @@ minetest.register_craft({
{"mcl_mobitems:slimeball","mcl_mobitems:slimeball","mcl_mobitems:slimeball",}},
})
minetest.register_craft({
output = "mcl_mobitems:leather_horse_armor",
recipe = {{"mcl_mobitems:leather","","mcl_mobitems:leather",},
{"mcl_mobitems:leather","mcl_mobitems:leather","mcl_mobitems:leather",},
{"mcl_mobitems:leather","","mcl_mobitems:leather",}},
})
minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing) -- poisoning with spider eye
if itemstack:get_name() == "mcl_mobitems:spider_eye" then
mcl_potions.give_effect_by_level("poison", user, 1, 4)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -667,8 +667,6 @@ Source path,Source file,Target file,xs,ys,xl,yl,xt,yt,Blacklisted?
/assets/minecraft/textures/item,heart_of_the_sea.png,mcl_mobitems_heart_of_the_sea.png,,,,,,,
/assets/minecraft/textures/item,ink_sac.png,mcl_mobitems_ink_sac.png,,,,,,,
/assets/minecraft/textures/item,iron_horse_armor.png,mcl_mobitems_iron_horse_armor.png,,,,,,,
/assets/minecraft/textures/item,leather_horse_armor.png,mcl_mobitems_leather_horse_armor.png,,,,,,,
/assets/minecraft/textures/item,leather_horse_armor.png,mobs_mc_leather_horse_armor.png,,,,,,,
/assets/minecraft/textures/item,nautilus_shell.png,mcl_mobitems_nautilus_shell.png,,,,,,,
/assets/minecraft/textures/item,warped_fungus_on_a_stick.png,mcl_mobitems_warped_fungus_on_a_stick.png,,,,,,,
/assets/minecraft/textures/item,golden_horse_armor.png,mcl_mobitems_gold_horse_armor.png,,,,,,,

1 Source path Source file Target file xs ys xl yl xt yt Blacklisted?
667 /assets/minecraft/textures/item heart_of_the_sea.png mcl_mobitems_heart_of_the_sea.png
668 /assets/minecraft/textures/item ink_sac.png mcl_mobitems_ink_sac.png
669 /assets/minecraft/textures/item iron_horse_armor.png mcl_mobitems_iron_horse_armor.png
/assets/minecraft/textures/item leather_horse_armor.png mcl_mobitems_leather_horse_armor.png
/assets/minecraft/textures/item leather_horse_armor.png mobs_mc_leather_horse_armor.png
670 /assets/minecraft/textures/item nautilus_shell.png mcl_mobitems_nautilus_shell.png
671 /assets/minecraft/textures/item warped_fungus_on_a_stick.png mcl_mobitems_warped_fungus_on_a_stick.png
672 /assets/minecraft/textures/item golden_horse_armor.png mcl_mobitems_gold_horse_armor.png