aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Boat.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-05 17:07:47 -0500
committerGitHub <noreply@github.com>2026-03-05 16:07:47 -0600
commiteed770b121aa4ce38f002db042d0137c24c6d344 (patch)
tree5c6886f7ec65a7828bc6e34a469514e418bcf78b /Minecraft.World/Boat.cpp
parenta0b2fe885d35bf653203fb02a8fc347de092bfc7 (diff)
Fixed boats falling and a TP glitch #266 (#615)
Diffstat (limited to 'Minecraft.World/Boat.cpp')
-rw-r--r--Minecraft.World/Boat.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/Minecraft.World/Boat.cpp b/Minecraft.World/Boat.cpp
index e39bd7f3..1811c209 100644
--- a/Minecraft.World/Boat.cpp
+++ b/Minecraft.World/Boat.cpp
@@ -87,7 +87,7 @@ Boat::Boat(Level *level, double x, double y, double z) : Entity( level )
double Boat::getRideHeight()
{
- return bbHeight * 0.0f - 0.3f;
+ return heightOffset;
}
bool Boat::hurt(DamageSource *source, float hurtDamage)
@@ -283,11 +283,11 @@ void Boat::tick()
// 4J Stu - Fix for #9579 - GAMEPLAY: Boats with a player in them slowly sink under the water over time, and with no player in them they float into the sky.
// Just make the boats bob up and down rather than any other client-side movement when not receiving packets from server
- if (waterPercentage < 1)
- {
- double bob = waterPercentage * 2 - 1;
- yd += 0.04f * bob;
- }
+ if (waterPercentage > 0)
+ {
+ double bob = waterPercentage * 2 - 1;
+ yd += 0.04f * bob;
+ }
else
{
if (yd < 0) yd /= 2;
@@ -307,15 +307,14 @@ void Boat::tick()
return;
}
- if (waterPercentage < 1)
+ if (waterPercentage > 0)
{
double bob = waterPercentage * 2 - 1;
yd += 0.04f * bob;
}
else
{
- if (yd < 0) yd /= 2;
- yd += 0.007f;
+ yd = 0;
}