Skip to content

Commit

Permalink
Revert "Fix 40b7c8c"
Browse files Browse the repository at this point in the history
This reverts commit 640b11b.
  • Loading branch information
OliverSchlueter committed Aug 2, 2024
1 parent 640b11b commit 2c2b2e3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.google.common.primitives.Doubles;
import de.oliver.fancyholograms.FancyHolograms;
import de.oliver.fancyholograms.api.events.HologramUpdateEvent;
import de.oliver.fancyholograms.api.hologram.Hologram;
import de.oliver.fancyholograms.api.events.HologramUpdateEvent;
import de.oliver.fancyholograms.commands.HologramCMD;
import de.oliver.fancyholograms.commands.Subcommand;
import de.oliver.fancyholograms.util.Constants;
Expand All @@ -20,14 +20,14 @@

public class MoveHereCMD implements Subcommand {

public static boolean setLocation(CommandSender sender, Hologram hologram, Location location, boolean applyRotation) {
public static boolean setLocation(Player player, Hologram hologram, Location location, boolean applyRotation) {
final var copied = hologram.getData().copy(hologram.getName());
final Location newLocation = (applyRotation)
? location
: new Location(location.getWorld(), location.x(), location.y(), location.z(), copied.getLocation().getYaw(), copied.getLocation().getPitch());
copied.setLocation(newLocation);

if (!HologramCMD.callModificationEvent(hologram, sender, copied, HologramUpdateEvent.HologramModification.POSITION)) {
if (!HologramCMD.callModificationEvent(hologram, player, copied, HologramUpdateEvent.HologramModification.POSITION)) {
return false;
}

Expand All @@ -37,7 +37,7 @@ public static boolean setLocation(CommandSender sender, Hologram hologram, Locat
FancyHolograms.get().getHologramStorage().save(hologram);
}

MessageHelper.success(sender, "Moved the hologram to %s/%s/%s %s\u00B0 %s\u00B0".formatted(
MessageHelper.success(player, "Moved the hologram to %s/%s/%s %s\u00B0 %s\u00B0".formatted(
Constants.COORDINATES_DECIMAL_FORMAT.format(newLocation.x()),
Constants.COORDINATES_DECIMAL_FORMAT.format(newLocation.y()),
Constants.COORDINATES_DECIMAL_FORMAT.format(newLocation.z()),
Expand Down

0 comments on commit 2c2b2e3

Please sign in to comment.