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
755d651b
Commit
755d651b
authored
6 months ago
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lowering LEAD particles right above ground, reducing # of lead particles
parent
31d7d589
Pipeline
#12879
passed with stages
in 1 minute 58 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
LeadPlayerGoal.java
src/main/java/com/owlmaddie/goals/LeadPlayerGoal.java
+2
-5
No files found.
src/main/java/com/owlmaddie/goals/LeadPlayerGoal.java
View file @
755d651b
...
...
@@ -143,7 +143,7 @@ public class LeadPlayerGoal extends PlayerBaseGoal {
// Pass the angle using the "speed" argument, with deltaX, deltaY, deltaZ set to 0
LeadParticleEffect
effect
=
new
LeadParticleEffect
(
angle
);
serverWorld
.
spawnParticles
(
effect
,
position
.
x
,
position
.
y
+
0.
3
,
position
.
z
,
1
,
0
,
0
,
0
,
0
);
serverWorld
.
spawnParticles
(
effect
,
position
.
x
,
position
.
y
+
0.
05
,
position
.
z
,
1
,
0
,
0
,
0
,
0
);
}
}
...
...
@@ -158,20 +158,17 @@ public class LeadPlayerGoal extends PlayerBaseGoal {
double
angleDegrees
=
Math
.
toDegrees
(
angleRadians
);
// Convert the calculated angle to Minecraft's yaw system:
// Shift by 90 degrees, and invert to match Minecraft's clockwise yaw system
double
minecraftYaw
=
(
360
-
(
angleDegrees
+
90
))
%
360
;
// Correct the 180-degree flip
minecraftYaw
=
(
minecraftYaw
+
180
)
%
360
;
// Ensure the yaw is positive
if
(
minecraftYaw
<
0
)
{
minecraftYaw
+=
360
;
}
// Emit particles along the ray using the corrected angle in radians
double
distance
=
start
.
distanceTo
(
end
);
for
(
double
d
=
0
;
d
<=
distance
;
d
+=
4
)
{
for
(
double
d
=
0
;
d
<=
distance
;
d
+=
5
)
{
Vec3d
pos
=
start
.
add
(
direction
.
normalize
().
multiply
(
d
));
emitParticleAt
(
pos
,
Math
.
toRadians
(
minecraftYaw
));
// Convert back to radians for rendering
}
...
...
This diff is collapsed.
Click to expand it.
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