commit cfdf0be6fabdcacf26dfda1b75c119f1d166f633 Author: philipmi Date: Wed Feb 8 17:51:21 2023 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..caa32e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea/ +*.iml \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..cf99f68 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +Brick Walls +=== + +This simple mod adds brick walls for the walls mod. There are walls for many types of bricks from different mods. + +Walls are added for the following brick types: +- From default (mtg): + - Brick + - Stone Brick + - Desert Stone Brick + - Sandstone Brick + - Desert Sandstone Brick + - Silver Sandstone Brick + - Obsidian Brick +- From nether: + - Nether Brick + - Compressed Nether Brick + - Cracked Nether Brick + - Deep Nether Brick +- From ethereal: + - Ice Brick + - Snow Brick + +The number of blocks that walls connect to will also be expanded. +For the walls to be added, it's required to enable the mods containing the corresponding materials (bricks). + +License +---- + +Code for this mod is released under MIT (https://opensource.org/licenses/MIT). diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..3afc1a8 --- /dev/null +++ b/init.lua @@ -0,0 +1,62 @@ +-- support for translation (there's currently no translation...) +local S = minetest.get_translator("brickwalls") + +-- table with {wall_name, wall_desc, wall_mat} for all brick walls added; +-- wall_texture_table and wall_sounds will be determined via wall_mat +brickwalls = { + -- default + {"brickwalls:brick", "Brick Wall", "default:brick"}, + {"brickwalls:stonebrick", "Stone Brick Wall", "default:stonebrick"}, + {"brickwalls:desert_stonebrick", "Desert Stone Brick Wall", "default:desert_stonebrick"}, + {"brickwalls:sandstonebrick", "Sandstone Brick Wall", "default:sandstonebrick"}, + {"brickwalls:desert_sandstone_brick", "Desert Sandstone Brick Wall", "default:desert_sandstone_brick"}, + {"brickwalls:silver_sandstone_brick", "Silver Sandstone Brick Wall", "default:silver_sandstone_brick"}, + {"brickwalls:obsidianbrick", "Obsidian Brick Wall", "default:obsidianbrick"}, + -- nether + {"brickwalls:netherbrick", "Nether Brick Wall", "nether:brick"}, + {"brickwalls:netherbrick_compressed", "Compressed Nether Brick Wall", "nether:brick_compressed"}, + {"brickwalls:netherbrick_cracked", "Cracked Nether Brick Wall", "nether:brick_cracked"}, + {"brickwalls:netherbrick_deep", "Deep Nether Brick Wall", "nether:brick_deep"}, + -- ethereal + {"brickwalls:icebrick", "Ice Brick Wall", "ethereal:icebrick"}, + {"brickwalls:snowbrick", "Snow Brick Wall", "ethereal:snowbrick"}, +} + +for _, i in pairs(brickwalls) do + if minetest.registered_nodes[i[3]] then + + -- register walls + walls.register(i[1], S(i[2]), minetest.registered_nodes[i[3]].tiles, + i[3], minetest.registered_nodes[i[3]].sounds) + + -- change groups + local groups = minetest.registered_nodes[i[3]].groups + groups.wall = 1 + minetest.override_item(i[1], {groups = groups}) + end +end + +-- add more nodes that walls should connect to +for n, def in pairs(minetest.registered_nodes) do + if def.groups.wall == 1 then + minetest.override_item(n, { + connects_to = { + -- standard groups walls connect to + "group:wall", "group:stone", "group:fence", + -- default + "default:sandstone", "default:sandstonebrick", "default:sandstone_block", + "default:desert_sandstone", "default:desert_sandstone_brick", "default:desert_sandstone_block", + "default:silver_sandstone", "default:silver_sandstone_brick", "default:silver_sandstone_block", + "default:obsidian", "default:obsidianbrick", "default:obsidian_block", + "default:ice", + "default:brick", + -- nether + "nether:rack", "nether:rack_deep", + "nether:brick", "nether:brick_compressed", "nether:brick_cracked", "nether:brick_deep", + --"nether:fence_nether_brick", + -- ethereal + "ethereal:icebrick", "ethereal:snowbrick" + } + }) + end +end \ No newline at end of file diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..d6a2673 --- /dev/null +++ b/license.txt @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2023 philipmi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..879fec5 --- /dev/null +++ b/mod.conf @@ -0,0 +1,6 @@ +name = brickwalls +author = philipmi +depends = walls +optional_depends = default, nether, ethereal +description = Adds brick walls from different types of bricks. +title = Brick Walls diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..10c04e6 Binary files /dev/null and b/screenshot.png differ