From f569b999c405479b810809f5d51652827e37ec9f Mon Sep 17 00:00:00 2001 From: NSDeathman <104826306+NSDeathman@users.noreply.github.com> Date: Tue, 19 May 2026 16:04:00 +0400 Subject: [PATCH] TU31 feature: Activator Rails now dismount entities when powered --- Minecraft.World/Minecart.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Minecraft.World/Minecart.cpp b/Minecraft.World/Minecart.cpp index efefb7ea..369efa0d 100644 --- a/Minecraft.World/Minecart.cpp +++ b/Minecraft.World/Minecart.cpp @@ -377,6 +377,25 @@ void Minecart::tick() void Minecart::activateMinecart(int xt, int yt, int zt, bool state) { + if (!state) + return; + + if (level->isClientSide) + return; + + shared_ptr riderEntity = rider.lock(); + if (riderEntity) + { + riderEntity->ride(nullptr); + float yOffset = 0.5f; + float xOffset = 1.0f; + float zOffset = 0.0f; + riderEntity->absMoveTo(x + xOffset, y + yOffset, z + zOffset, riderEntity->xRot, riderEntity->yRot); + + setHurtDir(-getHurtDir()); + setHurtTime(10); + markHurt(); + } } void Minecart::comeOffTrack(double maxSpeed)