develop #28

Merged
milan merged 8 commits from develop into master 2021-01-15 11:19:19 +01:00
13 changed files with 99 additions and 65 deletions
Showing only changes of commit e04978bddf - Show all commits

View file

@ -54,10 +54,7 @@ minetest.register_node("christmas:eggnog", {
}) })
minetest.register_node("christmas:present", { minetest.register_node("christmas:present", {
description = "Christmas present", description = "Christmas present",
tiles = { tiles = {"christmas_present.png"},
"christmas_present.png",
"christmas_present_top.png"
},
drawtype = "mesh", drawtype = "mesh",
paramtype = "light", paramtype = "light",
mesh = "christmas_present.obj", mesh = "christmas_present.obj",

View file

@ -481,7 +481,7 @@ if minetest.get_modpath("moreores") then
{"", "", "group:stick"} {"", "", "group:stick"}
} }
}) })
--[[
farming.register_hoe(":moreores:hoe_silver", { farming.register_hoe(":moreores:hoe_silver", {
description = S("%s Hoe"):format(S("Silver")), description = S("%s Hoe"):format(S("Silver")),
inventory_image = "moreores_tool_silverhoe.png", inventory_image = "moreores_tool_silverhoe.png",
@ -510,5 +510,5 @@ if minetest.get_modpath("moreores") then
minetest.override_item("moreores:hoe_mithril", { minetest.override_item("moreores:hoe_mithril", {
original_description = desc, original_description = desc,
description = toolranks.create_description(desc)}) description = toolranks.create_description(desc)})
end end]]
end end

View file

@ -149,7 +149,7 @@ Created by OgelGames (CC BY-SA 4.0)
farming_cactus_juice.png farming_cactus_juice.png
farming_salad.png farming_salad.png
Created by Felfa Created by Felfa (CC0)
farming_blackberry*.png farming_blackberry*.png
farming_lettuce*.png farming_lettuce*.png
farming_burger.png farming_burger.png

View file

@ -1 +1,4 @@
name = farming name = farming
depends = default
optional_depends = stairs, intllib, lucky_block, toolranks
description = Adds many plants and food to Minetest

View file

@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = { mobs = {
mod = "redo", mod = "redo",
version = "20201206", version = "20210102",
intllib = S, intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {} invis = minetest.global_exists("invisibility") and invisibility or {}
} }
@ -4503,10 +4503,10 @@ function mobs:capture_mob(self, clicker, chance_hand, chance_net,
minetest.add_item(clicker:get_pos(), new_stack) minetest.add_item(clicker:get_pos(), new_stack)
end end
remove_mob(self, true)
self:mob_sound("default_place_node_hard") self:mob_sound("default_place_node_hard")
remove_mob(self, true)
return new_stack return new_stack
-- when chance above fails or set to 0, miss! -- when chance above fails or set to 0, miss!

View file

@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased] ## [Unreleased]
### Changed
- Refactored recipe override mechanism to avoid re-coding recipes
when we only want to change the amount produced.
- [Realigned rail recipe to the changes made in Minetest Game.](https://github.com/minetest-mods/moreblocks/pull/169)
- All rail recipes (standard, power, break) were boosted by 50%.
### Fixed ### Fixed
- [Fixed strange placement behavior for non-default Stairs+ nodes.](https://github.com/minetest-mods/moreblocks/pull/168) - [Fixed strange placement behavior for non-default Stairs+ nodes.](https://github.com/minetest-mods/moreblocks/pull/168)

View file

@ -5,64 +5,78 @@ Copyright © 2011-2020 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information. Licensed under the zlib license. See LICENSE.md for more information.
--]] --]]
-- Redefinitions of some default crafting recipes: local modname = minetest.get_current_modname()
-- Signs: +1 -- Redefine some of the default crafting recipes to be more productive
minetest.clear_craft({
recipe = { -- Auxiliary function: take a recipe as returned by get_all_craft_recipes
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, -- and turn it into a table that can be used to clear a craft or declare a new one
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, local reconstruct_internal_craft = function(recipe)
{'', 'group:stick', ''}, local recp = {
{ "", "", "" },
{ "", "", "" },
{ "", "", "" },
} }
}) for idx, item in pairs(recipe.items) do
local row = math.ceil(idx / recipe.width)
local col = idx - (row-1)*recipe.width
recp[row][col] = item
end
return recp
end
minetest.clear_craft({ -- Change the amount produced by recipe by apply func to the old amount
recipe = { local change_recipe_amount = function(product, recipe, func)
{'group:wood', 'group:wood', 'group:wood'}, local recp = reconstruct_internal_craft(recipe)
{'group:wood', 'group:wood', 'group:wood'},
{'', 'group:stick', ''},
}
})
minetest.register_craft({ local oldamount = tonumber(recipe.output:match(" [0-9]+$") or "1")
output = 'default:sign_wall_steel 4',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', 'group:stick', ''},
}
})
minetest.register_craft({ local newamount = func(oldamount)
output = 'default:sign_wall_wood 4',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
{'', 'group:stick', ''},
}
})
-- remove old crafting recipe
local redo = { recipe = recp }
minetest.clear_craft(redo)
minetest.clear_craft({ -- new output
recipe = { redo.output = ("%s %d"):format(product, newamount)
{"default:papyrus", "default:papyrus", "default:papyrus"} minetest.register_craft(redo)
}
})
minetest.register_craft({
output = "default:paper 4",
recipe = {
{"default:papyrus", "default:papyrus", "default:papyrus"},
}
})
minetest.log("action", ("[MOD]%s: recipe for %s production: %d => %d"):format(modname, product, oldamount, newamount))
end
minetest.register_craft({ local increase_craft_production = function(product, func)
output = "default:rail 24", local recipes = minetest.get_all_craft_recipes(product)
recipe = { for _, r in pairs(recipes) do
{"default:steel_ingot", "", "default:steel_ingot"}, if r.type == "normal" or r.method == "normal" then
{"default:steel_ingot", "default:stick", "default:steel_ingot"}, change_recipe_amount(product, r, func)
{"default:steel_ingot", "", "default:steel_ingot"}, end
} end
end
-- Increase the crafting production according to the rules from the table, which is in the form:
-- {
-- { detector, amount changing function }
-- { detector, amount changing function }
-- }
-- TODO: consider exporting this function to other mods
local increase_craft_production_table = function(map_table)
for product, _ in pairs(minetest.registered_items) do
for _, tab in pairs(map_table) do
local detector = tab[1]
local func = tab[2]
if detector(product) then
increase_craft_production(product, func)
-- only apply one boost
break
end
end
end
end
increase_craft_production_table({
{ function(n) return n:match('^default:sign_wall') end, function(old) return old + 1 end },
{ function(n) return n == 'default:paper' end, function(old) return old*4 end },
{ function(n) return n:match('^carts:.*rail$') or n:match('^default:.*rail$') end, function(old) return old + old/2 end },
}) })
minetest.register_craft({ minetest.register_craft({

View file

@ -0,0 +1,3 @@
MUD
Mihin Dissanayake
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
MUD
Mihin Dissanayake
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View file

@ -45,10 +45,12 @@ local function get_int_attribute(player)
end end
local stamina_enabled = minetest.settings:get_bool("enable_stamina") ~= false
local function stamina_update_level(player, level) local function stamina_update_level(player, level)
-- pipeworks fake player check -- pipeworks fake player check
if not player.get_attribute then if not player.get_attribute or not stamina_enabled then
return nil return nil
end end
@ -129,8 +131,8 @@ end
-- Sprint settings and function -- Sprint settings and function
local enable_sprint = minetest.setting_getbool("sprint") ~= false local enable_sprint = minetest.settings:get_bool("sprint") ~= false
local enable_sprint_particles = minetest.setting_getbool("sprint_particles") ~= false local enable_sprint_particles = minetest.settings:get_bool("sprint_particles") ~= false
local monoids = minetest.get_modpath("player_monoids") local monoids = minetest.get_modpath("player_monoids")
local pova_mod = minetest.get_modpath("pova") local pova_mod = minetest.get_modpath("pova")
@ -567,8 +569,8 @@ end
-- stamina is disabled if damage is disabled -- stamina is disabled if damage is disabled
if minetest.setting_getbool("enable_damage") if minetest.settings:get_bool("enable_damage")
and minetest.setting_get("enable_stamina") ~= false then and minetest.settings:get_bool("enable_stamina") ~= false then
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)

View file

@ -0,0 +1,5 @@
sprint (Enable sprint) bool true
sprint_particles (Enable sprint particles) bool true
enable_stamina (Enable stamina/hunger) bool true