Infinite water
This commit is contained in:
parent
2404ab14f4
commit
9950c4c2f2
@ -153,6 +153,14 @@ minetest.register_craftitem("bucket:bucket_empty", {
|
||||
minetest.add_node(pointed_thing.under, {name="air"})
|
||||
|
||||
return ItemStack(giving_back)
|
||||
elseif node.name == "default:water_source_infinite" then
|
||||
if check_protection(pointed_thing.under,
|
||||
user:get_player_name(),
|
||||
"take ".. node.name) then
|
||||
return
|
||||
end
|
||||
minetest.add_node(pointed_thing.under, {name = "air"})
|
||||
return ItemStack("bucket:bucket_water")
|
||||
end
|
||||
end,
|
||||
})
|
||||
@ -178,8 +186,9 @@ minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "bucket:bucket_lava",
|
||||
burntime = 60,
|
||||
replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}},
|
||||
replacements = {
|
||||
{"bucket:bucket_lava", "bucket:bucket_empty"}
|
||||
}
|
||||
})
|
||||
|
||||
dofile(minetest.get_modpath("bucket") .. "/snowbucket.lua")
|
||||
|
||||
|
@ -176,7 +176,7 @@ minetest.register_abm({
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider)
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
@ -186,7 +186,28 @@ minetest.register_abm({
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
default.cool_lava_source(pos, node, active_object_count, active_object_count_wider)
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
-- Infinite water
|
||||
local function get_water(pos)
|
||||
local pos1 = {x = pos.x - 1, y = pos.y, z = pos.z - 1}
|
||||
local pos2 = {x = pos.x + 1, y = pos.y, z = pos.z + 1}
|
||||
local water = minetest.find_nodes_in_area(pos1, pos2, "default:water_source")
|
||||
if #water > 8 then
|
||||
minetest.set_node(pos, {name = "default:water_source_infinite"})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:water_source"},
|
||||
neighbors = {"default:water_source"},
|
||||
interval = 10,
|
||||
chance = 1,
|
||||
catch_up = false,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
get_water(pos)
|
||||
end
|
||||
})
|
||||
|
||||
-- Papyrus and cactus growing
|
||||
@ -198,22 +219,22 @@ minetest.register_abm({
|
||||
interval = 50,
|
||||
chance = 20,
|
||||
action = function(pos, node)
|
||||
pos.y = pos.y-1
|
||||
pos.y = pos.y - 1
|
||||
local name = minetest.get_node(pos).name
|
||||
if minetest.get_item_group(name, "sand") ~= 0 then
|
||||
pos.y = pos.y+1
|
||||
pos.y = pos.y + 1
|
||||
local height = 0
|
||||
while minetest.get_node(pos).name == "default:cactus" and height < 4 do
|
||||
height = height+1
|
||||
pos.y = pos.y+1
|
||||
height = height + 1
|
||||
pos.y = pos.y + 1
|
||||
end
|
||||
if height < 4 then
|
||||
if minetest.get_node(pos).name == "air" then
|
||||
minetest.set_node(pos, {name="default:cactus"})
|
||||
minetest.set_node(pos, {name = "default:cactus"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
|
@ -334,7 +334,12 @@ minetest.register_node("default:junglegrass", {
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = true,
|
||||
groups = {dig=default.dig.instant, flammable=2, flora=1, attached_node=1},
|
||||
groups = {
|
||||
dig = default.dig.instant,
|
||||
flammable = 2,
|
||||
flora = 1,
|
||||
attached_node = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
@ -350,7 +355,11 @@ minetest.register_node("default:leaves", {
|
||||
tiles = {"default_leaves.png"},
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
groups = {snappy=default.dig.leaves, leafdecay=3, flammable=2, leaves=1},
|
||||
groups = {
|
||||
snappy = default.dig.leaves,
|
||||
leafdecay = 3,
|
||||
flammable = 2,
|
||||
leaves = 1},
|
||||
drop = {
|
||||
max_items=1,
|
||||
items = {
|
||||
|
@ -500,7 +500,7 @@ stairs.register_shape("wood", "default:wood",
|
||||
default.node_sound_wood_defaults())
|
||||
|
||||
stairs.register_shape("junglewood", "default:junglewood",
|
||||
{choppy = default.dig.wood, flammable = 3, fuel =1},
|
||||
{choppy = default.dig.wood, flammable = 3, fuel = 1},
|
||||
{"default_junglewood.png"},
|
||||
"Junglewood Stair",
|
||||
"Junglewood Slab",
|
||||
|
Loading…
x
Reference in New Issue
Block a user