summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorh-v-smacker <hans-von-smacker+github@gmail.com>2018-07-15 02:24:40 +0300
committerh-v-smacker <hans-von-smacker+github@gmail.com>2018-07-15 02:24:40 +0300
commitdb05f23b54d775d7f0de1618c80aeb9938896d91 (patch)
treebd302ceeeff777001437ea43e9324d41de08043c
parent0539c2123cdb75610d8d6c4d8ac35491b1dd480e (diff)
formspec fixes and cleanup
-rw-r--r--nodes_barrel.lua1
-rw-r--r--nodes_chests.lua60
-rw-r--r--nodes_mining.lua30
-rw-r--r--nodes_roof.lua12
-rw-r--r--nodes_straw.lua54
-rw-r--r--textures/cottages_water_indicator.pngbin0 -> 295 bytes
6 files changed, 80 insertions, 77 deletions
diff --git a/nodes_barrel.lua b/nodes_barrel.lua
index e591bcf..a824221 100644
--- a/nodes_barrel.lua
+++ b/nodes_barrel.lua
@@ -12,6 +12,7 @@
-- 24.03.13 Can no longer be opended/closed on rightclick because that is now used for a formspec;
-- instead, it can be filled with liquids.
-- Filled barrels will always be closed, while empty barrels will always be open.
+-- 15.07.2018 The barrels finally work, and hold 50 buckets of any liquid
-- pipes: table with the following entries for each pipe-part:
-- f: radius factor; if 1, it will have a radius of half a nodebox and fill the entire nodebox
diff --git a/nodes_chests.lua b/nodes_chests.lua
index bc7bbbc..eb1e946 100644
--- a/nodes_chests.lua
+++ b/nodes_chests.lua
@@ -8,54 +8,54 @@ local S = cottages.S
cottages_chests = {}
-- uses default.chest_formspec for now
cottages_chests.on_construct = function(pos)
- local meta = minetest.get_meta(pos)
- meta:set_string("formspec",default.chest_formspec)
+ local meta = minetest.get_meta(pos)
+ meta:set_string("formspec",default.chest_formspec)
-- meta:set_string("infotext", "Chest")
- local inv = meta:get_inventory()
- inv:set_size("main", 8*4)
- end
+ local inv = meta:get_inventory()
+ inv:set_size("main", 8*4)
+end
cottages_chests.can_dig = function(pos,player)
- local meta = minetest.get_meta(pos);
- local inv = meta:get_inventory()
- return inv:is_empty("main")
- end
+ local meta = minetest.get_meta(pos);
+ local inv = meta:get_inventory()
+ return inv:is_empty("main")
+end
-- the chests do not need receipes since they are only placeholders and not intended to be built by players
-- (they are later on supposed to be filled with diffrent items by fill_chest.lua)
minetest.register_node("cottages:chest_private", {
- description = S("Private NPC chest"),
- infotext = "chest containing the possesions of one of the inhabitants",
+ description = S("Private NPC chest"),
+ infotext = "chest containing the possesions of one of the inhabitants",
tiles = cottages.texture_chest,
- paramtype2 = "facedir",
- groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
- legacy_facedir_simple = true,
- on_construct = cottages_chests.on_construct,
- can_dig = cottages_chests.can_dig,
+ paramtype2 = "facedir",
+ groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+ legacy_facedir_simple = true,
+ on_construct = cottages_chests.on_construct,
+ can_dig = cottages_chests.can_dig,
is_ground_content = false,
})
minetest.register_node("cottages:chest_work", {
- description = S("Chest for work utils and kitchens"),
- infotext = "everything the inhabitant needs for his work",
+ description = S("Chest for work utils and kitchens"),
+ infotext = "everything the inhabitant needs for his work",
tiles = cottages.texture_chest,
- paramtype2 = "facedir",
- groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
- legacy_facedir_simple = true,
- on_construct = cottages_chests.on_construct,
- can_dig = cottages_chests.can_dig,
+ paramtype2 = "facedir",
+ groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+ legacy_facedir_simple = true,
+ on_construct = cottages_chests.on_construct,
+ can_dig = cottages_chests.can_dig,
is_ground_content = false,
})
minetest.register_node("cottages:chest_storage", {
- description = S("Storage chest"),
- infotext = "stored food reserves",
+ description = S("Storage chest"),
+ infotext = "stored food reserves",
tiles = cottages.texture_chest,
- paramtype2 = "facedir",
- groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
- legacy_facedir_simple = true,
- on_construct = cottages_chests.on_construct,
- can_dig = cottages_chests.can_dig,
+ paramtype2 = "facedir",
+ groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
+ legacy_facedir_simple = true,
+ on_construct = cottages_chests.on_construct,
+ can_dig = cottages_chests.can_dig,
is_ground_content = false,
})
diff --git a/nodes_mining.lua b/nodes_mining.lua
index 297af3e..a8a5763 100644
--- a/nodes_mining.lua
+++ b/nodes_mining.lua
@@ -7,26 +7,26 @@ local S = cottages.S
-- 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 = S("Rope for climbing"),
- tiles = {"cottages_rope.png"},
+ description = S("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",
+ 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;
+ 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 true;
+ return false;
end
+ return true;
+ end
})
minetest.register_craft({
diff --git a/nodes_roof.lua b/nodes_roof.lua
index 9503e86..27d5aea 100644
--- a/nodes_roof.lua
+++ b/nodes_roof.lua
@@ -187,11 +187,13 @@ cottages.register_roof( 'slate',
-- slate roofs are sometimes on vertical fronts of houses
---------------------------------------------------------------------------------------
minetest.register_node("cottages:slate_vertical", {
- description = S("Vertical Slate"),
- tiles = {"cottages_slate.png",cottages.texture_roof_sides,"cottages_slate.png","cottages_slate.png",cottages.texture_roof_sides,"cottages_slate.png"},
- paramtype2 = "facedir",
- groups = {cracky=2, stone=1},
- sounds = default.node_sound_stone_defaults,
+ description = S("Vertical Slate"),
+ tiles = {"cottages_slate.png", cottages.texture_roof_sides,
+ "cottages_slate.png", "cottages_slate.png",
+ cottages.texture_roof_sides, "cottages_slate.png"},
+ paramtype2 = "facedir",
+ groups = {cracky=2, stone=1},
+ sounds = default.node_sound_stone_defaults,
is_ground_content = false,
})
diff --git a/nodes_straw.lua b/nodes_straw.lua
index d119c98..c69d06c 100644
--- a/nodes_straw.lua
+++ b/nodes_straw.lua
@@ -88,19 +88,19 @@ minetest.register_node("cottages:straw", {
local cottages_formspec_treshing_floor =
- "size[8,8]"..
- "image[1.5,0;1,1;"..cottages.texture_stick.."]"..
- "image[0,1;1,1;farming_wheat.png]"..
- "list[current_name;harvest;1,1;2,1;]"..
- "list[current_name;straw;5,0;2,2;]"..
- "list[current_name;seeds;5,2;2,2;]"..
- "label[1,0.5;"..S("Harvested wheat:").."]"..
- "label[4,0.0;"..S("Straw:").."]"..
- "label[4,2.0;"..S("Seeds:").."]"..
- "label[0,-0.5;"..S("Threshing floor").."]"..
- "label[0,2.5;"..S("Punch threshing floor with a stick").."]"..
- "label[0,3.0;"..S("to get straw and seeds from wheat.").."]"..
- "list[current_player;main;0,4;8,4;]";
+ "size[8,8]"..
+ "image[3.5,2.5;1,1;"..cottages.texture_stick.."]"..
+ "image[0,1;1,1;farming_wheat.png]"..
+ "list[current_name;harvest;1,1;2,1;]"..
+ "list[current_name;straw;6,0;2,2;]"..
+ "list[current_name;seeds;6,2;2,2;]"..
+ "label[1,0.5;"..S("Harvested wheat:").."]"..
+ "label[5,0.0;"..S("Straw:").."]"..
+ "label[5,2.0;"..S("Seeds:").."]"..
+ "label[0,0;"..S("Threshing floor").."]"..
+ "label[0,2.5;"..S("Punch threshing floor with a stick").."]"..
+ "label[0,3.0;"..S("to get straw and seeds from wheat.").."]"..
+ "list[current_player;main;0,4;8,4;]";
minetest.register_node("cottages:threshing_floor", {
drawtype = "nodebox",
@@ -145,7 +145,7 @@ minetest.register_node("cottages:threshing_floor", {
meta:set_string("infotext", S("Threshing floor (owned by %s)"):format(meta:get_string("owner") or ""));
meta:set_string("formspec",
cottages_formspec_treshing_floor..
- "label[2.5,-0.5;"..S("Owner: %s"):format(meta:get_string("owner") or "").."]" );
+ "label[2.5,0t;"..S("Owner: %s"):format(meta:get_string("owner") or "").."]" );
end,
can_dig = function(pos,player)
@@ -228,7 +228,7 @@ minetest.register_node("cottages:threshing_floor", {
-- update the formspec
meta:set_string("formspec",
cottages_formspec_treshing_floor..
- "label[2.5,-0.5;"..S("Owner: %s"):format(meta:get_string("owner") or "").."]" );
+ "label[2.5,0;"..S("Owner: %s"):format(meta:get_string("owner") or "").."]" );
return;
end
@@ -347,15 +347,15 @@ minetest.register_node("cottages:threshing_floor", {
local cottages_handmill_formspec = "size[8,8]"..
- "image[0,1;1,1;"..cottages.texture_wheat_seed.."]"..
- "list[current_name;seeds;1,1;1,1;]"..
- "list[current_name;flour;5,1;2,2;]"..
- "label[0,0.5;"..S("Wheat seeds:").."]"..
- "label[4,0.5;"..S("Flour:").."]"..
- "label[0,-0.3;"..S("Mill").."]"..
- "label[0,2.5;"..S("Punch this hand-driven mill").."]"..
- "label[0,3.0;"..S("to convert wheat seeds into flour.").."]"..
- "list[current_player;main;0,4;8,4;]";
+ "image[0,1;1,1;"..cottages.texture_wheat_seed.."]"..
+ "list[current_name;seeds;1,1;1,1;]"..
+ "list[current_name;flour;5,1;2,2;]"..
+ "label[0,0.5;"..S("Wheat seeds:").."]"..
+ "label[4,0.5;"..S("Flour:").."]"..
+ "label[0,0;"..S("Mill").."]"..
+ "label[0,2.5;"..S("Punch this hand-driven mill").."]"..
+ "label[0,3.0;"..S("to convert wheat seeds into flour.").."]"..
+ "list[current_player;main;0,4;8,4;]";
minetest.register_node("cottages:handmill", {
description = S("Mill, powered by punching"),
@@ -393,7 +393,7 @@ minetest.register_node("cottages:handmill", {
meta:set_string("infotext", S("Mill, powered by punching (owned by %s)"):format(meta:get_string("owner") or ""));
meta:set_string("formspec",
cottages_handmill_formspec..
- "label[2.5,-0.5;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]" );
+ "label[2.5,0;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]" );
end,
can_dig = function(pos,player)
@@ -466,7 +466,7 @@ minetest.register_node("cottages:handmill", {
-- update the formspec
meta:set_string("formspec",
cottages_handmill_formspec..
- "label[2.5,-0.5;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]" );
+ "label[2.5,0;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]" );
return;
end
@@ -578,7 +578,7 @@ minetest.register_craft({
})
-----
--- Derivative blocks
+-- Derivative blocks for straw blocks (bale and regular)
-----
if stairs and stairs.mod and stairs.mod == "redo" then
diff --git a/textures/cottages_water_indicator.png b/textures/cottages_water_indicator.png
new file mode 100644
index 0000000..67f92b5
--- /dev/null
+++ b/textures/cottages_water_indicator.png
Binary files differ