summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSokomine <wegwerf@anarres.dyndns.org>2015-07-27 17:51:58 +0200
committerSokomine <wegwerf@anarres.dyndns.org>2015-07-27 17:51:58 +0200
commit9d5db547f09bc568d095296c4885c78e8c7c56d4 (patch)
tree35c0c88cef86102b4405bdcf6d298286001de0f5
parent2d05ae5b7d76128f423b05e36ba9171c9769d937 (diff)
took care of unregistered-globals-warnings
-rw-r--r--README.md4
-rw-r--r--init.lua13
-rw-r--r--nodes_anvil.lua8
-rw-r--r--nodes_barrel.lua8
-rw-r--r--nodes_chests.lua7
-rw-r--r--nodes_doorlike.lua8
-rw-r--r--nodes_fences.lua8
-rw-r--r--nodes_furniture.lua8
-rw-r--r--nodes_historic.lua10
-rw-r--r--nodes_roof.lua7
-rw-r--r--nodes_straw.lua8
11 files changed, 26 insertions, 63 deletions
diff --git a/README.md b/README.md
index e2f9591..4f4501d 100644
--- a/README.md
+++ b/README.md
@@ -19,10 +19,12 @@ VanessaE (CC-by-SA 3.0):
cottages_homedecor_shingles_asphalt.png
cottages_homedecor_shingles_terracotta.png
cottages_homedecor_shingles_wood.png
- glooptest_tool_steelhammer.png
cottages_sleepingmat.png
cottages_barrel.png
+CC-by-SA; done by GloopMaster (CC-by-SA):
+ glooptest_tool_steelhammer.png
+
badger436 (created for this mod; CC BY-SA 3.0):
cottages_feldweg.png
diff --git a/init.lua b/init.lua
index d9c094a..5573569 100644
--- a/init.lua
+++ b/init.lua
@@ -4,6 +4,9 @@
-- License: GPLv3
--
-- Modified:
+-- 27.07.15 Moved into its own repository.
+-- Made sure textures and craft receipe indigrents are available or can be replaced.
+-- Took care of "unregistered globals" warnings.
-- 23.01.14 Added conversion receipes in case of installed castle-mod (has its own anvil)
-- 23.01.14 Added hammer and anvil as decoration and for repairing tools.
-- Added hatches (wood and steel).
@@ -19,6 +22,13 @@
cottages = {}
+-- Boilerplate to support localized strings if intllib mod is installed.
+if minetest.get_modpath( "intllib" ) and intllib then
+ cottages.S = intllib.Getter()
+else
+ cottages.S = function(s) return s end
+end
+
--cottages.config_use_mesh_barrel = false;
--cottages.config_use_mesh_handmill = true;
@@ -39,3 +49,6 @@ dofile(minetest.get_modpath("cottages").."/nodes_barrel.lua");
-- this is only required and useful if you run versions of the random_buildings mod where the nodes where defined inside that mod
dofile(minetest.get_modpath("cottages").."/alias.lua");
+
+-- variable no longer needed
+cottages.S = nil;
diff --git a/nodes_anvil.lua b/nodes_anvil.lua
index e6c89ce..b514273 100644
--- a/nodes_anvil.lua
+++ b/nodes_anvil.lua
@@ -7,13 +7,7 @@
-- License of the hammer picture: CC-by-SA; done by GloopMaster; source:
-- https://github.com/GloopMaster/glooptest/blob/master/glooptest/textures/glooptest_tool_steelhammer.png
--- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
-- the hammer for the anvil
minetest.register_tool("cottages:hammer", {
diff --git a/nodes_barrel.lua b/nodes_barrel.lua
index ce37646..c3c9e6f 100644
--- a/nodes_barrel.lua
+++ b/nodes_barrel.lua
@@ -21,13 +21,7 @@
-- TODO: option so that it works without nodeboxes
--- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
barrel = {};
diff --git a/nodes_chests.lua b/nodes_chests.lua
index a1256c9..c099749 100644
--- a/nodes_chests.lua
+++ b/nodes_chests.lua
@@ -3,12 +3,7 @@
-- TODO: add bags (not for carrying around but for decoration)
-- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
cottages_chests = {}
-- uses default.chest_formspec for now
diff --git a/nodes_doorlike.lua b/nodes_doorlike.lua
index cb1b1b0..d989c05 100644
--- a/nodes_doorlike.lua
+++ b/nodes_doorlike.lua
@@ -10,13 +10,7 @@
-- abm that opens/closes the window shutters is called. Anything less than 10 minutes
-- (600 seconds) ought to be ok.
-----------------------------------------------------------------------------------------------------------
--- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
-----------------------------------------------------------------------------------------------------------
-- small window shutters for single-node-windows; they open at day and close at night if the abm is working
diff --git a/nodes_fences.lua b/nodes_fences.lua
index bd7a52d..0a4a26f 100644
--- a/nodes_fences.lua
+++ b/nodes_fences.lua
@@ -1,12 +1,6 @@
-- 22.01.13 Changed texture to that of the wood from the minimal development game
--- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
minetest.register_node("cottages:fence_small", {
description = S("small fence"),
diff --git a/nodes_furniture.lua b/nodes_furniture.lua
index ee6ba8c..fcb5da7 100644
--- a/nodes_furniture.lua
+++ b/nodes_furniture.lua
@@ -13,13 +13,7 @@
---------------------------------------------------------------------------------------
-- TODO: change the textures of the bed (make the clothing white, foot path not entirely covered with cloth)
--- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
-- a bed without functionality - just decoration
minetest.register_node("cottages:bed_foot", {
diff --git a/nodes_historic.lua b/nodes_historic.lua
index d9daf09..0a81d23 100644
--- a/nodes_historic.lua
+++ b/nodes_historic.lua
@@ -8,13 +8,7 @@
-- * glass pane - an improvement compared to fence posts as windows :-)
---------------------------------------------------------------------------------------
--- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
-- can be used to buid real stationary wagons or attached to walls as decoration
minetest.register_node("cottages:wagon_wheel", {
@@ -62,7 +56,7 @@ minetest.register_node("cottages:loam", {
})
-- create stairs if possible
-if( stairs and stairs.register_stair_and_slab) then
+if( minetest.get_modpath("stairs") and stairs and stairs.register_stair_and_slab) then
stairs.register_stair_and_slab("feldweg", "cottages:feldweg",
{snappy=2,choppy=2,oddly_breakable_by_hand=2},
{"cottages_feldweg.png","default_dirt.png", "default_grass.png","default_grass.png","cottages_feldweg.png","cottages_feldweg.png"},
diff --git a/nodes_roof.lua b/nodes_roof.lua
index 8c2625a..11174d8 100644
--- a/nodes_roof.lua
+++ b/nodes_roof.lua
@@ -1,10 +1,5 @@
-- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
---------------------------------------------------------------------------------------
-- roof parts
diff --git a/nodes_straw.lua b/nodes_straw.lua
index 3eac6b6..10848a2 100644
--- a/nodes_straw.lua
+++ b/nodes_straw.lua
@@ -4,13 +4,7 @@
-- * straw mat - for animals and very poor NPC; also basis for other straw things
-- * straw bale - well, just a good source for building and decoration
--- Boilerplate to support localized strings if intllib mod is installed.
-local S
-if intllib then
- S = intllib.Getter()
-else
- S = function(s) return s end
-end
+local S = cottages.S
-- an even simpler from of bed - usually for animals
-- it is a nodebox and not wallmounted because that makes it easier to replace beds with straw mats