Initial Commit

This commit is contained in:
JBBgameich 2016-09-13 19:21:12 +02:00
parent c7ec06abca
commit b746152f1f
9 changed files with 193 additions and 1 deletions

View File

@ -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 <sam@hocevar.net>
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")

121
api.lua Normal file
View File

@ -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

1
depends.txt Normal file
View File

@ -0,0 +1 @@
default

2
init.lua Normal file
View File

@ -0,0 +1,2 @@
dofile(minetest.get_modpath("fachwerk").."/api.lua")
dofile(minetest.get_modpath("fachwerk").."/nodes.lua")

33
nodes.lua Normal file
View File

@ -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(),
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

BIN
textures/fachwerk_blank.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

BIN
textures/fachwerk_cross.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B