Compare commits

..

No commits in common. "876ff2de08bd2135b69040cebc6aaedf22fd4509" and "43eabc2f2723a95a1740897958a78ba1bc09176f" have entirely different histories.

49 changed files with 53 additions and 98 deletions

0
LICENSE Executable file → Normal file
View File

0
README.md Executable file → Normal file
View File

0
adaptions.lua Executable file → Normal file
View File

0
alias.lua Executable file → Normal file
View File

0
depends.txt Executable file → Normal file
View File

0
init.lua Executable file → Normal file
View File

0
locale/de.txt Executable file → Normal file
View File

0
locale/template.txt Executable file → Normal file
View File

0
models/cottages_barrel.obj Executable file → Normal file
View File

0
models/cottages_barrel_closed.obj Executable file → Normal file
View File

0
models/cottages_barrel_closed_lying.obj Executable file → Normal file
View File

0
models/cottages_barrel_lying.obj Executable file → Normal file
View File

0
models/cottages_handmill.obj Executable file → Normal file
View File

0
models/cottages_tub.obj Executable file → Normal file
View File

86
nodes_anvil.lua Executable file → Normal file
View File

@ -9,12 +9,6 @@
local S = cottages.S
-- disable repair with anvil by setting a message for the item in question
cottages.forbid_repair = {}
-- example for hammer no longer beeing able to repair the hammer
--cottages.forbid_repair["cottages:hammer"] = 'The hammer is too complex for repairing.'
-- the hammer for the anvil
minetest.register_tool("cottages:hammer", {
description = S("Steel hammer for repairing tools on the anvil"),
@ -57,7 +51,7 @@ local cottages_anvil_formspec =
minetest.register_node("cottages:anvil", {
drawtype = "nodebox",
description = S("anvil"),
tiles = {"cottages_anvil.png"}, -- TODO default_steel_block.png, default_obsidian.png are also nice
tiles = {"cottages_stone.png"}, -- TODO default_steel_block.png, default_obsidian.png are also nice
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
@ -92,48 +86,46 @@ minetest.register_node("cottages:anvil", {
meta:set_string("formspec", cottages_anvil_formspec );
end,
--after_place_node = function(pos, placer)
--local meta = minetest.get_meta(pos);
--meta:set_string("owner", placer:get_player_name() or "");
--meta:set_string("infotext", S("Anvil (owned by %s)"):format((meta:get_string("owner") or "")));
-- meta:set_string("formspec",
-- cottages_anvil_formspec,
-- "label[2.5,-0.5;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]");
--end,
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos);
meta:set_string("owner", placer:get_player_name() or "");
meta:set_string("infotext", S("Anvil (owned by %s)"):format((meta:get_string("owner") or "")));
meta:set_string("formspec",
cottages_anvil_formspec,
"label[2.5,-0.5;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]");
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory();
-- local owner = meta:get_string('owner');
local owner = meta:get_string('owner');
if( not( inv:is_empty("input"))
-- or not( inv:is_empty("material"))
-- or not( inv:is_empty("sample"))
or not( inv:is_empty("hammer")))
-- or not( player )
-- or ( owner and owner ~= '' and player:get_player_name() ~= owner ))]] then
then
or not( inv:is_empty("hammer"))
or not( player )
or ( owner and owner ~= '' and player:get_player_name() ~= owner )) then
return false;
end
return true
end,
-- return true;
-- end,
end
return true;
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
--if( player and player:get_player_name() ~= meta:get_string('owner' ) and from_list~="input") then
-- return 0
--end
if( player and player:get_player_name() ~= meta:get_string('owner' ) and from_list~="input") then
return 0
end
return count;
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
--[[if( player and player:get_player_name() ~= meta:get_string('owner' ) and listname~="input") then
if( player and player:get_player_name() ~= meta:get_string('owner' ) and listname~="input") then
return 0;
end]]
end
if( listname=='hammer' and stack and stack:get_name() ~= 'cottages:hammer') then
return 0;
end
@ -146,20 +138,14 @@ minetest.register_node("cottages:anvil", {
S('The workpiece slot is for damaged tools only.'));
return 0;
end
if( listname=='input'
and cottages.forbid_repair[ stack:get_name() ]) then
minetest.chat_send_player( player:get_player_name(),
S(cottages.forbid_repair[ stack:get_name() ]));
return 0;
end
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
--[[if( player and player:get_player_name() ~= meta:get_string('owner' ) and listname~="input") then
if( player and player:get_player_name() ~= meta:get_string('owner' ) and listname~="input") then
return 0
end]]
end
return stack:get_count()
end,
@ -186,23 +172,15 @@ minetest.register_node("cottages:anvil", {
or input:get_name() == "technic:water_can"
or input:get_name() == "technic:lava_can" ) then
--[[meta:set_string("formspec",
meta:set_string("formspec",
cottages_anvil_formspec,
"label[2.5,-0.5;"..S("Owner: %s"):format(meta:get_string('owner') or "").."]");
return;]]
return;
end
-- 65535 is max damage
local damage_state = 40-math.floor(input:get_wear()/1638);
-- just to make sure that it really can't get repaired if it should not
-- (if the check of placing the item in the input slot failed somehow)
if( puncher and name and cottages.forbid_repair[ input:get_name() ]) then
minetest.chat_send_player( name,
S(cottages.forbid_repair[ input:get_name() ]));
return;
end
local tool_name = input:get_name();
local hud_image = "";
if( tool_name
@ -220,7 +198,7 @@ minetest.register_node("cottages:anvil", {
local hud1 = puncher:hud_add({
hud_elem_type = "image",
scale = {x = 8, y = 8},
scale = {x = 15, y = 15},
text = hud_image,
position = {x = 0.5, y = 0.5},
alignment = {x = 0, y = 0}
@ -230,7 +208,7 @@ minetest.register_node("cottages:anvil", {
if( input:get_wear()>0 ) then
hud2 = puncher:hud_add({
hud_elem_type = "statbar",
text = "default_cloud.png^[colorize:#4A4A4A:256",
text = "default_cloud.png^[colorize:#ff0000:256",
number = 40,
direction = 0, -- left to right
position = {x=0.5, y=0.65},
@ -240,7 +218,7 @@ minetest.register_node("cottages:anvil", {
})
hud3 = puncher:hud_add({
hud_elem_type = "statbar",
text = "default_cloud.png^[colorize:#6499FF:256",
text = "default_cloud.png^[colorize:#00ff00:256",
number = damage_state,
direction = 0, -- left to right
position = {x=0.5, y=0.65},
@ -251,9 +229,9 @@ minetest.register_node("cottages:anvil", {
end
minetest.after(2, function()
if( puncher ) then
if(hud1) then puncher:hud_remove(hud1); end
if(hud2) then puncher:hud_remove(hud2); end
if(hud3) then puncher:hud_remove(hud3); end
puncher:hud_remove(hud1);
puncher:hud_remove(hud2);
puncher:hud_remove(hud3);
end
end)

0
nodes_barrel.lua Executable file → Normal file
View File

0
nodes_chests.lua Executable file → Normal file
View File

8
nodes_doorlike.lua Executable file → Normal file
View File

@ -435,11 +435,3 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "cottages:hatch_wood",
recipe = {
{"","","stairs:slab_wood"},
{"stairs:slab_wood","default:stick",""},
{"","",""},
}
})

0
nodes_fences.lua Executable file → Normal file
View File

5
nodes_furniture.lua Executable file → Normal file
View File

@ -264,13 +264,10 @@ minetest.register_node("cottages:shelf", {
local meta = minetest.get_meta(pos);
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
meta:set_string("formspec",
"size[8,8]"..
"list[current_name;main;0,0;8,3;]"..
"list[current_player;main;0,4;8,4;]"..
"listring[nodemeta:" .. spos .. ";main]" ..
"listring[current_player;main]")
"list[current_player;main;0,4;8,4;]")
meta:set_string("infotext", S("open storage shelf"))
local inv = meta:get_inventory();
inv:set_size("main", 24);

10
nodes_historic.lua Executable file → Normal file
View File

@ -111,7 +111,7 @@ minetest.register_node("cottages:glass_pane_side", {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.40, 0.5, 0.5, -0.50},
},
},
},
selection_box = {
type = "fixed",
@ -229,11 +229,11 @@ minetest.register_craft({
})
minetest.register_craft({
output = "cottages:glass_pane 12",
output = "cottages:glass_pane 4",
recipe = {
{"default:glass","default:glass","default:glass" },
{"default:glass","default:glass","default:glass" },
{"default:glass","default:glass","default:glass" }
{cottages.craftitem_stick, cottages.craftitem_stick, cottages.craftitem_stick },
{cottages.craftitem_stick, cottages.craftitem_glass, cottages.craftitem_stick },
{cottages.craftitem_stick, cottages.craftitem_stick, cottages.craftitem_stick }
}
})

0
nodes_roof.lua Executable file → Normal file
View File

14
nodes_straw.lua Executable file → Normal file
View File

@ -333,13 +333,13 @@ minetest.register_node("cottages:threshing_floor", {
minetest.after(2, function()
if( puncher ) then
if(hud1) then puncher:hud_remove(hud1); end
if(hud2) then puncher:hud_remove(hud2); end
if(hud3) then puncher:hud_remove(hud3); end
if(hud4) then puncher:hud_remove(hud4); end
if(hud5) then puncher:hud_remove(hud5); end
if(hud6) then puncher:hud_remove(hud6); end
if(hud0) then puncher:hud_remove(hud0); end
puncher:hud_remove(hud1);
puncher:hud_remove(hud2);
puncher:hud_remove(hud3);
puncher:hud_remove(hud4);
puncher:hud_remove(hud5);
puncher:hud_remove(hud6);
puncher:hud_remove(hud0);
end
end)
end,

View File

@ -117,7 +117,7 @@ minetest.register_node("cottages:water_gen", {
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, cracky = 1, flammable = 2},
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = cottages.sounds.wood,
node_box = {
type = "fixed",
@ -178,14 +178,8 @@ minetest.register_node("cottages:water_gen", {
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
local bucket = meta:get_string("bucket")
local start = meta:get_string("fillstarttime")
return inv:is_empty("main")
and default.can_interact_with_node(player, pos)
and (not(bucket) or bucket == "")
and ((not(start) or start == "" or
(minetest.get_us_time()/1000000) - tonumber(start)
>= cottages.water_fill_time -2))
return inv:is_empty("main") and
default.can_interact_with_node(player, pos)
end,
-- no inventory move allowed
allow_metadata_inventory_move = function(pos, from_list, from_index,
@ -219,7 +213,7 @@ minetest.register_node("cottages:water_gen", {
cottages.switch_public(pos, formname, fields, sender, 'tree trunk well')
end,
-- punch to place and retrieve bucket
on_punch = function(pos, node, puncher, pointed_thing)
on_punch = function(pos, node, puncher)
if( not( pos ) or not( node ) or not( puncher )) then
return
end
@ -229,8 +223,7 @@ minetest.register_node("cottages:water_gen", {
local owner = meta:get_string("owner")
local public = meta:get_string("public")
if( name ~= owner and public~="public") then
minetest.chat_send_player( name,
S("This tree trunk well is owned by %s. You can't use it."):format(owner))
minetest.chat_send_player( name, S("This tree trunk well is owned by %s. You can't use it."):format(name))
return
end
@ -240,18 +233,13 @@ minetest.register_node("cottages:water_gen", {
-- is the well working on something? (either empty or full bucket)
local bucket = meta:get_string("bucket")
-- there is a bucket loaded - either empty or full
if( bucket and bucket~="" and bucket ~= "bucket:bucket_empty") then
if( bucket and bucket~="") then
if( not(pinv:room_for_item("main", bucket))) then
minetest.chat_send_player( puncher:get_player_name(),
S("Sorry. You have no room for the bucket. Please free some "..
"space in your inventory first!"))
return
end
elseif( bucket and bucket == "bucket:bucket_empty") then
minetest.chat_send_player( puncher:get_player_name(),
S("Please wait until your bucket has been filled."))
-- do not give the empty bucket back immediately
return
end
-- remove the old entity (either a bucket will be placed now or a bucket taken)
@ -279,6 +267,8 @@ minetest.register_node("cottages:water_gen", {
if( wielded
and wielded:get_name()
and wielded:get_name() == "bucket:bucket_empty") then
-- remove the bucket from the players inventory
pinv:remove_item( "main", "bucket:bucket_empty")
-- remember that we got a bucket loaded
meta:set_string("bucket", "bucket:bucket_empty")
-- create the entity
@ -290,8 +280,6 @@ minetest.register_node("cottages:water_gen", {
minetest.after(cottages.water_fill_time, cottages.water_gen_fill_bucket, pos)
-- the bucket will only be filled if the water ran long enough
meta:set_string("fillstarttime", tostring(minetest.get_us_time()/1000000))
-- remove the bucket from the players inventory
pinv:remove_item( "main", "bucket:bucket_empty")
return;
end
-- buckets can also be emptied here

0
textures/cottages_barrel.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

0
textures/cottages_beds_bed_side.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 536 B

After

Width:  |  Height:  |  Size: 536 B

0
textures/cottages_beds_bed_side_top_l.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 500 B

0
textures/cottages_beds_bed_side_top_r.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 502 B

0
textures/cottages_beds_bed_top_bottom.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 633 B

0
textures/cottages_beds_bed_top_top.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

0
textures/cottages_clay.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 272 B

0
textures/cottages_darkage_straw.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 852 B

0
textures/cottages_darkage_straw_bale.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 827 B

After

Width:  |  Height:  |  Size: 827 B

0
textures/cottages_feldweg.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 750 B

0
textures/cottages_glass_pane.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 975 B

After

Width:  |  Height:  |  Size: 975 B

0
textures/cottages_homedecor_shingles_asphalt.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 671 B

0
textures/cottages_homedecor_shingles_terracotta.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 386 B

0
textures/cottages_homedecor_shingles_wood.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 567 B

0
textures/cottages_junglewood.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 254 B

0
textures/cottages_loam.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

0
textures/cottages_minimal_wood.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
textures/cottages_reet.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 791 B

After

Width:  |  Height:  |  Size: 791 B

0
textures/cottages_slate.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

0
textures/cottages_sleepingmat.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

0
textures/cottages_steel_block.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 357 B

0
textures/cottages_stone.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 233 B

0
textures/cottages_wagonwheel.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 357 B

0
textures/cottages_wool.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 306 B

0
textures/glooptest_tool_steelhammer.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B