Copy the yaw/pitch of the player when creating fixed effects

This commit is contained in:
Esophose 2022-02-21 01:38:30 -07:00
parent cc528e91d6
commit 46fc435a96
No known key found for this signature in database
GPG key ID: DE0E013CAE5C630A
9 changed files with 75 additions and 19 deletions

View file

@ -151,6 +151,9 @@ public class FixedCommandModule implements CommandModule {
}
if (player != null) {
location.setYaw(player.getLocation().getYaw());
location.setPitch(player.getLocation().getPitch());
double distanceFromEffect = player.getLocation().distance(location);
int maxCreationDistance = permissionManager.getMaxFixedEffectCreationDistance();
if (maxCreationDistance != 0 && distanceFromEffect > maxCreationDistance) {
@ -292,6 +295,9 @@ public class FixedCommandModule implements CommandModule {
}
if (player != null) {
location.setYaw(player.getLocation().getYaw());
location.setPitch(player.getLocation().getPitch());
double distanceFromEffect = player.getLocation().distance(location);
int maxCreationDistance = permissionManager.getMaxFixedEffectCreationDistance();
if (maxCreationDistance != 0 && distanceFromEffect > maxCreationDistance) {
@ -300,7 +306,7 @@ public class FixedCommandModule implements CommandModule {
}
}
fixedEffect.setCoordinates(location.getX(), location.getY(), location.getZ());
fixedEffect.setCoordinates(location);
break;
case "effect": {
ParticleEffect effect = inputParser.next(ParticleEffect.class);