Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
7a3463f5
Commit
7a3463f5
authored
Nov 06, 2023
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Smooth out sneak motion, so text bubble does not jump
parent
eeec9218
Pipeline
#11650
passed with stage
in 19 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
ClientInit.java
src/client/java/com/owlmaddie/ClientInit.java
+5
-0
No files found.
src/client/java/com/owlmaddie/ClientInit.java
View file @
7a3463f5
...
@@ -150,9 +150,14 @@ public class ClientInit implements ClientModInitializer {
...
@@ -150,9 +150,14 @@ public class ClientInit implements ClientModInitializer {
// Get camera position
// Get camera position
Vec3d
interpolatedCameraPos
;
Vec3d
interpolatedCameraPos
;
double
cameraHeight
=
0
D
;
double
cameraHeight
=
0
D
;
double
sneakHeight
=
0.3
D
;
if
(
MinecraftClient
.
getInstance
().
options
.
getPerspective
().
isFirstPerson
())
{
if
(
MinecraftClient
.
getInstance
().
options
.
getPerspective
().
isFirstPerson
())
{
// 1st person, Use the cameraEntity (interpolate for smooth motion)
// 1st person, Use the cameraEntity (interpolate for smooth motion)
if
(
cameraEntity
.
isSneaking
())
{
cameraHeight
=
cameraEntity
.
getHeight
()
+
sneakHeight
;
}
else
{
cameraHeight
=
cameraEntity
.
getHeight
();
cameraHeight
=
cameraEntity
.
getHeight
();
}
interpolatedCameraPos
=
new
Vec3d
(
interpolatedCameraPos
=
new
Vec3d
(
MathHelper
.
lerp
(
partialTicks
,
cameraEntity
.
prevX
,
cameraEntity
.
getPos
().
x
),
MathHelper
.
lerp
(
partialTicks
,
cameraEntity
.
prevX
,
cameraEntity
.
getPos
().
x
),
MathHelper
.
lerp
(
partialTicks
,
cameraEntity
.
prevY
,
cameraEntity
.
getPos
().
y
),
MathHelper
.
lerp
(
partialTicks
,
cameraEntity
.
prevY
,
cameraEntity
.
getPos
().
y
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment