Refactor mcl_item_entity
This commit is contained in:
parent
932e2dc6f8
commit
88fb03a0d8
|
@ -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 New Issue