diff options
author | VanessaE <vanessaezekowitz@gmail.com> | 2013-07-13 18:26:56 -0700 |
---|---|---|
committer | VanessaE <vanessaezekowitz@gmail.com> | 2013-07-13 18:26:56 -0700 |
commit | 1a9a940e84bf4780313163ae3c3683fea5875330 (patch) | |
tree | a08dcda353cbd80f1411ecd0902b1ccd43c243e1 | |
parent | b19b57ef4b9625f5e1542d7c7aef557a8abf66d5 (diff) | |
parent | 31680fcf80c841679c3c8c59143a1a91aa4d7922 (diff) | |
download | pipeworks-1a9a940e84bf4780313163ae3c3683fea5875330.tar pipeworks-1a9a940e84bf4780313163ae3c3683fea5875330.tar.gz pipeworks-1a9a940e84bf4780313163ae3c3683fea5875330.tar.bz2 pipeworks-1a9a940e84bf4780313163ae3c3683fea5875330.tar.xz pipeworks-1a9a940e84bf4780313163ae3c3683fea5875330.zip |
Merge pull request #47 from hdastwb/mesesandtube
MESE Sand Tubes
-rw-r--r-- | Overview.html | 10 | ||||
-rw-r--r-- | crafts.lua | 21 | ||||
-rw-r--r-- | img/CraftMeseSandTube1.png | bin | 0 -> 8565 bytes | |||
-rw-r--r-- | img/CraftMeseSandTube2.png | bin | 0 -> 3330 bytes | |||
-rw-r--r-- | img/MeseSandTubeForm.png | bin | 0 -> 52592 bytes | |||
-rw-r--r-- | textures/pipeworks_mese_sand_tube_end.png | bin | 0 -> 1191 bytes | |||
-rw-r--r-- | textures/pipeworks_mese_sand_tube_inv.png | bin | 0 -> 699 bytes | |||
-rw-r--r-- | textures/pipeworks_mese_sand_tube_noctr.png | bin | 0 -> 983 bytes | |||
-rw-r--r-- | textures/pipeworks_mese_sand_tube_plain.png | bin | 0 -> 2464 bytes | |||
-rw-r--r-- | textures/pipeworks_mese_sand_tube_short.png | bin | 0 -> 628 bytes | |||
-rw-r--r-- | tubes.lua | 59 |
11 files changed, 89 insertions, 1 deletions
diff --git a/Overview.html b/Overview.html index f6d4e22..75e5a0a 100644 --- a/Overview.html +++ b/Overview.html @@ -188,10 +188,18 @@ a { <p>Here's how you craft it:</p>
<img src="img/CraftNodeBreaker.png">
<h3>Sand Tubes</h3>
- <p>Sand tubes are special tubes that vacuum up free items around it. When an item drops near the sand tube, it is sucked up and sent along the tube.</p>
+ <p>Sand tubes are special tubes that vacuum up free items around them. When an item drops near the sand tube, it is sucked up and sent along the tube.</p>
<p>Sand tubes have an effective radius of 2 meters (nodes). Outside of this sphere, items are unaffected.</p>
<img src="img/SandTube.png">
<p>Here's how you craft it:</p>
<img src="img/CraftSandTube.png">
+ <h3>Mese Sand Tubes</h3>
+ <p>Mese sand tubes pick up items like sand tubes, but they do so in a customizable cubic region rather than a fixed spherical one.</p>
+ <p>To change the range of a mese sand tube, change the distance specified in the form.</p>
+ <p>The number entered here can be anywhere from 0 (the default) to 8; it represents a sort of cubic radius from the tube, thus the default is to only pick up items within the tube's 1x1x1 node, but, if one entered "5", the tube would pick up items in an 11x11x11 cube.</p>
+ <img src="img/MeseSandTubeForm.png" style="width:50%;">
+ <p>Crafts are similar to the mese sorting tube, but based on sand tubes instead:</p>
+ <img src="img/CraftMeseSandTube1.png">
+ <img src="img/CraftMeseSandTube2.png">
</body>
</html>
\ No newline at end of file @@ -251,5 +251,26 @@ if io.open(minetest.get_modpath("pipeworks").."/../technic/init.lua", "r") == ni { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } }, }) + + minetest.register_craft( { + output = "pipeworks:mese_sand_tube_000000 2", + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, + { "default:sand", "default:mese_crystal", "default:sand" }, + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } + }, + }) + + minetest.register_craft( { + type = "shapeless", + output = "pipeworks:mese_sand_tube_000000", + recipe = { + "pipeworks:sand_tube_000000", + "default:mese_crystal_fragment", + "default:mese_crystal_fragment", + "default:mese_crystal_fragment", + "default:mese_crystal_fragment" + }, + }) end diff --git a/img/CraftMeseSandTube1.png b/img/CraftMeseSandTube1.png Binary files differnew file mode 100644 index 0000000..f1aecde --- /dev/null +++ b/img/CraftMeseSandTube1.png diff --git a/img/CraftMeseSandTube2.png b/img/CraftMeseSandTube2.png Binary files differnew file mode 100644 index 0000000..80372e0 --- /dev/null +++ b/img/CraftMeseSandTube2.png diff --git a/img/MeseSandTubeForm.png b/img/MeseSandTubeForm.png Binary files differnew file mode 100644 index 0000000..1da2c7e --- /dev/null +++ b/img/MeseSandTubeForm.png diff --git a/textures/pipeworks_mese_sand_tube_end.png b/textures/pipeworks_mese_sand_tube_end.png Binary files differnew file mode 100644 index 0000000..b044d73 --- /dev/null +++ b/textures/pipeworks_mese_sand_tube_end.png diff --git a/textures/pipeworks_mese_sand_tube_inv.png b/textures/pipeworks_mese_sand_tube_inv.png Binary files differnew file mode 100644 index 0000000..8829422 --- /dev/null +++ b/textures/pipeworks_mese_sand_tube_inv.png diff --git a/textures/pipeworks_mese_sand_tube_noctr.png b/textures/pipeworks_mese_sand_tube_noctr.png Binary files differnew file mode 100644 index 0000000..9e41bc8 --- /dev/null +++ b/textures/pipeworks_mese_sand_tube_noctr.png diff --git a/textures/pipeworks_mese_sand_tube_plain.png b/textures/pipeworks_mese_sand_tube_plain.png Binary files differnew file mode 100644 index 0000000..ff0a107 --- /dev/null +++ b/textures/pipeworks_mese_sand_tube_plain.png diff --git a/textures/pipeworks_mese_sand_tube_short.png b/textures/pipeworks_mese_sand_tube_short.png Binary files differnew file mode 100644 index 0000000..2defd5d --- /dev/null +++ b/textures/pipeworks_mese_sand_tube_short.png @@ -518,3 +518,62 @@ minetest.register_abm({nodenames={"group:sand_tube"},interval=1,chance=1, end }) +mese_sand_noctr_textures={"pipeworks_mese_sand_tube_noctr.png","pipeworks_mese_sand_tube_noctr.png","pipeworks_mese_sand_tube_noctr.png", + "pipeworks_mese_sand_tube_noctr.png","pipeworks_mese_sand_tube_noctr.png","pipeworks_mese_sand_tube_noctr.png"} +mese_sand_plain_textures={"pipeworks_mese_sand_tube_plain.png","pipeworks_mese_sand_tube_plain.png","pipeworks_mese_sand_tube_plain.png", + "pipeworks_mese_sand_tube_plain.png","pipeworks_mese_sand_tube_plain.png","pipeworks_mese_sand_tube_plain.png"} +mese_sand_end_textures={"pipeworks_mese_sand_tube_end.png","pipeworks_mese_sand_tube_end.png","pipeworks_mese_sand_tube_end.png", + "pipeworks_mese_sand_tube_end.png","pipeworks_mese_sand_tube_end.png","pipeworks_mese_sand_tube_end.png"} +mese_sand_short_texture="pipeworks_mese_sand_tube_short.png" +mese_sand_inv_texture="pipeworks_mese_sand_tube_inv.png" + +register_tube("pipeworks:mese_sand_tube","Mese sand pneumatic tube segment",mese_sand_plain_textures,mese_sand_noctr_textures,mese_sand_end_textures, + mese_sand_short_texture,mese_sand_inv_texture, + {groups={mese_sand_tube=1}, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + meta:set_int("dist", 0) + meta:set_string("formspec", + "size[2,1]".. + "field[.5,.5;1.5,1;dist;distance;${dist}]") + meta:set_string("infotext", "Mese sand pneumatic tube") + end, + on_receive_fields=function(pos,formname,fields,sender) + local meta=minetest.env:get_meta(pos) + local dist + _, dist = pcall(tonumber, fields.dist) + if dist and 0 <= dist and dist <= 8 then meta:set_int("dist", dist) end + end, +}) + +local function get_objects_with_square_radius(pos, rad) + rad = rad + .5; + local objs = {} + for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, math.sqrt(3)*rad)) do + if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then + local opos = object:getpos() + if pos.x - rad <= opos.x and opos.x <= pos.x + rad and pos.y - rad <= opos.y and opos.y <= pos.y + rad and pos.z - rad <= opos.z and opos.z <= pos.z + rad then + objs[#objs + 1] = object + end + end + end + return objs +end + +minetest.register_abm({nodenames={"group:mese_sand_tube"},interval=1,chance=1, + action=function(pos, node, active_object_count, active_object_count_wider) + for _,object in ipairs(get_objects_with_square_radius(pos, minetest.env:get_meta(pos):get_int("dist"))) do + if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then + if object:get_luaentity().itemstring ~= "" then + local titem=tube_item(pos,object:get_luaentity().itemstring) + titem:get_luaentity().start_pos = {x=pos.x,y=pos.y-1,z=pos.z} + titem:setvelocity({x=0.01,y=1,z=-0.01}) + titem:setacceleration({x=0, y=0, z=0}) + end + object:get_luaentity().itemstring = "" + object:remove() + end + end + end +}) + |