From 815d55b4ed40c12d5c4d773b6eceb86abbab3a62 Mon Sep 17 00:00:00 2001 From: Oak Date: Thu, 16 May 2024 14:24:08 +0100 Subject: [PATCH] Made copy subcommand maintain yaw and pitch of original hologram --- .../oliver/fancyholograms/commands/hologram/CopyCMD.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/oliver/fancyholograms/commands/hologram/CopyCMD.java b/src/main/java/de/oliver/fancyholograms/commands/hologram/CopyCMD.java index 7da48a86..9bf43e4a 100644 --- a/src/main/java/de/oliver/fancyholograms/commands/hologram/CopyCMD.java +++ b/src/main/java/de/oliver/fancyholograms/commands/hologram/CopyCMD.java @@ -7,6 +7,7 @@ import de.oliver.fancyholograms.commands.Subcommand; import de.oliver.fancylib.MessageHelper; import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; @@ -46,7 +47,11 @@ public boolean run(@NotNull CommandSender sender, @Nullable Hologram hologram, @ } final var data = new HologramData(name, hologram.getData()); - data.getDisplayData().setLocation(player.getLocation()); + Location originalLocation = data.getDisplayData().getLocation(); + Location location = player.getLocation(); + location.setPitch(originalLocation.getPitch()); + location.setYaw(originalLocation.getYaw()); + data.getDisplayData().setLocation(location); final var copy = FancyHolograms.get().getHologramsManager().create(data);