diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index 71ead146..a07d96fd 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -269,6 +269,25 @@ function boat.on_step(self, dtime, moveresult) self.object:set_animation({x=0, y=40}, paddling_speed, 0, true) self._animation = 1 end + -- If boat is in a minecart, punch that cart. + -- + -- Why? In Minecraft you can put a boat in a + -- minecart and steer the cart from the boat, + -- which is quite useful to move mobs around. + -- (Minecarts have one seat, boats have two.) + -- + -- No, this is not a bug. Mojang has known it + -- for years and they never fixed that “bug”. + local parent = self.object:get_attach() + if parent then + local parent_name = + parent:get_luaentity().name + if parent_name == "mcl_minecarts:minecart" then + -- The driver must punch so + -- the steering works here. + parent:punch(self._driver, 1, {}) + end + end elseif ctrl.down then -- Backwards self._v = self._v - 0.1 * v_factor @@ -278,6 +297,7 @@ function boat.on_step(self, dtime, moveresult) self.object:set_animation({x=0, y=40}, -paddling_speed, 0, true) self._animation = -1 end + -- TODO: If boat is in a minecart, slow cart. else -- Stop paddling animation if no control pressed if self._animation ~= 0 then