From b746152f1fd2ed03921ba6f9c979f620110c84cc Mon Sep 17 00:00:00 2001 From: JBBgameich Date: Tue, 13 Sep 2016 19:21:12 +0200 Subject: [PATCH] Initial Commit --- README.md | 37 ++++++++++- api.lua | 121 +++++++++++++++++++++++++++++++++++ depends.txt | 1 + init.lua | 2 + nodes.lua | 33 ++++++++++ textures/fachwerk_beam_1.png | Bin 0 -> 799 bytes textures/fachwerk_beam_2.png | Bin 0 -> 697 bytes textures/fachwerk_blank.png | Bin 0 -> 586 bytes textures/fachwerk_cross.png | Bin 0 -> 924 bytes 9 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 api.lua create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 nodes.lua create mode 100644 textures/fachwerk_beam_1.png create mode 100644 textures/fachwerk_beam_2.png create mode 100644 textures/fachwerk_blank.png create mode 100644 textures/fachwerk_cross.png diff --git a/README.md b/README.md index 5bdd999..b291e51 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,39 @@ # fachwerk -Fachwerk mod for Minetest +version 0.9.1 + +The fachwerk mod adds timber-framed blocks to Minetest. +It's using a simple API to add new timber-framed blocks + +# contributors +License of source code +---------------------- + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + + +License of media (textures) +-------------------------------------- + +License of textures +Copyright (C) 2015 JBB CC BY-SA 3.0 + +# TODO +- Make a TNG / AF8 special version +- add new blocks if requested by users +- clean up code + +# Screenshots ![Screenshot 1](http://i.imgur.com/JMegjRt.jpg) ![Screenshot 2](https://forum.minetest.net/download/file.php?mode=view&id=2575 "screenshot by sokomine") diff --git a/api.lua b/api.lua new file mode 100644 index 0000000..5898afa --- /dev/null +++ b/api.lua @@ -0,0 +1,121 @@ +--[[ +================================================================ +** fachwerk ** +By JBB + +Copyright (c) 2015 JBB +(sites.google.com/site/jbbsblog) +The WTFPL applies to all code in this project. +http://www.wtfpl.net/txt/copying/ +See README.txt +================================================================ +--]] + + +fachwerk = {} + +fachwerk.register_fachwerk = function( basename, texture, description, craft_from ) + + local group_def = {choppy=2,oddly_breakable_by_hand=2,cracky=3}; + + minetest.register_node("fachwerk:"..basename, { + description = "Truss with "..description, + tile_images = { texture.."^fachwerk_blank.png"}, + groups = group_def, + sounds = default.node_sound_stone_defaults(), + paramtype = "light", + paramtype2 = "facedir", + }) + + minetest.register_node("fachwerk:"..basename.."_1", { + description = "truss with "..description.." oblique beam 1", + tile_images = { + texture.."^fachwerk_blank.png", -- top + texture.."^fachwerk_blank.png", -- bottom + texture.."^fachwerk_beam_1.png", + texture.."^fachwerk_beam_1.png^[transformFX", + texture.."^fachwerk_beam_1.png^[transformFX", + texture.."^fachwerk_beam_1.png" }, + groups = group_def, + sounds = default.node_sound_stone_defaults(), + paramtype = "light", + paramtype2 = "facedir", + }) + + -- TODO: is this one really needed? the node above covers most of that already + minetest.register_node("fachwerk:"..basename.."_2", { + description = "Truss with "..description.." oblique beam 2", + tile_images = { + texture.."^fachwerk_blank.png", -- top + texture.."^fachwerk_blank.png", -- bottom + texture.."^fachwerk_beam_2.png", + texture.."^fachwerk_beam_2.png^[transformFX", + texture.."^fachwerk_beam_2.png^[transformFX", + texture.."^fachwerk_beam_2.png" }, + groups = group_def, + sounds = default.node_sound_stone_defaults(), + paramtype = "light", + paramtype2 = "facedir", + }) + + minetest.register_node("fachwerk:"..basename.."_cross", { + description = "truss with "..description.." cross", + tile_images = {texture.."^fachwerk_cross.png"}, + groups = group_def, + sounds = default.node_sound_stone_defaults(), + }) + + --crafting-- + + -- yields 2; after all we did add a lot of wood + minetest.register_craft({ + output = "fachwerk:"..basename.." 8", + recipe = { { "group:wood","group:wood","group:wood" }, + { "group:wood", craft_from,"group:wood" }, + { "group:wood","group:wood","group:wood" }, + } }); + + minetest.register_craft({ + output = "fachwerk:"..basename.."_cross 8", + recipe = { { "group:wood",craft_from,"group:wood" }, + { craft_from, "group:wood",craft_from }, + { "group:wood",craft_from,"group:wood" }, + } }); + + minetest.register_craft({ + output = "fachwerk:"..basename.."_1 8", + recipe = { { craft_from,"group:wood", craft_from}, + { craft_from, craft_from, craft_from}, + { "group:wood", craft_from, craft_from}, + } }); + + minetest.register_craft({ + output = "fachwerk:"..basename.."_2 8", + recipe = { { craft_from, craft_from,"group:wood"}, + { craft_from, craft_from, craft_from }, + { craft_from,"group:wood" ,craft_from }, + } }); + + -- chain of craft receipes to convert nodes into each other + --[[minetest.register_craft({ + output = "fachwerk:"..basename.."_1", + recipe = { {"fachwerk:"..basename }} }); + + minetest.register_craft({ + output = "fachwerk:"..basename.."_2", + recipe = { {"fachwerk:"..basename.."_1" }} }); + + minetest.register_craft({ + output = "fachwerk:"..basename.."_cross", + recipe = { {"fachwerk:"..basename.."_2" }} }); + + minetest.register_craft({ + output = "fachwerk:"..basename, + recipe = { {"fachwerk:"..basename.."_cross" }} });--]] + +end + + +if minetest.setting_getbool("log_mods") then + minetest.log("action", "[fachwerk] loaded.") +end diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +default diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..8c9b2a1 --- /dev/null +++ b/init.lua @@ -0,0 +1,2 @@ +dofile(minetest.get_modpath("fachwerk").."/api.lua") +dofile(minetest.get_modpath("fachwerk").."/nodes.lua") \ No newline at end of file diff --git a/nodes.lua b/nodes.lua new file mode 100644 index 0000000..d610185 --- /dev/null +++ b/nodes.lua @@ -0,0 +1,33 @@ +-- Blokck id textur description crafting recepie +-- fachwerk_ truss with .. + +fachwerk.register_fachwerk( 'clay', 'default_clay.png', 'clay', 'default:clay' ); +fachwerk.register_fachwerk( 'brick', 'default_brick.png', 'bricks', 'default:brick' ); +fachwerk.register_fachwerk( 'stone_brick', 'default_stone_brick.png', 'stone bricks', 'default:stonebrick' ); + +fachwerk.register_fachwerk( 'cobble', 'default_cobble.png', 'cobble', 'default:cobble' ); +fachwerk.register_fachwerk( 'stone', 'default_stone.png', 'stone', 'default:stone' ); + +--optional fachwerk types you can enable if you like +--[[ + +fachwerk.register_fachwerk( 'desert_stone','default_desert_stone.png','desert stone', 'default:desert_stone' ); +fachwerk.register_fachwerk( 'white', 'wool_white.png', 'white', 'wool:white' ); +fachwerk.register_fachwerk( 'grey', 'wool_grey.png', 'grey', 'wool:grey' ); +fachwerk.register_fachwerk( 'yellow', 'wool_yellow.png', 'yellow', 'wool:yellow' ); +fachwerk.register_fachwerk( 'wood', 'default_wood.png', 'wood', 'default:wood' ); +fachwerk.register_fachwerk( 'junglewood', 'default_junglewood.png', 'junglewood', 'default:junglewood' );]]-- -- you can enable this to get more fachwerk blocks. + +--nodes wich are not supported by the api + +minetest.register_node("fachwerk:framed_glass", { + description = "Fachwerk framed Glass", + drawtype = "glasslike_framed_optional", + tiles = {"fachwerk_blank.png", "fachwerk_blank.png^default_glass_detail.png"}, + inventory_image = minetest.inventorycube("fachwerk_blank.png"), + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults(), +}) \ No newline at end of file diff --git a/textures/fachwerk_beam_1.png b/textures/fachwerk_beam_1.png new file mode 100644 index 0000000000000000000000000000000000000000..879b7d81243d358ccc630a65b1f42ff74306e14f GIT binary patch literal 799 zcmV+)1K|9LP)+;eXGbz38^KCHW#dSR`grgv>BwPqj>Ja# zF0snFytP6&PZ@=Zh6|psP+876RJ^^>VG%Eo{qiS5R0c9)220%@6os&ZK*`Tf(lxc}m0wzE=qKUYPCQkv43ABMAN zI-5q8@B0|bCQQ_I#{@UB9AufN_)d#ncj@OJ?>+oxyWPC|$$L92wC2(C@x4EfqMOf0 zM~ouPzjphbuPf8JvAWbi2vadhGJ?Q27JPJVXZ^EYX9-`_IK`Fi_3wLYtAJsDaC9fj%U?Hx8n3g!c1iOJVF_r}JoXQUpYC1S_|P^bPhU+K zPU9~C4x{w7T-p{vqeiL}Vy#(Yktqb`T5q|Aq2$3|quXg-4Box4#+$4(>lAs0?+TiCTV90v^8!ba%Ia1td1jV5_svVSo8ZZuC%I7h4s zDj^7b2l4yCkln2|i!|ZM;CQCf>=ysSE^~ZgNK1k6rJ%9}j&1Yw<@npEBIvd03=nUEPEFS(nq2F%pUA?%zS5_8|@1b--mTS7LIyKMZ z_-u}(Lg}1Qs1degG(AQ9@@z!6;i4;xw3G-Th{F(-7j#+;;;dq_h)Gn&nJN&qI%#E* dW)+St_y?Q+Rpvdw;2r<~002ovPDHLkV1ll_b6Wra literal 0 HcmV?d00001 diff --git a/textures/fachwerk_beam_2.png b/textures/fachwerk_beam_2.png new file mode 100644 index 0000000000000000000000000000000000000000..513893553a27b12a78eb3882bc4cb3109254ef78 GIT binary patch literal 697 zcmV;q0!ICbP)zSVE?&|8Q;sn_99^lcZPkjF2S-LnZdH&BU4(ln3jH)hh zek4SX&J-%kX!{;31^wXJy2Qz%Y=F+ffdp~8=?s+;MrT}a z9X^a$t=M)WE+%fD)hLlhVl=Ea{pzo)?PKSM!Q%bKCx5oc$5G}kgdsHR-DqZsEnrf z$Sx^}iI`;E7pUsl1B4<(kU~N=vADtQ1$=wwqaRKWO6k347zX4~IbqXx=xo0Q$Mfo^ z*PAWIWGF3=E${iV3z=!1N$T8?$qdE@ z;d_j+IG^4Md~x~ycc-(dU3cTvoAu`RTuJ&Mk)0cPz1`x+x1U%T{qSY8<9dDlW7qq( z8v@O4gG9i(=~0>bU*NNgqxsNebl}kl4TuHf)fZN9&{TB#7>L0oIi$p!AYtW^9i= zHm@-M{(RCAU*5ke@75>$`n_YlY|tnc%Q+z?#vG}XMk__{Jyr_*5c#wByuDb_b}f4I z?3|ZR42RzHadUwdg}Xjrbc3!Gx)e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