summaryrefslogtreecommitdiff
path: root/cottages
diff options
context:
space:
mode:
Diffstat (limited to 'cottages')
-rw-r--r--cottages/README.md3
-rw-r--r--cottages/init.lua1
-rw-r--r--cottages/nodes_furniture.lua52
-rw-r--r--cottages/nodes_mining.lua67
-rw-r--r--cottages/textures/cottages_rope.pngbin0 -> 106 bytes
-rw-r--r--cottages/textures/cottages_slate.pngbin8609 -> 6843 bytes
6 files changed, 119 insertions, 4 deletions
diff --git a/cottages/README.md b/cottages/README.md
index c3ecb2d..0b0a033 100644
--- a/cottages/README.md
+++ b/cottages/README.md
@@ -75,6 +75,9 @@ PilzAdam (WTFPL; default and beds mod):
cottages_beds_bed_top_bottom.png
cottages_beds_bed_top_top.png
+Bas080 (CC; see https://forum.minetest.net/viewtopic.php?t=2344)
+ cottages_rope.png
+
Derived from Universal schema.jpg by Stefanie Lindener, which can be found here: http://de.wikipedia.org/w/index.php?title=Datei:Universal_schema.jpg&filetimestamp=20060510110309& The texture is CC-by-sa 2.0/de.
cottages_slate.png
diff --git a/cottages/init.lua b/cottages/init.lua
index cbafc0a..8149611 100644
--- a/cottages/init.lua
+++ b/cottages/init.lua
@@ -63,6 +63,7 @@ dofile(minetest.get_modpath("cottages").."/nodes_doorlike.lua");
dofile(minetest.get_modpath("cottages").."/nodes_fences.lua");
dofile(minetest.get_modpath("cottages").."/nodes_roof.lua");
dofile(minetest.get_modpath("cottages").."/nodes_barrel.lua");
+dofile(minetest.get_modpath("cottages").."/nodes_mining.lua");
--dofile(minetest.get_modpath("cottages").."/nodes_chests.lua");
-- this is only required and useful if you run versions of the random_buildings mod where the nodes where defined inside that mod
diff --git a/cottages/nodes_furniture.lua b/cottages/nodes_furniture.lua
index 7098ab4..5534975 100644
--- a/cottages/nodes_furniture.lua
+++ b/cottages/nodes_furniture.lua
@@ -106,13 +106,13 @@ minetest.register_node("cottages:sleeping_mat", {
node_box = {
type = "fixed",
fixed = {
- {-0.48, -0.5,-0.48, 0.48, -0.45, 0.48},
+ {-0.48, -0.5,-0.48, 0.48, -0.5+1/16, 0.48},
}
},
selection_box = {
type = "fixed",
fixed = {
- {-0.48, -0.5,-0.48, 0.48, -0.25, 0.48},
+ {-0.48, -0.5,-0.48, 0.48, -0.5+2/16, 0.48},
}
},
is_ground_content = false,
@@ -122,6 +122,37 @@ minetest.register_node("cottages:sleeping_mat", {
})
+-- this one has a pillow for the head; thus, param2 becomes visible to the builder, and mobs may use it as a bed
+minetest.register_node("cottages:sleeping_mat_head", {
+ description = S("sleeping mat with pillow"),
+ drawtype = 'nodebox',
+ tiles = { 'cottages_sleepingmat.png' }, -- done by VanessaE
+ wield_image = 'cottages_sleepingmat.png',
+ inventory_image = 'cottages_sleepingmat.png',
+ sunlight_propagates = true,
+ paramtype = 'light',
+ paramtype2 = "facedir",
+ groups = { snappy = 3 },
+ sounds = default.node_sound_leaves_defaults(),
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.48, -0.5,-0.48, 0.48, -0.5+1/16, 0.48},
+ {-0.34, -0.5+1/16,-0.12, 0.34, -0.5+2/16, 0.34},
+ }
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.48, -0.5,-0.48, 0.48, -0.5+2/16, 0.48},
+ }
+ },
+ is_ground_content = false,
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
+ return cottages.sleep_in_bed( pos, node, clicker, itemstack, pointed_thing );
+ end
+})
+
-- furniture; possible replacement: 3dforniture:chair
minetest.register_node("cottages:bench", {
@@ -395,6 +426,12 @@ cottages.sleep_in_bed = function( pos, node, clicker, itemstack, pointed_thing )
local animation = default.player_get_animation( clicker );
local pname = clicker:get_player_name();
+ local p_above = minetest.get_node( {x=pos.x, y=pos.y+1, z=pos.z});
+ if( not( p_above) or not( p_above.name ) or p_above.name ~= 'air' ) then
+ minetest.chat_send_player( pname, "This place is too narrow for sleeping. At least for you!");
+ return;
+ end
+
local place_name = 'place';
-- if only one node is present, the player can only sit;
-- sleeping requires a bed head+foot or two sleeping mats
@@ -462,7 +499,7 @@ cottages.sleep_in_bed = function( pos, node, clicker, itemstack, pointed_thing )
end
place_name = 'bed';
- elseif( node.name=='cottages:sleeping_mat' or node.name=='cottages:straw_mat') then
+ elseif( node.name=='cottages:sleeping_mat' or node.name=='cottages:straw_mat' or node.name=='cottages:sleeping_mat_head') then
place_name = 'mat';
dir = node.param2;
allow_sleep = false;
@@ -470,7 +507,7 @@ cottages.sleep_in_bed = function( pos, node, clicker, itemstack, pointed_thing )
local offset = {{x=0,z=-1}, {x=-1,z=0}, {x=0,z=1}, {x=1,z=0}};
for i,off in ipairs( offset ) do
node2 = minetest.get_node( {x=pos.x+off.x, y=pos.y, z=pos.z+off.z} );
- if( node2.name == 'cottages:sleeping_mat' or node2.name=='cottages:straw_mat' ) then
+ if( node2.name == 'cottages:sleeping_mat' or node2.name=='cottages:straw_mat' or node.name=='cottages:sleeping_mat_head' ) then
-- if a second mat is found, sleeping is possible
allow_sleep = true;
dir = i-1;
@@ -558,6 +595,13 @@ minetest.register_craft({
minetest.register_craft({
+ output = "cottages:sleeping_mat_head",
+ recipe = {
+ {"cottages:sleeping_mat","cottages:straw_mat" }
+ }
+})
+
+minetest.register_craft({
output = "cottages:table",
recipe = {
{"", cottages.craftitem_slab_wood, "", },
diff --git a/cottages/nodes_mining.lua b/cottages/nodes_mining.lua
new file mode 100644
index 0000000..3af4f71
--- /dev/null
+++ b/cottages/nodes_mining.lua
@@ -0,0 +1,67 @@
+
+
+---------------------------------------------------------------------------------------
+-- a rope that is of use to the mines
+---------------------------------------------------------------------------------------
+-- the rope can only be digged if there is no further rope above it;
+-- Note: This rope also counts as a rail node; thus, carts can move through it
+minetest.register_node("cottages:rope", {
+ description = "rope for climbing",
+ tiles = {"cottages_rope.png"},
+ groups = {snappy=3,choppy=3,oddly_breakable_by_hand=3,rail=1,connect_to_raillike=1},--connect_to_raillike=minetest.raillike_group("rail")},
+ walkable = false,
+ climbable = true,
+ paramtype = "light",
+ sunlight_propagates = true,
+ drawtype = "plantlike",
+ is_ground_content = false,
+ can_dig = function(pos, player)
+ local below = minetest.get_node( {x=pos.x, y=pos.y-1, z=pos.z});
+ if( below and below.name and below.name == "cottages:rope" ) then
+ if( player ) then
+ minetest.chat_send_player( player:get_player_name(),
+ 'The entire rope would be too heavy. Start digging at its lowest end!');
+ end
+ return false;
+ end
+ return true;
+ end
+})
+
+minetest.register_craft({
+ output = "cottages:rope",
+ recipe = {
+ {"default:cotton","default:cotton","default:cotton"}
+ }
+})
+
+
+-- Note: This rope also counts as a rail node; thus, carts can move through it
+minetest.register_node("cottages:ladder_with_rope_and_rail", {
+ description = "Ladder with rail support",
+ drawtype = "signlike",
+ tiles = {"default_ladder_wood.png^carts_rail_straight.png^cottages_rope.png"},
+ inventory_image = "default_ladder_wood.png",
+ wield_image = "default_ladder_wood.png",
+ paramtype = "light",
+ paramtype2 = "wallmounted",
+ sunlight_propagates = true,
+ walkable = false,
+ climbable = true,
+ is_ground_content = false,
+ selection_box = {
+ type = "wallmounted",
+ },
+ groups = {choppy=2,oddly_breakable_by_hand=3,rail=1,connect_to_raillike=1}, --connect_to_raillike=minetest.raillike_group("rail")},
+ legacy_wallmounted = true,
+ sounds = default.node_sound_wood_defaults(),
+})
+
+
+
+minetest.register_craft({
+ output = "cottages:ladder_with_rope_and_rail 3",
+ recipe = {
+ {"default:ladder","cottages:rope", "default:rail"}
+ }
+})
diff --git a/cottages/textures/cottages_rope.png b/cottages/textures/cottages_rope.png
new file mode 100644
index 0000000..0045c4c
--- /dev/null
+++ b/cottages/textures/cottages_rope.png
Binary files differ
diff --git a/cottages/textures/cottages_slate.png b/cottages/textures/cottages_slate.png
index f85f162..a52f185 100644
--- a/cottages/textures/cottages_slate.png
+++ b/cottages/textures/cottages_slate.png
Binary files differ