mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-04-30 05:01:41 -04:00
Use cleaner gsub instead of if-sub
This commit is contained in:
parent
570c0f299a
commit
23104f298f
1 changed files with 3 additions and 9 deletions
|
@ -364,9 +364,7 @@ function default.register_fence(name, def)
|
|||
|
||||
-- Register crafting recipe, trim away starting colon if any
|
||||
if not material then return end
|
||||
if string.sub(name, 1,1) == ":" then
|
||||
name = string.sub(name, 2)
|
||||
end
|
||||
name = string.gsub(name, "^:", "")
|
||||
minetest.register_craft({
|
||||
output = name .. " 4",
|
||||
recipe = {
|
||||
|
@ -438,9 +436,7 @@ function default.register_fence_rail(name, def)
|
|||
|
||||
-- Register crafting recipe, trim away starting colon if any
|
||||
if not material then return end
|
||||
if string.sub(name, 1,1) == ":" then
|
||||
name = string.sub(name, 2)
|
||||
end
|
||||
name = string.gsub(name, "^:", "")
|
||||
minetest.register_craft({
|
||||
output = name .. " 16",
|
||||
recipe = {
|
||||
|
@ -491,9 +487,7 @@ function default.register_mesepost(name, def)
|
|||
|
||||
-- Register crafting recipe, trim away starting colon if any
|
||||
if not material then return end
|
||||
if string.sub(name, 1,1) == ":" then
|
||||
name = string.sub(name, 2)
|
||||
end
|
||||
name = string.gsub(name, "^:", "")
|
||||
minetest.register_craft({
|
||||
output = name .. " 4",
|
||||
recipe = {
|
||||
|
|
Loading…
Add table
Reference in a new issue