mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Refactor mcl_item_entity
This commit is contained in:
parent
932e2dc6f8
commit
88fb03a0d8
1 changed files with 2 additions and 4 deletions
|
@ -412,14 +412,12 @@ core.register_entity(":__builtin:item", {
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Move item around on flowing liquids
|
-- Move item around on flowing liquids
|
||||||
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].liquidtype == "flowing" then
|
if def and def.liquidtype == "flowing" then
|
||||||
|
|
||||||
local pos = self.object:getpos()
|
|
||||||
local node = minetest.get_node(pos)
|
|
||||||
--[[ Get flowing direction (function call from flowlib), if there's a liquid.
|
--[[ Get flowing direction (function call from flowlib), if there's a liquid.
|
||||||
NOTE: According to Qwertymine, flowlib.quickflow is only reliable for liquids with a flowing distance of 7.
|
NOTE: According to Qwertymine, flowlib.quickflow is only reliable for liquids with a flowing distance of 7.
|
||||||
Luckily, this is exactly what we need if we only care about water, which has this flowing distance. ]]
|
Luckily, this is exactly what we need if we only care about water, which has this flowing distance. ]]
|
||||||
local vec = flowlib.quick_flow(pos, node)
|
local vec = flowlib.quick_flow(p, node)
|
||||||
-- Just to make sure we don't manipulate the speed for no reason
|
-- Just to make sure we don't manipulate the speed for no reason
|
||||||
if vec.x ~= 0 or vec.y ~= 0 or vec.z ~= 0 then
|
if vec.x ~= 0 or vec.y ~= 0 or vec.z ~= 0 then
|
||||||
-- Minecraft Wiki: Flowing speed is "about 1.39 meters per second"
|
-- Minecraft Wiki: Flowing speed is "about 1.39 meters per second"
|
||||||
|
|
Loading…
Reference in a new issue