diff options
author | root <root@mirzakhani.gpcf.eu> | 2018-05-13 10:53:23 +0200 |
---|---|---|
committer | root <root@mirzakhani.gpcf.eu> | 2018-05-13 10:53:23 +0200 |
commit | f97fbdc83db182efd984f16cc5a0508bd3fc65f3 (patch) | |
tree | f46bb9bd7d529ddcd33b31d1787a2154f018b5c2 | |
parent | 2d539fdc5bd2685b7833f48226142267c0187bf3 (diff) | |
parent | f042bbdfe3ed948d1a67d2420e3de1c24a153111 (diff) |
Merge https://github.com/h-v-smacker/technic
-rw-r--r-- | extranodes/depends.txt | 1 | ||||
-rw-r--r-- | extranodes/extramesecons.lua | 57 | ||||
-rw-r--r-- | extranodes/init.lua | 1 | ||||
-rw-r--r-- | extranodes/textures/mesecons_switch_locked_frame.png | bin | 0 -> 178 bytes | |||
-rw-r--r-- | technic/machines/register/alloy_recipes.lua | 3 | ||||
-rw-r--r-- | technic/machines/register/extractor_recipes.lua | 8 | ||||
-rw-r--r-- | technic/machines/register/grinder_recipes.lua | 12 | ||||
-rw-r--r-- | technic/tools/lawn_trimmer.lua | 10 | ||||
-rw-r--r-- | technic/tools/planter.lua | 4 |
9 files changed, 87 insertions, 9 deletions
diff --git a/extranodes/depends.txt b/extranodes/depends.txt index 2ded643..fa27879 100644 --- a/extranodes/depends.txt +++ b/extranodes/depends.txt @@ -1,6 +1,7 @@ default technic? pipeworks? +mesecons? technic_worldgen concrete unifieddyes? diff --git a/extranodes/extramesecons.lua b/extranodes/extramesecons.lua new file mode 100644 index 0000000..1dd712d --- /dev/null +++ b/extranodes/extramesecons.lua @@ -0,0 +1,57 @@ +local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + +if minetest.get_modpath("mesecons") then + + mesecon.register_node("extranodes:mesecon_switch_protected", { + paramtype2="facedir", + description="Switch (protected)", + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), + after_place_node = function(pos, placer, itemstack, pointed_thing) + local meta = minetest:get_meta(pos) + meta:set_string("owner", placer:get_player_name() or "") + end, + on_rightclick = function (pos, node, player) + local meta = minetest:get_meta(pos) + local owner = meta:get_string("owner") + local pname = player:get_player_name(); + if owner ~= pname then + minetest.chat_send_player(pname, "This switch can only be used by " .. owner) + return + end + if(mesecon.flipstate(pos, node) == "on") then + mesecon.receptor_on(pos) + else + mesecon.receptor_off(pos) + end + minetest.sound_play("mesecons_switch", {pos=pos}) + end + },{ + groups = {dig_immediate=2}, + tiles = { "mesecons_switch_side.png", "mesecons_switch_side.png", + "mesecons_switch_side.png^default_key.png", "mesecons_switch_side.png^default_key.png", + "mesecons_switch_side.png", "mesecons_switch_off.png^mesecons_switch_locked_frame.png"}, + mesecons = {receptor = { state = mesecon.state.off }} + },{ + groups = {dig_immediate=2, not_in_creative_inventory=1}, + tiles = { "mesecons_switch_side.png", "mesecons_switch_side.png", + "mesecons_switch_side.png^default_key.png", "mesecons_switch_side.png^default_key.png", + "mesecons_switch_side.png", "mesecons_switch_on.png^mesecons_switch_locked_frame.png"}, + mesecons = {receptor = { state = mesecon.state.on }} + }) + + minetest.register_craft({ + output = "extranodes:mesecon_switch_protected_off 2", + recipe = { + {"default:steel_ingot", "default:cobble", "default:steel_ingot"}, + {"group:mesecon_conductor_craftable","default:skeleton_key", "group:mesecon_conductor_craftable"}, + } + }) + + minetest.register_craft({ + output = "extranodes:mesecon_switch_protected_off", + type = "shapeless", + recipe = {"default:skeleton_key", "mesecons_switch:mesecon_switch_off"} + }) + +end
\ No newline at end of file diff --git a/extranodes/init.lua b/extranodes/init.lua index 118dc0a..69cb820 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -8,6 +8,7 @@ local path = string.gsub(technic.modpath, "technic/technic", "technic/extranodes dofile(path.."/aspirin.lua") dofile(path.."/trampoline.lua") dofile(path.."/extratubes.lua") +dofile(path.."/extramesecons.lua") dofile(path.."/lox.lua") if minetest.get_modpath("bakedclay") then diff --git a/extranodes/textures/mesecons_switch_locked_frame.png b/extranodes/textures/mesecons_switch_locked_frame.png Binary files differnew file mode 100644 index 0000000..239f97e --- /dev/null +++ b/extranodes/textures/mesecons_switch_locked_frame.png diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index 633e878..0d40b77 100644 --- a/technic/machines/register/alloy_recipes.lua +++ b/technic/machines/register/alloy_recipes.lua @@ -50,8 +50,9 @@ if minetest.get_modpath("bakedclay") then "green", "cyan", "blue", "magenta", "orange", "violet", "brown", "pink", "dark_grey", "dark_green"} + -- the recipe of the bakedclay mod yields 8 blocks, so we'll do two times better for _,c in ipairs(clay) do - table.insert(recipes, {"default:clay 8", "dye:" .. c, "bakedclay:" .. c}) + table.insert(recipes, {"default:clay 8", "dye:" .. c, "bakedclay:" .. c .. " 16"}) end end diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index 2627dd7..34d97ab 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -63,6 +63,14 @@ if minetest.get_modpath("dye") then table.insert(dye_recipes, {"ethereal:crystalgrass", "dye:blue 4"}) end + if minetest.get_modpath("bakedclay") then + table.insert(dye_recipes, {"bakedclay:delphinium", "dye:cyan 8"}) + table.insert(dye_recipes, {"bakedclay:thistle", "dye:magenta 8"}) + table.insert(dye_recipes, {"bakedclay:lazarus", "dye:pink 8"}) + table.insert(dye_recipes, {"bakedclay:mannagrass", "dye:dark_green 8"}) + end + + if minetest.get_modpath("bonemeal") then table.insert(dye_recipes, {"bonemeal:bone", "dye:white 8"}) table.insert(dye_recipes, {"bonemeal:bonemeal", "dye:white 4"}) diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index b0e5f9e..3726053 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -60,11 +60,13 @@ end -- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe) -- this snippet, when executed, also corrupts some dye+wool combinations. A remedial -- workaround is included in extractor recipes, since it's where we work with dyes. -minetest.clear_craft({ - recipe = { - {"default:sandstone"} - } -}) +-- UPD: after due consideration, this recipe removal is rejected altogether. +-- The dye workaround, however, stays, just to be safe. +-- minetest.clear_craft({ +-- recipe = { +-- {"default:sandstone"} +-- } +-- }) if minetest.get_modpath("farming") then table.insert(recipes, {"farming:seed_wheat", "farming:flour 1"}) diff --git a/technic/tools/lawn_trimmer.lua b/technic/tools/lawn_trimmer.lua index 1be0d52..6ba1427 100644 --- a/technic/tools/lawn_trimmer.lua +++ b/technic/tools/lawn_trimmer.lua @@ -65,7 +65,7 @@ end -- Perform the trimming action -local function trim_the_lawn(itemstack, user) +local function trim_the_lawn(itemstack, user, pointed_thing) local meta = minetest.deserialize(itemstack:get_metadata()) local keys = user:get_player_control() @@ -79,7 +79,13 @@ local function trim_the_lawn(itemstack, user) return -- no charge for even a single node, aborting end - local pos = user:get_pos() + local pos + if user.get_pos ~= nil then + pos = user:get_pos() + else + -- we are held in a node breaker + pos = pointed_thing.under + end minetest.sound_play("technic_lawn_trimmer", { -- to_player = user:get_player_name(), diff --git a/technic/tools/planter.lua b/technic/tools/planter.lua index c5a22ba..1aefa7c 100644 --- a/technic/tools/planter.lua +++ b/technic/tools/planter.lua @@ -143,8 +143,10 @@ local function work_on_soil(itemstack, user, pointed_thing) ref = nil } end + - if (minetest.registered_items[meta.selected] or {on_place=minetest.item_place}).on_place(ItemStack({name=meta.selected, count=1}), user, work_pos) then + local k = (minetest.registered_items[meta.selected] or {on_place=minetest.item_place}).on_place(ItemStack({name=meta.selected, count=1}), user, work_pos) + if k then c = c + 1 end |