cleanup tabs
This commit is contained in:
parent
87d4ed7c98
commit
f8dcbb5c3e
@ -6,7 +6,6 @@
|
|||||||
--Random
|
--Random
|
||||||
math.randomseed(3)
|
math.randomseed(3)
|
||||||
|
|
||||||
|
|
||||||
--Drop entity
|
--Drop entity
|
||||||
minetest.register_entity("drippingwater:drop", {
|
minetest.register_entity("drippingwater:drop", {
|
||||||
hp_max = 2000,
|
hp_max = 2000,
|
||||||
@ -23,53 +22,47 @@ minetest.register_entity("drippingwater:drop", {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
local k = math.random(1,222)
|
local k = math.random(1,222)
|
||||||
local ownpos = self.object:getpos()
|
local ownpos = self.object:getpos()
|
||||||
|
|
||||||
if k==1 then
|
if k==1 then
|
||||||
self.object:setacceleration({x=0, y=-5, z=0})
|
self.object:setacceleration({x=0, y=-5, z=0})
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.env:get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
|
||||||
self.object:setacceleration({x=0, y=-5, z=0})
|
|
||||||
end
|
|
||||||
|
|
||||||
|
if minetest.env:get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
||||||
|
self.object:setacceleration({x=0, y=-5, z=0})
|
||||||
|
end
|
||||||
|
|
||||||
if minetest.env:get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
|
if minetest.env:get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8})
|
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8})
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
--Create drop
|
--Create drop
|
||||||
minetest.register_abm(
|
minetest.register_abm(
|
||||||
{nodenames = {"group:crumbly"},
|
{nodenames = {"group:crumbly"},
|
||||||
neighbors = {"group:water"},
|
neighbors = {"group:water"},
|
||||||
interval = 2,
|
interval = 2,
|
||||||
chance = 22,
|
chance = 22,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
if minetest.env:get_node({x=pos.x, y=pos.y -1, z=pos.z}).name == "air" and
|
if minetest.env:get_node({x=pos.x, y=pos.y -1, z=pos.z}).name == "air" and minetest.env:get_node({x=pos.x, y=pos.y -2, z=pos.z}).name == "air" then
|
||||||
minetest.env:get_node({x=pos.x, y=pos.y -2, z=pos.z}).name == "air" then
|
local i = math.random(-5,5) / 10
|
||||||
local i = math.random(-5,5) / 10
|
minetest.env:add_entity({x=pos.x + i, y=pos.y - 0.5, z=pos.z + i}, "drippingwater:drop")
|
||||||
minetest.env:add_entity({x=pos.x + i, y=pos.y - 0.5, z=pos.z + i}, "drippingwater:drop")
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
--Cloudstone
|
--Cloudstone
|
||||||
|
|
||||||
minetest.register_abm(
|
minetest.register_abm(
|
||||||
{nodenames = {"default:cloud"},
|
{nodenames = {"default:cloud"},
|
||||||
interval = 0,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
if minetest.env:get_node({x=pos.x, y=pos.y -1, z=pos.z}).name == "air" and
|
if minetest.env:get_node({x=pos.x, y=pos.y -1, z=pos.z}).name == "air" and minetest.env:get_node({x=pos.x, y=pos.y -2, z=pos.z}).name == "air" then
|
||||||
minetest.env:get_node({x=pos.x, y=pos.y -2, z=pos.z}).name == "air" then
|
local i = math.random(-5,5) / 10
|
||||||
local i = math.random(-5,5) / 10
|
minetest.env:add_entity({x=pos.x + i, y=pos.y - 0.5, z=pos.z + i}, "drippingwater:drop")
|
||||||
minetest.env:add_entity({x=pos.x + i, y=pos.y - 0.5, z=pos.z + i}, "drippingwater:drop")
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user