mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-26 21:03:45 +01:00
Streamline use of vector ops.
* Use vector.offset instead of vector.add. * Define and use local alias for vector.offset.
parent
541a805a48
commit
19eb31f389
@ -44,6 +44,7 @@ local registered_nodes = minetest.registered_nodes
|
|||||||
local swap_node = minetest.swap_node
|
local swap_node = minetest.swap_node
|
||||||
local get_node_timer = minetest.get_node_timer
|
local get_node_timer = minetest.get_node_timer
|
||||||
local add_item = minetest.add_item
|
local add_item = minetest.add_item
|
||||||
|
local vector_offset = vector.offset
|
||||||
|
|
||||||
local function composter_add_item(pos, node, player, itemstack, pointed_thing)
|
local function composter_add_item(pos, node, player, itemstack, pointed_thing)
|
||||||
--
|
--
|
||||||
@ -69,7 +70,7 @@ local function composter_add_item(pos, node, player, itemstack, pointed_thing)
|
|||||||
-- get current compost level
|
-- get current compost level
|
||||||
local level = registered_nodes[node.name]["_mcl_compost_level"]
|
local level = registered_nodes[node.name]["_mcl_compost_level"]
|
||||||
-- spawn green particles above new layer
|
-- spawn green particles above new layer
|
||||||
mcl_dye.add_bone_meal_particle(vector.add(pos, vector.new(0, level/8, 0)))
|
mcl_dye.add_bone_meal_particle(vector_offset(pos, 0, level/8, 0))
|
||||||
-- TODO: play some sounds
|
-- TODO: play some sounds
|
||||||
-- update composter block
|
-- update composter block
|
||||||
if level < 7 then
|
if level < 7 then
|
||||||
|
Loading…
Reference in New Issue
Block a user