17 Create vines method

This commit is contained in:
Juraj Vajda 2024-01-29 13:08:45 -05:00
parent 64b23c1c0d
commit d31bd0767b
12 changed files with 257 additions and 2870 deletions

View File

@ -793,7 +793,8 @@ GNU Lesser General Public License v2.1 or later
- everness_illumi_root.png - everness_illumi_root.png
- everness_ivis_moss.png - everness_ivis_moss.png
- everness_ivis_vine_end.png - everness_ivis_vine_end.png
- everness_ivis_vine.png - everness_ivis_vine_1.png
- everness_ivis_vine_2.png
- everness_lootchest_marker_side.png - everness_lootchest_marker_side.png
- everness_lootchest_marker_top.png - everness_lootchest_marker_top.png
- everness_lotus_flower_mesh_not_animated.png - everness_lotus_flower_mesh_not_animated.png
@ -814,6 +815,7 @@ GNU Lesser General Public License v2.1 or later
- everness_lotus_leaf_y.png - everness_lotus_leaf_y.png
- everness_lumabus_bulb_purple.png - everness_lumabus_bulb_purple.png
- everness_lumabus_leaves.png - everness_lumabus_leaves.png
- everness_lumabus_vine_end.png
- everness_lumabus_vine_1.png - everness_lumabus_vine_1.png
- everness_lumabus_vine_2.png - everness_lumabus_vine_2.png
- everness_lumecorn_item.png - everness_lumecorn_item.png
@ -945,8 +947,8 @@ GNU Lesser General Public License v2.1 or later
- everness_venus_trap_item.png - everness_venus_trap_item.png
- everness_venus_trap_mesh.png - everness_venus_trap_mesh.png
- everness_vine_cave_end.png - everness_vine_cave_end.png
- everness_vine_cave_with_mese_leaves.png - everness_vine_cave_1.png
- everness_vine_cave.png - everness_vine_cave_2.png
- everness_vine_shears.png - everness_vine_shears.png
- everness_volcanic_rock_with_magma_animated.png - everness_volcanic_rock_with_magma_animated.png
- everness_volcanic_rock.png - everness_volcanic_rock.png
@ -961,7 +963,8 @@ GNU Lesser General Public License v2.1 or later
- everness_willow_tree_side.png - everness_willow_tree_side.png
- everness_willow_tree_top.png - everness_willow_tree_top.png
- everness_willow_vine_end.png - everness_willow_vine_end.png
- everness_willow_vine.png - everness_willow_vine_1.png
- everness_willow_vine_2.png
- everness_willow_wood.png -- Derived from texture by BlockMen (CC BY-SA 3.0) - everness_willow_wood.png -- Derived from texture by BlockMen (CC BY-SA 3.0)
- everness_xpanes_edge_pyrite.png - everness_xpanes_edge_pyrite.png
- everness_water_geyser_particle.png - everness_water_geyser_particle.png

21
api.lua
View File

@ -310,6 +310,8 @@ function Everness.tick_sulfur_stone_again(self, pos)
minetest.get_node_timer(pos):start(math.random(40, 80)) minetest.get_node_timer(pos):start(math.random(40, 80))
end end
-- Grows vines
-- @param pos {vector}
function Everness.grow_vine(self, pos, elapsed, params) function Everness.grow_vine(self, pos, elapsed, params)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local pos_under = vector.new(pos.x, pos.y - 1, pos.z) local pos_under = vector.new(pos.x, pos.y - 1, pos.z)
@ -350,30 +352,13 @@ function Everness.grow_vine(self, pos, elapsed, params)
local new_node_name = node_names[math.random(1, #node_names)] local new_node_name = node_names[math.random(1, #node_names)]
minetest.set_node(pos, { name = new_node_name, param2 = node.param2 }) minetest.set_node(pos, { name = new_node_name, param2 = new_node_name.param2 or 0 })
-- last hanging vine -- last hanging vine
minetest.set_node(pos_under, { name = end_node_name, param2 = end_node_param2 and end_node_param2 or node.param2 }) minetest.set_node(pos_under, { name = end_node_name, param2 = end_node_param2 and end_node_param2 or node.param2 })
Everness:tick_vine(pos_under) Everness:tick_vine(pos_under)
end end
function Everness.dig_vine(self, pos, node_name, digger)
--only dig give the vine if shears are used
if not digger then
return
end
local wielded_item = digger:get_wielded_item()
if 'everness:vine_shears' == wielded_item:get_name() then
local inv = digger:get_inventory()
if inv then
inv:add_item('main', ItemStack(node_name))
end
end
end
-- --
-- Sounds -- Sounds
-- --

View File

@ -11076,8 +11076,6 @@ Everness:register_node('everness:lumabus_vine_lantern', {
}, },
use_texture_alpha = 'clip', use_texture_alpha = 'clip',
paramtype = 'light', paramtype = 'light',
-- wield_image = 'everness_lumabus_vine_end_bottom.png',
-- inventory_image = 'everness_lumabus_vine_end_bottom.png',
groups = { groups = {
-- MTG -- MTG
cracky = 3, cracky = 3,
@ -11107,8 +11105,6 @@ Everness:register_node('everness:eye_vine_lantern', {
'everness_eye_vine_end_bottom.png', 'everness_eye_vine_end_bottom.png',
'everness_eye_vine_end_side.png', 'everness_eye_vine_end_side.png',
}, },
wield_image = 'everness_eye_vine_end_bottom.png',
inventory_image = 'everness_eye_vine_end_bottom.png',
drawtype = 'normal', drawtype = 'normal',
groups = { groups = {
-- MTG -- MTG

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

View File

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

View File

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 250 B

View File

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 266 B

View File

Before

Width:  |  Height:  |  Size: 177 B

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

View File

@ -30,6 +30,10 @@ Everness:register_tool('everness:vine_shears', {
wool = { times = { [3] = 0.2 }, uses = 30, maxlevel = 3 } wool = { times = { [3] = 0.2 }, uses = 30, maxlevel = 3 }
} }
}, },
groups = {
-- Everness
vine_shears = 1
},
-- MCL -- MCL
_mcl_toollike_wield = true, _mcl_toollike_wield = true,
_mcl_diggroups = { _mcl_diggroups = {
@ -203,7 +207,6 @@ Everness:register_tool('everness:shovel_silk', {
local old_handle_node_drops = minetest.handle_node_drops local old_handle_node_drops = minetest.handle_node_drops
---@diagnostic disable-next-line: duplicate-set-field
function minetest.handle_node_drops(pos, drops, digger) function minetest.handle_node_drops(pos, drops, digger)
if not digger if not digger
or not digger:is_player() or not digger:is_player()

3018
vines.lua

File diff suppressed because it is too large Load Diff