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