diff options
Diffstat (limited to 'roadsigns')
-rw-r--r-- | roadsigns/depends.txt | 1 | ||||
-rw-r--r-- | roadsigns/init.lua | 5 | ||||
-rw-r--r-- | roadsigns/pole.lua | 69 | ||||
-rw-r--r-- | roadsigns/signs.lua | 81 | ||||
-rw-r--r-- | roadsigns/textures/streets_pole.png | bin | 0 -> 2317 bytes | |||
-rw-r--r-- | roadsigns/textures/streets_pole_inv.png | bin | 0 -> 767 bytes | |||
-rw-r--r-- | roadsigns/textures/streets_sign_back.png | bin | 0 -> 1584 bytes | |||
-rw-r--r-- | roadsigns/textures/streets_sign_construction.png | bin | 0 -> 2989 bytes | |||
-rw-r--r-- | roadsigns/textures/streets_sign_lava.png | bin | 0 -> 3095 bytes | |||
-rw-r--r-- | roadsigns/textures/streets_sign_water.png | bin | 0 -> 2525 bytes |
10 files changed, 156 insertions, 0 deletions
diff --git a/roadsigns/depends.txt b/roadsigns/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/roadsigns/depends.txt @@ -0,0 +1 @@ +default diff --git a/roadsigns/init.lua b/roadsigns/init.lua new file mode 100644 index 0000000..4985694 --- /dev/null +++ b/roadsigns/init.lua @@ -0,0 +1,5 @@ +--[[ + StreetsMod: Poles and signs +]] +dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/pole.lua") +dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/signs.lua")
\ No newline at end of file diff --git a/roadsigns/pole.lua b/roadsigns/pole.lua new file mode 100644 index 0000000..8f2f7ba --- /dev/null +++ b/roadsigns/pole.lua @@ -0,0 +1,69 @@ +--[[ + StreetsMod: Poles and signs +]] +minetest.register_node(":streets:pole_bottom",{ + description = "Pole", + tiles = {"streets_pole.png"}, + groups = {cracky=2}, + inventory_image = "streets_pole_inv.png", + wield_image = "streets_pole_inv.png", + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.1,-0.5,-0.5,0.1,0.5,-0.4}, + {-0.125,-0.5,-0.525,0.125,-0.3,-0.375} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.1,-0.5,-0.5,0.1,0.5,-0.4} + } + }, + after_place_node = function(pos,placer,itemstack) + pos.y = pos.y +1 + if minetest.get_node(pos).name == "air" then + minetest.add_node(pos,{name = "streets:pole_top", param2 = minetest.dir_to_facedir(placer:get_look_dir())}) + else + minetest.chat_send_player(placer:get_player_name(),"Not enough free space! A pole has a height of 2 blocks!") + pos.y = pos.y -1 + minetest.remove_node(pos) + end + end, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y +1 + if minetest.get_node(pos).name == "streets:pole_top" then + minetest.remove_node(pos) + end + end +}) + +minetest.register_node(":streets:pole_top",{ + description = "Y u no play minetest without cheating?", + tiles = {"streets_pole.png"}, + groups = {cracky=2,not_in_creative_inventory=1}, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + can_dig = function(pos,player) + return false + end, + node_box = { + type = "fixed", + fixed = { + {-0.1,-0.5,-0.5,0.1,0.5,-0.4} + } + } +}) + +minetest.register_craft({ + output = "streets:pole_bottom 3", + recipe = { + {"","default:steel_ingot",""}, + {"","default:steel_ingot",""}, + {"","default:steel_ingot",""} + } +})
\ No newline at end of file diff --git a/roadsigns/signs.lua b/roadsigns/signs.lua new file mode 100644 index 0000000..a73b294 --- /dev/null +++ b/roadsigns/signs.lua @@ -0,0 +1,81 @@ +if streets.extendedBy.bucket == true and streets.extendedBy.wool then + minetest.register_node(":streets:sign_lava",{ + description = "Warning sign (lava)", + tiles = {"streets_sign_lava.png"}, + inventory_image = "streets_sign_lava.png", + wield_image = "streets_sign_lava.png", + groups = {snappy = 1,attached_node = 1}, + drawtype = "signlike", + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "wallmounted" + } + }) + + minetest.register_craft({ + output = "streets:sign_lava 2", + recipe = { + {"wool:red","wool:red","wool:red"}, + {"wool:red","bucket:bucket_lava","wool:red"}, + {"wool:red","wool:red","wool:red"} + }, + replacements = { + {"bucket:bucket_lava", "bucket:bucket_empty"} + } + }) + + minetest.register_node(":streets:sign_water",{ + description = "Warning sign (water)", + tiles = {"streets_sign_water.png"}, + inventory_image = "streets_sign_water.png", + wield_image = "streets_sign_water.png", + groups = {snappy = 1,attached_node = 1}, + drawtype = "signlike", + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "wallmounted" + } + }) + + minetest.register_craft({ + output = "streets:sign_water 2", + recipe = { + {"wool:red","wool:red","wool:red"}, + {"wool:red","bucket:bucket_water","wool:red"}, + {"wool:red","wool:red","wool:red"} + }, + replacements = { + {"bucket:bucket_water", "bucket:bucket_empty"} + } + }) + + minetest.register_node(":streets:sign_construction",{ + description = "Warning sign (Construction area)", + tiles = {"streets_sign_construction.png"}, + inventory_image = "streets_sign_construction.png", + wield_image = "streets_sign_construction.png", + groups = {snappy = 1,attached_node = 1}, + drawtype = "signlike", + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "wallmounted" + } + }) + minetest.register_craft({ + output = "streets:sign_construction 2", + recipe = { + {"wool:red","wool:red","wool:red"}, + {"wool:red","default:shovel_steel","wool:red"}, + {"wool:red","wool:red","wool:red"} + } + }) +end
\ No newline at end of file diff --git a/roadsigns/textures/streets_pole.png b/roadsigns/textures/streets_pole.png Binary files differnew file mode 100644 index 0000000..3fbed28 --- /dev/null +++ b/roadsigns/textures/streets_pole.png diff --git a/roadsigns/textures/streets_pole_inv.png b/roadsigns/textures/streets_pole_inv.png Binary files differnew file mode 100644 index 0000000..fce2292 --- /dev/null +++ b/roadsigns/textures/streets_pole_inv.png diff --git a/roadsigns/textures/streets_sign_back.png b/roadsigns/textures/streets_sign_back.png Binary files differnew file mode 100644 index 0000000..fd7fd69 --- /dev/null +++ b/roadsigns/textures/streets_sign_back.png diff --git a/roadsigns/textures/streets_sign_construction.png b/roadsigns/textures/streets_sign_construction.png Binary files differnew file mode 100644 index 0000000..d4a42dd --- /dev/null +++ b/roadsigns/textures/streets_sign_construction.png diff --git a/roadsigns/textures/streets_sign_lava.png b/roadsigns/textures/streets_sign_lava.png Binary files differnew file mode 100644 index 0000000..c134aa2 --- /dev/null +++ b/roadsigns/textures/streets_sign_lava.png diff --git a/roadsigns/textures/streets_sign_water.png b/roadsigns/textures/streets_sign_water.png Binary files differnew file mode 100644 index 0000000..d2e7d04 --- /dev/null +++ b/roadsigns/textures/streets_sign_water.png |