summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwebdesigner97 <Christian_D_97@gmx.de>2013-10-16 10:10:19 +0200
committerwebdesigner97 <Christian_D_97@gmx.de>2013-10-16 10:10:19 +0200
commit5508d85d407282c391336bdcb8937a26f21e8c6d (patch)
tree576e28479f4fd8f3647e970abaa2bccfecd42425
parentfe7607750f24d1ee8daa38d648fc39e056ef6779 (diff)
downloadroads-5508d85d407282c391336bdcb8937a26f21e8c6d.tar
roads-5508d85d407282c391336bdcb8937a26f21e8c6d.tar.gz
roads-5508d85d407282c391336bdcb8937a26f21e8c6d.tar.bz2
roads-5508d85d407282c391336bdcb8937a26f21e8c6d.tar.xz
roads-5508d85d407282c391336bdcb8937a26f21e8c6d.zip
Lightened code
-rw-r--r--asphaltstairs/function.lua56
-rw-r--r--asphaltstairs/init.lua5
-rw-r--r--concretestairs/init.lua2
-rw-r--r--emergencyphone/init.lua44
-rw-r--r--labels/init.lua2
-rw-r--r--trafficlight/init.lua5
6 files changed, 25 insertions, 89 deletions
diff --git a/asphaltstairs/function.lua b/asphaltstairs/function.lua
deleted file mode 100644
index 9879d4c..0000000
--- a/asphaltstairs/function.lua
+++ /dev/null
@@ -1,56 +0,0 @@
--- StreetsMod needs a special slab definition, so it needs its own register_stair_and_slab
-streets.register_stair_and_slab = function(node,desc,tile,item)
- minetest.register_node(":streets:"..node.."_stair",{
- description = desc.."stair",
- groups = {cracky = 3},
- tiles = tile,
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "nodebox",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
- {-0.5, 0, 0, 0.5, 0.5, 0.5}
- }
- }
- })
- minetest.register_node(":streets:"..node.."_slab",{
- description = desc.." slab",
- groups = {cracky = 3},
- tiles = tile,
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "nodebox",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
- }
- }
- })
- minetest.register_craft({
- output = "streets:"..node.."_stair 4",
- recipe = {
- {"","",item},
- {"",item,item},
- {item,item,item}
- }
- })
- minetest.register_craft({
- output = "streets:"..node.."_stair 4",
- recipe = {
- {item,"",""},
- {item,item,""},
- {item,item,item}
- }
- })
- minetest.register_craft({
- output = "streets:"..node.."_slab 3",
- recipe = {
- {"","",""},
- {"","",""},
- {item,item,item}
- }
- })
-end \ No newline at end of file
diff --git a/asphaltstairs/init.lua b/asphaltstairs/init.lua
index 7c1c181..aae9e22 100644
--- a/asphaltstairs/init.lua
+++ b/asphaltstairs/init.lua
@@ -1,7 +1,7 @@
--[[
StreetsMod: Asphalt stairs
]]
-if streets.extendedBy.moreblocks == true then
+if type(register_stair_slab_panel_micro) ~= "function" then return end
-- Asphalt
register_stair_slab_panel_micro("streets", "asphalt", "streets:asphalt", {cracky=3}, {"streets_asphalt.png"}, "Asphalt", "asphalt", nil)
minetest.register_alias("streets:asphalt_stair","stairs:stair_asphalt")
@@ -224,5 +224,4 @@ if streets.extendedBy.moreblocks == true then
type = "shapeless",
output = "streets:asphalt_side_l",
recipe = {"streets:asphalt_side_r"}
- })
-end \ No newline at end of file
+ }) \ No newline at end of file
diff --git a/concretestairs/init.lua b/concretestairs/init.lua
index 4cd3efd..b3000fa 100644
--- a/concretestairs/init.lua
+++ b/concretestairs/init.lua
@@ -1,7 +1,7 @@
--[[
StreetsMod: Concrete stairs (compatible to circular saw)
]]
-if streets.extendedBy.moreblocks == true and streets.extendedBy.prefab == false then
+if type(register_stair_slab_panel_mirco) == "function" and streets.extendedBy.prefab == false then
register_stair_slab_panel_micro("streets", "concrete", "streets:concrete", {cracky=2}, {"streets_concrete.png"}, "Concrete", "concrete", nil)
table.insert(circular_saw.known_stairs,"streets:concrete")
minetest.register_alias("stairs:stair_concrete","streets:stair_concrete")
diff --git a/emergencyphone/init.lua b/emergencyphone/init.lua
index 90124a8..2dc818f 100644
--- a/emergencyphone/init.lua
+++ b/emergencyphone/init.lua
@@ -1,27 +1,25 @@
--[[
StreetsMod: Emergency Phone
]]
-if streets.extendedBy.wool == true then
- minetest.register_node(":streets:emergencyphone",{
- description = "Emergency Phone",
- tiles = {"streets_sos_top.png","streets_sos_bottom.png","streets_sos_side.png","streets_sos_side.png","streets_sos_side.png","streets_sos_front.png"},
- groups = {cracky = 3},
- paramtype2 = "facedir",
- light_source = 5,
- on_rightclick = function(pos,node,clicker)
- if clicker:is_player() and clicker:get_hp() < 6 then
- clicker:set_hp(6)
- minetest.log("action",clicker:get_player_name() .. " healed by emergency phone at pos (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ")")
- end
+minetest.register_node(":streets:emergencyphone",{
+ description = "Emergency Phone",
+ tiles = {"streets_sos_top.png","streets_sos_bottom.png","streets_sos_side.png","streets_sos_side.png","streets_sos_side.png","streets_sos_front.png"},
+ groups = {cracky = 3},
+ paramtype2 = "facedir",
+ light_source = 5,
+ on_rightclick = function(pos,node,clicker)
+ if clicker:is_player() and clicker:get_hp() < 6 then
+ clicker:set_hp(6)
+ minetest.log("action",clicker:get_player_name() .. " healed by emergency phone at pos (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ")")
end
- })
- minetest.register_alias("streets:emergency_phone","streets:emergencyphone")
- minetest.register_craft({
- output = "streets:emergencyphone",
- recipe = {
- {"wool:orange","default:torch","wool:orange"},
- {"wool:orange","default:apple","wool:orange"},
- {"default:steel_ingot","default:diamondblock","default:steel_ingot"}
- }
- })
-end \ No newline at end of file
+ end
+ })
+ minetest.register_alias("streets:emergency_phone","streets:emergencyphone")
+minetest.register_craft({
+ output = "streets:emergencyphone",
+ recipe = {
+ {"wool:orange","default:torch","wool:orange"},
+ {"wool:orange","default:apple","wool:orange"},
+ {"default:steel_ingot","default:diamondblock","default:steel_ingot"}
+ }
+}) \ No newline at end of file
diff --git a/labels/init.lua b/labels/init.lua
index 5e59a3c..d53b7af 100644
--- a/labels/init.lua
+++ b/labels/init.lua
@@ -1,8 +1,6 @@
--[[
StreetsMod: All kinds of asphalt with labels
]]
-if streets.extendedBy.wool == false then return end
---
minetest.register_node(":streets:asphalt_sideline",{
description = "Asphalt with sideline",
groups = {cracky=3},
diff --git a/trafficlight/init.lua b/trafficlight/init.lua
index 1d3049d..44e463a 100644
--- a/trafficlight/init.lua
+++ b/trafficlight/init.lua
@@ -1,7 +1,6 @@
--[[
StreetsMod: inDev Trafficlights
]]
-if streets.extendedBy.mesecons and streets.extendedBy.digilines then
minetest.register_node(":streets:trafficlight_bottom",{
description = "Cheater",
groups = {not_in_creative_inventory = 1},
@@ -224,6 +223,4 @@ minetest.register_node(":streets:trafficlight_top_warn",{
},
pointable = false,
light_source = 6,
-})
-
-end \ No newline at end of file
+}) \ No newline at end of file