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
0
Merge Requests
0
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
a29943ae
Commit
a29943ae
authored
Aug 06, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix LookControls regression to target players eye line (and not feet)
parent
b0ec4a59
Pipeline
#12724
passed with stages
in 1 minute 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
LookControls.java
src/main/java/com/owlmaddie/controls/LookControls.java
+6
-1
No files found.
src/main/java/com/owlmaddie/controls/LookControls.java
View file @
a29943ae
...
...
@@ -12,7 +12,12 @@ import net.minecraft.util.math.Vec3d;
*/
public
class
LookControls
{
public
static
void
lookAtPlayer
(
ServerPlayerEntity
player
,
MobEntity
entity
)
{
lookAtPosition
(
player
.
getPos
(),
entity
);
// Get the player's eye line position
Vec3d
playerPos
=
player
.
getPos
();
float
eyeHeight
=
player
.
getEyeHeight
(
player
.
getPose
());
Vec3d
eyePos
=
new
Vec3d
(
playerPos
.
x
,
playerPos
.
y
+
eyeHeight
,
playerPos
.
z
);
lookAtPosition
(
eyePos
,
entity
);
}
public
static
void
lookAtPosition
(
Vec3d
targetPos
,
MobEntity
entity
)
{
...
...
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