From 52f2b617cc6fc75995bacc2f9e8d7b8354c97faa Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 18 Apr 2018 23:30:38 +0100 Subject: [PATCH] Add crafting mod --- .gitmodules | 3 ++ mods/crafting | 1 + mods/ctf_crafting/depends.txt | 1 + mods/ctf_crafting/init.lua | 73 +++++++++++++++++++++++++++++++++++ update.sh | 2 + 5 files changed, 80 insertions(+) create mode 160000 mods/crafting create mode 100644 mods/ctf_crafting/depends.txt create mode 100644 mods/ctf_crafting/init.lua diff --git a/.gitmodules b/.gitmodules index 724235d..af751f6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "mods/ctf_pvp_engine"] path = mods/ctf_pvp_engine url = https://github.com/rubenwardy/ctf_pvp_engine +[submodule "mods/crafting"] + path = mods/crafting + url = https://github.com/rubenwardy/crafting diff --git a/mods/crafting b/mods/crafting new file mode 160000 index 0000000..97c8731 --- /dev/null +++ b/mods/crafting @@ -0,0 +1 @@ +Subproject commit 97c8731b63492bd17cfbd6c09694f3a648e6ca8b diff --git a/mods/ctf_crafting/depends.txt b/mods/ctf_crafting/depends.txt new file mode 100644 index 0000000..a4d3e42 --- /dev/null +++ b/mods/ctf_crafting/depends.txt @@ -0,0 +1 @@ +crafting diff --git a/mods/ctf_crafting/init.lua b/mods/ctf_crafting/init.lua new file mode 100644 index 0000000..a4a0851 --- /dev/null +++ b/mods/ctf_crafting/init.lua @@ -0,0 +1,73 @@ +local sword_ores = { + {"wood", "default:wood"}, + {"stone", "default:cobble"}, + {"steel", "default:steel_ingot"}, + {"bronze", "default:bronze_ingot"}, + {"mese", "default:mese_crystal"}, + {"diamond", "default:diamond"}, +} +local lim_ores = { + {"wood", "default:wood"}, + {"stone", "default:cobble"}, + {"steel", "default:steel_ingot"}, +} + +for _, orex in pairs(sword_ores) do + crafting.register_recipe({ + type = "inv", + output = "default:sword_" .. orex[1], + items = { "default:stick", orex[2] .. " 2" }, + always_known = true, + level = 1, + }) +end +for _, orex in pairs(lim_ores) do + crafting.register_recipe({ + type = "inv", + output = "default:shovel_" .. orex[1], + items = { "default:stick 2", orex[2] }, + always_known = true, + level = 1, + }) +end +for _, orex in pairs(lim_ores) do + crafting.register_recipe({ + type = "inv", + output = "default:axe_" .. orex[1], + items = { "default:stick 2", orex[2] .. " 2" }, + always_known = true, + level = 1, + }) +end + +crafting.register_recipe({ + type = "inv", + output = "default:furnace", + items = { "default:cobble 10" }, + always_known = true, + level = 1, +}) + +crafting.register_recipe({ + type = "inv", + output = "doors:door_steel", + items = { "default:steel 6", }, + always_known = true, + level = 1, +}) + +crafting.register_recipe({ + type = "inv", + output = "default:wood 4", + items = { "group:tree", }, + always_known = true, + level = 1, +}) + +crafting.register_recipe({ + type = "inv", + output = "default:stick 4", + items = { "default:wood", }, + always_known = true, + level = 1, +}) diff --git a/update.sh b/update.sh index 0c79fd5..6965fd0 100755 --- a/update.sh +++ b/update.sh @@ -1,5 +1,7 @@ git pull && cd mods/ctf_pvp_engine && git pull origin master && +cd ../crafting && +git pull origin master && cd ../.. && ./build.sh ../games/capturetheflag