Initial directory structure rework
2
share/server/games/mesetint/mods/bucket/depends.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
default
|
||||
|
95
share/server/games/mesetint/mods/bucket/init.lua
Normal file
|
@ -0,0 +1,95 @@
|
|||
-- bucket (Minetest 0.4 mod)
|
||||
-- A bucket, which can pick up water and lava
|
||||
|
||||
minetest.register_alias("bucket", "bucket:bucket_empty")
|
||||
minetest.register_alias("bucket_water", "bucket:bucket_water")
|
||||
minetest.register_alias("bucket_lava", "bucket:bucket_lava")
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'bucket:bucket_empty 1',
|
||||
recipe = {
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
|
||||
bucket = {}
|
||||
bucket.liquids = {}
|
||||
|
||||
-- Register a new liquid
|
||||
-- source = name of the source node
|
||||
-- flowing = name of the flowing node
|
||||
-- itemname = name of the new bucket item (or nil if liquid is not takeable)
|
||||
-- inventory_image = texture of the new bucket item (ignored if itemname == nil)
|
||||
-- This function can be called from any mod (that depends on bucket).
|
||||
function bucket.register_liquid(source, flowing, itemname, inventory_image)
|
||||
bucket.liquids[source] = {
|
||||
source = source,
|
||||
flowing = flowing,
|
||||
itemname = itemname,
|
||||
}
|
||||
bucket.liquids[flowing] = bucket.liquids[source]
|
||||
|
||||
if itemname ~= nil then
|
||||
minetest.register_craftitem(itemname, {
|
||||
inventory_image = inventory_image,
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
-- Must be pointing to node
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
-- Check if pointing to a liquid
|
||||
n = minetest.env:get_node(pointed_thing.under)
|
||||
if bucket.liquids[n.name] == nil then
|
||||
-- Not a liquid
|
||||
minetest.env:add_node(pointed_thing.above, {name=source})
|
||||
elseif n.name ~= source then
|
||||
-- It's a liquid
|
||||
minetest.env:add_node(pointed_thing.under, {name=source})
|
||||
end
|
||||
return {name="bucket:bucket_empty"}
|
||||
end
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_craftitem("bucket:bucket_empty", {
|
||||
inventory_image = "bucket.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
-- Must be pointing to node
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
-- Check if pointing to a liquid source
|
||||
n = minetest.env:get_node(pointed_thing.under)
|
||||
liquiddef = bucket.liquids[n.name]
|
||||
if liquiddef ~= nil and liquiddef.source == n.name and liquiddef.itemname ~= nil then
|
||||
minetest.env:add_node(pointed_thing.under, {name="air"})
|
||||
return {name=liquiddef.itemname}
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
bucket.register_liquid(
|
||||
"default:water_source",
|
||||
"default:water_flowing",
|
||||
"bucket:bucket_water",
|
||||
"bucket_water.png"
|
||||
)
|
||||
|
||||
bucket.register_liquid(
|
||||
"default:lava_source",
|
||||
"default:lava_flowing",
|
||||
"bucket:bucket_lava",
|
||||
"bucket_lava.png"
|
||||
)
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:bucket_lava",
|
||||
burntime = 60,
|
||||
})
|
BIN
share/server/games/mesetint/mods/bucket/textures/bucket.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
share/server/games/mesetint/mods/bucket/textures/bucket_lava.png
Normal file
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 369 B |
1830
share/server/games/mesetint/mods/default/init.lua
Normal file
BIN
share/server/games/mesetint/mods/default/textures/crack.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 292 B |
After Width: | Height: | Size: 597 B |
After Width: | Height: | Size: 604 B |
After Width: | Height: | Size: 279 B |
After Width: | Height: | Size: 236 B |
After Width: | Height: | Size: 167 B |
After Width: | Height: | Size: 224 B |
After Width: | Height: | Size: 151 B |
After Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 613 B |
After Width: | Height: | Size: 249 B |
After Width: | Height: | Size: 210 B |
After Width: | Height: | Size: 118 B |
After Width: | Height: | Size: 933 B |
After Width: | Height: | Size: 830 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 539 B |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 236 B |
After Width: | Height: | Size: 978 B |
After Width: | Height: | Size: 874 B |
After Width: | Height: | Size: 856 B |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 591 B |
After Width: | Height: | Size: 936 B |
After Width: | Height: | Size: 672 B |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 507 B |
After Width: | Height: | Size: 395 B |
After Width: | Height: | Size: 357 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 952 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 965 B |
After Width: | Height: | Size: 303 B |
After Width: | Height: | Size: 410 B |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 260 B |
After Width: | Height: | Size: 242 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 507 B |
After Width: | Height: | Size: 555 B |
After Width: | Height: | Size: 545 B |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 772 B |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 489 B |
After Width: | Height: | Size: 219 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 182 B |
After Width: | Height: | Size: 806 B |
After Width: | Height: | Size: 161 B |
After Width: | Height: | Size: 186 B |
After Width: | Height: | Size: 264 B |
After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 927 B |
After Width: | Height: | Size: 271 B |
After Width: | Height: | Size: 216 B |
After Width: | Height: | Size: 291 B |
After Width: | Height: | Size: 931 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 301 B |
After Width: | Height: | Size: 927 B |
After Width: | Height: | Size: 245 B |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 255 B |
After Width: | Height: | Size: 925 B |
After Width: | Height: | Size: 913 B |
After Width: | Height: | Size: 917 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1 KiB |
After Width: | Height: | Size: 518 B |
After Width: | Height: | Size: 1.4 KiB |
BIN
share/server/games/mesetint/mods/default/textures/heart.png
Normal file
After Width: | Height: | Size: 308 B |
BIN
share/server/games/mesetint/mods/default/textures/player.png
Normal file
After Width: | Height: | Size: 212 B |
After Width: | Height: | Size: 201 B |
BIN
share/server/games/mesetint/mods/default/textures/skybox1.png
Normal file
After Width: | Height: | Size: 236 B |
After Width: | Height: | Size: 598 B |
After Width: | Height: | Size: 2.2 KiB |
BIN
share/server/games/mesetint/mods/default/textures/skybox2.png
Normal file
After Width: | Height: | Size: 231 B |
After Width: | Height: | Size: 199 B |
After Width: | Height: | Size: 2.5 KiB |
BIN
share/server/games/mesetint/mods/default/textures/skybox3.png
Normal file
After Width: | Height: | Size: 190 B |
After Width: | Height: | Size: 190 B |
After Width: | Height: | Size: 190 B |
BIN
share/server/games/mesetint/mods/default/textures/treeprop.png
Normal file
After Width: | Height: | Size: 1 KiB |