13
0

Sound on portal
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2022-03-22 21:37:45 +01:00
Ursprung 62634f1793
Commit 9db373c0f3

Datei anzeigen

@ -23,6 +23,7 @@ import de.steamwar.lobby.LobbySystem;
import de.steamwar.lobby.command.ModifyCommand; import de.steamwar.lobby.command.ModifyCommand;
import de.steamwar.lobby.listener.Portals; import de.steamwar.lobby.listener.Portals;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@ -80,6 +81,7 @@ public class TeleportPortal implements PortalHandler {
if (target.getDepth() != 0.0) { if (target.getDepth() != 0.0) {
normalized.setX(1 - portal.normalize(from).getX()); normalized.setX(1 - portal.normalize(from).getX());
} }
player.playSound(player.getLocation(), Sound.BLOCK_PORTAL_TRAVEL, 1.0f, 1.0f);
player.teleport(target.denormalize(normalized).toLocation(to.getWorld(), (float) (to.getYaw() - Math.toDegrees(target.getYrotation() - portal.getYrotation())), to.getPitch()), PlayerTeleportEvent.TeleportCause.PLUGIN); player.teleport(target.denormalize(normalized).toLocation(to.getWorld(), (float) (to.getYaw() - Math.toDegrees(target.getYrotation() - portal.getYrotation())), to.getPitch()), PlayerTeleportEvent.TeleportCause.PLUGIN);
} }