This commit is contained in:
Elias Fleckenstein 2021-01-28 19:02:44 +01:00
parent 4fe944445b
commit e66d66caf9
2 changed files with 11 additions and 2 deletions

View File

@ -134,7 +134,7 @@ function boat.on_death(self, killer)
self._driver = nil
end
function boat.on_step(self, dtime)
function boat.on_step(self, dtime, moveresult)
self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
local on_water = true
local in_water = false
@ -152,6 +152,15 @@ function boat.on_step(self, dtime)
v_slowdown = 0.05
end
if moveresult and moveresult.collides then
for _, collision in ipairs(moveresult.collisions) do
local pos = collision.node_pos
if collision.type == "node" and minetest.get_node_group(minetest.get_node(pos).name, "dig_by_boat") > 0 then
minetest.dig_node(pos)
end
end
end
if self._driver then
local ctrl = self._driver:get_player_control()
if ctrl.sneak then

View File

@ -390,7 +390,7 @@ minetest.register_node("mcl_flowers:waterlily", {
liquids_pointable = true,
walkable = true,
sunlight_propagates = true,
groups = {dig_immediate = 3, plant=1, dig_by_water = 1,destroy_by_lava_flow=1, dig_by_piston = 1, deco_block=1},
groups = {dig_immediate = 3, plant=1, dig_by_water = 1,destroy_by_lava_flow=1, dig_by_piston = 1, deco_block=1, dig_by_boat=1},
sounds = mcl_sounds.node_sound_leaves_defaults(),
node_placement_prediction = "",
node_box = {