From 5a8922a0155b003ac0bb8d911e99808ffde1a7da Mon Sep 17 00:00:00 2001
From: h-v-smacker <hans-von-smacker+github@gmail.com>
Date: Sun, 23 Sep 2018 04:38:15 +0300
Subject: first actual content

---
 README.md                                          |  23 ++++++
 depends.txt                                        |   6 ++
 doors.lua                                          |  33 +++++++++
 init.lua                                           |   9 +++
 missing_groups.lua                                 |  32 +++++++++
 sandstone_cobble.lua                               |  73 +++++++++++++++++++
 sounds/mtg_plus_door_iron_bar_close.ogg            | Bin 0 -> 25716 bytes
 sounds/mtg_plus_door_iron_bar_open.ogg             | Bin 0 -> 22898 bytes
 sounds/mtg_plus_paper_dig.1.ogg                    | Bin 0 -> 29248 bytes
 sounds/mtg_plus_paper_dig.2.ogg                    | Bin 0 -> 31318 bytes
 sounds/mtg_plus_paper_dig.3.ogg                    | Bin 0 -> 20979 bytes
 sounds/mtg_plus_paper_dug.1.ogg                    | Bin 0 -> 25732 bytes
 sounds/mtg_plus_paper_step.1.ogg                   | Bin 0 -> 17175 bytes
 textures/errata_xpanes_black.png                   | Bin 172 -> 0 bytes
 textures/errata_xpanes_pane_half_obsidian.png      | Bin 169 -> 0 bytes
 .../minetest_errata_desert_sandstone_cobble.png    | Bin 0 -> 588 bytes
 textures/minetest_errata_door_iron_bar.png         | Bin 0 -> 643 bytes
 textures/minetest_errata_door_iron_bar_item.png    | Bin 0 -> 186 bytes
 textures/minetest_errata_door_wood_bar.png         | Bin 0 -> 982 bytes
 textures/minetest_errata_door_wood_bar_item.png    | Bin 0 -> 188 bytes
 textures/minetest_errata_paperwall.png             | Bin 0 -> 486 bytes
 textures/minetest_errata_sandstone_cobble.png      | Bin 0 -> 746 bytes
 .../minetest_errata_silver_sandstone_cobble.png    | Bin 0 -> 526 bytes
 textures/minetest_errata_wooden_bar.png            | Bin 0 -> 292 bytes
 textures/minetest_errata_wooden_bar_side.png       | Bin 0 -> 565 bytes
 textures/minetest_errata_wooden_bar_y.png          | Bin 0 -> 142 bytes
 textures/minetest_errata_xpanes_black.png          | Bin 0 -> 172 bytes
 .../minetest_errata_xpanes_pane_half_obsidian.png  | Bin 0 -> 169 bytes
 xpanes.lua                                         |  77 ++++++++++++++++++++-
 29 files changed, 251 insertions(+), 2 deletions(-)
 create mode 100644 doors.lua
 create mode 100644 missing_groups.lua
 create mode 100644 sandstone_cobble.lua
 create mode 100644 sounds/mtg_plus_door_iron_bar_close.ogg
 create mode 100644 sounds/mtg_plus_door_iron_bar_open.ogg
 create mode 100644 sounds/mtg_plus_paper_dig.1.ogg
 create mode 100644 sounds/mtg_plus_paper_dig.2.ogg
 create mode 100644 sounds/mtg_plus_paper_dig.3.ogg
 create mode 100644 sounds/mtg_plus_paper_dug.1.ogg
 create mode 100644 sounds/mtg_plus_paper_step.1.ogg
 delete mode 100644 textures/errata_xpanes_black.png
 delete mode 100644 textures/errata_xpanes_pane_half_obsidian.png
 create mode 100644 textures/minetest_errata_desert_sandstone_cobble.png
 create mode 100644 textures/minetest_errata_door_iron_bar.png
 create mode 100644 textures/minetest_errata_door_iron_bar_item.png
 create mode 100644 textures/minetest_errata_door_wood_bar.png
 create mode 100644 textures/minetest_errata_door_wood_bar_item.png
 create mode 100644 textures/minetest_errata_paperwall.png
 create mode 100644 textures/minetest_errata_sandstone_cobble.png
 create mode 100644 textures/minetest_errata_silver_sandstone_cobble.png
 create mode 100644 textures/minetest_errata_wooden_bar.png
 create mode 100644 textures/minetest_errata_wooden_bar_side.png
 create mode 100644 textures/minetest_errata_wooden_bar_y.png
 create mode 100644 textures/minetest_errata_xpanes_black.png
 create mode 100644 textures/minetest_errata_xpanes_pane_half_obsidian.png

diff --git a/README.md b/README.md
index 8b13789..dae60e7 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,24 @@
+# Minetest Errata
+## a mod that fixes small errors and omissions in other mods
 
+By its nature, the mod is rather intrusive. It will actively try to alter and override existing node definitions and such.
+
+### Issues the mod addresses:
+* connectivity of xpanes - adds new groups for materials (e.g. sandstone) and allows panes to connect to them
+** the new groups are prefixed with "me_" to avoid potential conflicts
+* erasing books back into clean books
+
+### Introduces items
+* obsidian glass panes
+* paper walls, wooden bars
+* wooden and steel bar doors
+* sandstone cobble varieties, with stairs/slabs/microblocks, walls, pkarcs
+
+## Borrowed items
+
+This mod can borrow some items from other mods (in cases where the whole mod seems to much, but some of its contents are definitely something that should have been in the game from the get go). So far the list of such mods is this:
+
+* Mintest Game Plus by Wuzzy http://repo.or.cz/minetest_mtg_plus.git
+** paper walls and wooden bars
+** steel bar and wooden bar doors
+** sandstone cobble varieties
diff --git a/depends.txt b/depends.txt
index ddc201b..5d0a6df 100644
--- a/depends.txt
+++ b/depends.txt
@@ -1,2 +1,8 @@
 default
 xpanes
+doors
+walls
+stairs
+moreblocks?
+glass_stained?
+pkarcs?
diff --git a/doors.lua b/doors.lua
new file mode 100644
index 0000000..6d840c7
--- /dev/null
+++ b/doors.lua
@@ -0,0 +1,33 @@
+
+
+doors.register("door_wood_bar", {
+	tiles = {{ name = "minetest_errata_door_wood_bar.png", backface_culling = true }},
+	description = "Wooden Bar Door",
+	_doc_items_longdec = door_simple,
+	_doc_items_usagehelp = door_simple_use,
+	inventory_image = "minetest_errata_door_wood_bar_item.png",
+	sounds = default.node_sound_wood_defaults(),
+	sound_open = "doors_fencegate_open",
+	sound_close = "doors_fencegate_close",
+	groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
+	recipe = {
+		{"xpanes:wood_flat",},
+		{"xpanes:wood_flat",},
+	}
+})
+
+doors.register("door_iron_bar", {
+	tiles = {{ name = "minetest_errata_door_iron_bar.png", backface_culling = true }},
+	description = "Iron Bar Door",
+	_doc_items_longdec = door_simple,
+	_doc_items_usagehelp = door_simple_use,
+	inventory_image = "minetest_errata_door_iron_bar_item.png",
+	sound_open = "minetest_errata_door_iron_bar_open",
+	sound_close = "minetest_errata_door_iron_bar_close",
+	sounds = metal_sounds,
+	groups = { snappy = 2, bendy = 1, cracky = 1, melty = 2, },
+	recipe = {
+		{"xpanes:bar_flat",},
+		{"xpanes:bar_flat",},
+	}
+})
\ No newline at end of file
diff --git a/init.lua b/init.lua
index 5254b75..d410788 100644
--- a/init.lua
+++ b/init.lua
@@ -1,5 +1,14 @@
 local modpath = minetest.get_modpath("minetest_errata")
 
+minetest_errata = {}
+minetest_errata.prefix = "me_"
+
 dofile(modpath.."/books.lua")
 
+dofile(modpath.."/doors.lua")
+
+dofile(modpath.."/sandstone_cobble.lua")
+
+dofile(modpath.."/missing_groups.lua")
+
 dofile(modpath.."/xpanes.lua")
\ No newline at end of file
diff --git a/missing_groups.lua b/missing_groups.lua
new file mode 100644
index 0000000..d6f985d
--- /dev/null
+++ b/missing_groups.lua
@@ -0,0 +1,32 @@
+local nodes_with_missing_groups = {
+	-- Sandstone varieties
+	{name = "default:sandstone", groups = {sandstone = 1}},
+	{name = "default:sandstonebrick", groups = {sandstone = 1}},
+	{name = "default:sandstone_block", groups = {sandstone = 1}},
+	{name = "default:desert_sandstone", groups = {sandstone = 1}},
+	{name = "default:desert_sandstone_brick", groups = {sandstone = 1}},
+	{name = "default:desert_sandstone_block", groups = {sandstone = 1}},
+	{name = "default:silver_sandstone", groups = {sandstone = 1}},
+	{name = "default:silver_sandstone_brick", groups = {sandstone = 1}},
+	{name = "default:silver_sandstone_block", groups = {sandstone = 1}},
+	-- Red bricks
+	{name = "default:brick", groups = {bricks = 1}},
+	-- Obsidian
+	{name = "default:obsidian", groups = {stone = 1}},
+	{name = "default:obsidianbrick", groups = {stone = 1}},
+	{name = "default:obsidian_block", groups = {stone = 1}},
+}
+
+for _,node in ipairs(nodes_with_missing_groups) do
+	
+	local entity = {}
+	for name,value in pairs(minetest.registered_nodes[node.name]) do
+		entity[name] = value
+	end
+	for g,v in pairs(node.groups) do
+		entity.groups[minetest_errata.prefix .. g] = v
+	end
+	minetest.register_node(":" .. node.name, entity)
+
+end
+
diff --git a/sandstone_cobble.lua b/sandstone_cobble.lua
new file mode 100644
index 0000000..0676046
--- /dev/null
+++ b/sandstone_cobble.lua
@@ -0,0 +1,73 @@
+local cobble_table = {
+	{name = "sandstone", desc = "Sandstone"},
+	{name = "desert_sandstone", desc = "Desert Sandstone"},
+	{name = "silver_sandstone", desc = "Silver Sandstone"},
+}
+
+for _,node in ipairs(cobble_table) do
+	
+	minetest.register_node("minetest_errata:" .. node.name .. "_cobble", {
+		description = node.desc,
+		tiles = {"minetest_errata_" .. node.name .. "_cobble.png"},
+		groups = {cracky = 3},
+		is_ground_content = false,
+		sounds = default.node_sound_stone_defaults(),
+	})
+
+	minetest.register_craft({
+		output = "minetest_errata:" .. node.name .. "_cobble 2",
+		recipe = { { "default:" .. node.name, "default:" .. node.name } },
+	})
+
+	minetest.register_craft({
+		type = "cooking",
+		output = "default:" .. node.name,
+		recipe = "minetest_errata:" .. node.name .. "_cobble",
+	})
+
+	-- Derivative blocks
+
+	if stairs and stairs.mod and stairs.mod == "redo" then
+		
+		stairs.register_all(node.name .. "_cobble", "minetest_errata:" .. node.name .. "_cobble",
+			{cracky = 3},
+			{"minetest_errata_" .. node.name .. "_cobble.png"},
+			node.desc .. " Stair",
+			node.desc .. " Slab",
+			default.node_sound_wood_defaults())
+		
+	elseif minetest.global_exists("stairsplus") then
+		
+		stairsplus:register_all("minetest_errata", node.name .. "_cobble", "minetest_errata:" .. node.name .. "_cobble", {
+			description = node.desc,
+			tiles = {"minetest_errata_" .. node.name .. "_cobble.png"},
+			groups = {cracky = 3},
+			sounds = default.node_sound_wood_defaults(),
+		})
+		
+	else
+		
+		stairs.register_stair_and_slab(node.name .. "_cobble", "minetest_errata:" .. node.name .. "_cobble",
+			{cracky = 3},
+			{"minetest_errata_" .. node.name .. "_cobble.png"},
+			node.desc .. " Stair",
+			node.desc .. " Slab",
+			default.node_sound_wood_defaults())
+		
+	end
+	
+	
+	-- Walls
+	walls.register("minetest_errata:wall_" .. node.name .. "_cobble", 
+			node.desc .. " Cobble Wall", 
+			"minetest_errata_" .. node.name .. "_cobble.png", 
+			"minetest_errata:" .. node.name .. "_cobble",
+			default.node_sound_stone_defaults()
+		)
+	
+	-- procedurally-generated arcs
+	if minetest.get_modpath("pkarcs") then
+		pkarcs.register_node("minetest_errata:" .. node.name .. "_cobble")
+	end
+	
+end
diff --git a/sounds/mtg_plus_door_iron_bar_close.ogg b/sounds/mtg_plus_door_iron_bar_close.ogg
new file mode 100644
index 0000000..cdc4ff2
Binary files /dev/null and b/sounds/mtg_plus_door_iron_bar_close.ogg differ
diff --git a/sounds/mtg_plus_door_iron_bar_open.ogg b/sounds/mtg_plus_door_iron_bar_open.ogg
new file mode 100644
index 0000000..16408a8
Binary files /dev/null and b/sounds/mtg_plus_door_iron_bar_open.ogg differ
diff --git a/sounds/mtg_plus_paper_dig.1.ogg b/sounds/mtg_plus_paper_dig.1.ogg
new file mode 100644
index 0000000..702d5aa
Binary files /dev/null and b/sounds/mtg_plus_paper_dig.1.ogg differ
diff --git a/sounds/mtg_plus_paper_dig.2.ogg b/sounds/mtg_plus_paper_dig.2.ogg
new file mode 100644
index 0000000..88d8eae
Binary files /dev/null and b/sounds/mtg_plus_paper_dig.2.ogg differ
diff --git a/sounds/mtg_plus_paper_dig.3.ogg b/sounds/mtg_plus_paper_dig.3.ogg
new file mode 100644
index 0000000..1460139
Binary files /dev/null and b/sounds/mtg_plus_paper_dig.3.ogg differ
diff --git a/sounds/mtg_plus_paper_dug.1.ogg b/sounds/mtg_plus_paper_dug.1.ogg
new file mode 100644
index 0000000..de90b44
Binary files /dev/null and b/sounds/mtg_plus_paper_dug.1.ogg differ
diff --git a/sounds/mtg_plus_paper_step.1.ogg b/sounds/mtg_plus_paper_step.1.ogg
new file mode 100644
index 0000000..32879bc
Binary files /dev/null and b/sounds/mtg_plus_paper_step.1.ogg differ
diff --git a/textures/errata_xpanes_black.png b/textures/errata_xpanes_black.png
deleted file mode 100644
index 98e835e..0000000
Binary files a/textures/errata_xpanes_black.png and /dev/null differ
diff --git a/textures/errata_xpanes_pane_half_obsidian.png b/textures/errata_xpanes_pane_half_obsidian.png
deleted file mode 100644
index 2b3ce56..0000000
Binary files a/textures/errata_xpanes_pane_half_obsidian.png and /dev/null differ
diff --git a/textures/minetest_errata_desert_sandstone_cobble.png b/textures/minetest_errata_desert_sandstone_cobble.png
new file mode 100644
index 0000000..6b1cc92
Binary files /dev/null and b/textures/minetest_errata_desert_sandstone_cobble.png differ
diff --git a/textures/minetest_errata_door_iron_bar.png b/textures/minetest_errata_door_iron_bar.png
new file mode 100644
index 0000000..13eb0a2
Binary files /dev/null and b/textures/minetest_errata_door_iron_bar.png differ
diff --git a/textures/minetest_errata_door_iron_bar_item.png b/textures/minetest_errata_door_iron_bar_item.png
new file mode 100644
index 0000000..93c2de6
Binary files /dev/null and b/textures/minetest_errata_door_iron_bar_item.png differ
diff --git a/textures/minetest_errata_door_wood_bar.png b/textures/minetest_errata_door_wood_bar.png
new file mode 100644
index 0000000..89ba72b
Binary files /dev/null and b/textures/minetest_errata_door_wood_bar.png differ
diff --git a/textures/minetest_errata_door_wood_bar_item.png b/textures/minetest_errata_door_wood_bar_item.png
new file mode 100644
index 0000000..4708d2e
Binary files /dev/null and b/textures/minetest_errata_door_wood_bar_item.png differ
diff --git a/textures/minetest_errata_paperwall.png b/textures/minetest_errata_paperwall.png
new file mode 100644
index 0000000..3c8352d
Binary files /dev/null and b/textures/minetest_errata_paperwall.png differ
diff --git a/textures/minetest_errata_sandstone_cobble.png b/textures/minetest_errata_sandstone_cobble.png
new file mode 100644
index 0000000..61fd148
Binary files /dev/null and b/textures/minetest_errata_sandstone_cobble.png differ
diff --git a/textures/minetest_errata_silver_sandstone_cobble.png b/textures/minetest_errata_silver_sandstone_cobble.png
new file mode 100644
index 0000000..fc71c83
Binary files /dev/null and b/textures/minetest_errata_silver_sandstone_cobble.png differ
diff --git a/textures/minetest_errata_wooden_bar.png b/textures/minetest_errata_wooden_bar.png
new file mode 100644
index 0000000..ecf53bf
Binary files /dev/null and b/textures/minetest_errata_wooden_bar.png differ
diff --git a/textures/minetest_errata_wooden_bar_side.png b/textures/minetest_errata_wooden_bar_side.png
new file mode 100644
index 0000000..9613634
Binary files /dev/null and b/textures/minetest_errata_wooden_bar_side.png differ
diff --git a/textures/minetest_errata_wooden_bar_y.png b/textures/minetest_errata_wooden_bar_y.png
new file mode 100644
index 0000000..6bc362d
Binary files /dev/null and b/textures/minetest_errata_wooden_bar_y.png differ
diff --git a/textures/minetest_errata_xpanes_black.png b/textures/minetest_errata_xpanes_black.png
new file mode 100644
index 0000000..98e835e
Binary files /dev/null and b/textures/minetest_errata_xpanes_black.png differ
diff --git a/textures/minetest_errata_xpanes_pane_half_obsidian.png b/textures/minetest_errata_xpanes_pane_half_obsidian.png
new file mode 100644
index 0000000..2b3ce56
Binary files /dev/null and b/textures/minetest_errata_xpanes_pane_half_obsidian.png differ
diff --git a/xpanes.lua b/xpanes.lua
index c271a5c..596ee47 100644
--- a/xpanes.lua
+++ b/xpanes.lua
@@ -1,6 +1,6 @@
-xpanes.register_pane("obsidian_pane", {
+xpanes.register_pane("obsidian", {
 	description = "Obsidian Pane",
-	textures = {"default_obsidian_glass.png","errata_xpanes_pane_half_obsidian.png","errata_xpanes_black.png"},
+	textures = {"default_obsidian_glass.png","minetest_errata_xpanes_pane_half_obsidian.png","minetest_errata_xpanes_black.png"},
 	inventory_image = "default_obsidian_glass.png",
 	wield_image = "default_obsidian_glass.png",
 	sounds = default.node_sound_glass_defaults(),
@@ -10,3 +10,76 @@ xpanes.register_pane("obsidian_pane", {
 		{"default:obsidian_glass", "default:obsidian_glass", "default:obsidian_glass"}
 	}
 })
+
+xpanes.register_pane("paper", {
+	description = "Paper Barrier",
+	inventory_image = "minetest_errata_paperwall.png",
+	wield_image = "minetest_errata_paperwall.png",
+	textures = {"minetest_errata_paperwall.png", "minetest_errata_paperwall.png", "minetest_errata_paperwall.png"},
+	groups = {snappy=3, flammable=4, pane=1},
+	sounds = {
+		footstep = {name="minetest_errata_paper_step", gain=0.1, max_hear_distance=7},
+		place = {name="minetest_errata_paper_step", gain=0.3, max_hear_distance=13},
+		dig = {name="minetest_errata_paper_dig", gain=0.1, max_hear_distance=11},
+		dug = {name="minetest_errata_paper_dug", gain=0.2, max_hear_distance=13},
+	},
+	recipe = {
+		{ "default:paper", "default:paper", "default:paper" },
+		{ "default:paper", "default:paper", "default:paper" },
+	}
+})
+
+
+xpanes.register_pane("wood", {
+	description = "Wooden Bars",
+	inventory_image = "minetest_errata_wooden_bar.png",
+	wield_image = "minetest_errata_wooden_bar.png",
+	textures = {"minetest_errata_wooden_bar.png", "minetest_errata_wooden_bar_side.png", "minetest_errata_wooden_bar_y.png"},
+	groups = {choppy=3, oddly_breakable_by_hand=2, flammable=2, pane=1},
+	sounds = default.node_sound_wood_defaults(),
+	recipe = {
+		{ "group:wood", "", "group:wood" },
+		{ "group:wood", "", "group:wood" },
+		{ "group:wood", "", "group:wood" },
+	}
+})
+
+
+local extra_groups = {
+	"group:bakedclay",
+	"group:" .. minetest_errata.prefix .. "sandstone",
+	"group:" .. minetest_errata.prefix .. "stone",
+	"group:" .. minetest_errata.prefix .. "bricks",
+}
+
+local xpane_nodes = { "xpanes:bar", "xpanes:pane", "xpanes:wood", "xpanes:paper" }
+
+for _,node in ipairs(xpane_nodes) do
+
+	local entity = {}
+	for name,value in pairs(minetest.registered_nodes[node]) do
+		entity[name] = value
+	end
+
+	for _,g in ipairs(extra_groups) do
+		table.insert(entity.connects_to, g)
+	end
+
+	minetest.register_node(":" .. node, entity)
+
+end
+
+if minetest.get_modpath("glass_stained") then
+	local entity = {}
+	for name,value in pairs(minetest.registered_nodes["xpanes:bar_top"]) do
+		entity[name] = value
+	end
+
+	for _,g in ipairs(extra_groups) do
+		table.insert(entity.connects_to, g)
+	end
+
+	minetest.register_node(":xpanes:bar_top", entity)
+end
+
+
-- 
cgit v1.2.3