From b383ff89c6da63bfe35c64a765e4bfae2e782956 Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sat, 1 Jun 2013 14:50:39 +0200 Subject: [PATCH] Cleanup --- .../gates/listeners/PlayerMoveListener.java | 10 +---- src/de/craftinc/gates/util/SimpleChunk.java | 2 - .../craftinc/gates/util/TeleportRequest.java | 37 ------------------- 3 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 src/de/craftinc/gates/util/TeleportRequest.java diff --git a/src/de/craftinc/gates/listeners/PlayerMoveListener.java b/src/de/craftinc/gates/listeners/PlayerMoveListener.java index d01e12a..4e4e356 100644 --- a/src/de/craftinc/gates/listeners/PlayerMoveListener.java +++ b/src/de/craftinc/gates/listeners/PlayerMoveListener.java @@ -3,11 +3,8 @@ package de.craftinc.gates.listeners; import java.util.Calendar; import java.util.HashMap; -import de.craftinc.gates.util.TeleportRequest; import org.bukkit.ChatColor; -import org.bukkit.Chunk; import org.bukkit.Location; -import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -73,17 +70,14 @@ public class PlayerMoveListener implements Listener */ private void teleportPlayer(Player p, Gate g) { - Location playerLocation = p.getLocation(); - Location exit = g.getExit(); - - Float newYaw = g.getExit().getYaw() - g.getLocation().getYaw() + playerLocation.getYaw(); + Float newYaw = g.getExit().getYaw() - g.getLocation().getYaw() + p.getLocation().getYaw(); Location destLocation = new Location( g.getExit().getWorld(), g.getExit().getX(), g.getExit().getY(), g.getExit().getZ(), newYaw, - playerLocation.getPitch() + p.getLocation().getPitch() ); p.teleport(destLocation); diff --git a/src/de/craftinc/gates/util/SimpleChunk.java b/src/de/craftinc/gates/util/SimpleChunk.java index b20fb13..4e38547 100644 --- a/src/de/craftinc/gates/util/SimpleChunk.java +++ b/src/de/craftinc/gates/util/SimpleChunk.java @@ -1,8 +1,6 @@ package de.craftinc.gates.util; import org.bukkit.Chunk; -import org.bukkit.Location; -import org.bukkit.World; public class SimpleChunk { diff --git a/src/de/craftinc/gates/util/TeleportRequest.java b/src/de/craftinc/gates/util/TeleportRequest.java deleted file mode 100644 index abc3bc2..0000000 --- a/src/de/craftinc/gates/util/TeleportRequest.java +++ /dev/null @@ -1,37 +0,0 @@ -package de.craftinc.gates.util; - -import org.bukkit.Location; -import org.bukkit.entity.Player; - -public class TeleportRequest -{ - private Player player; - private Location destination; - - - public TeleportRequest(Player player, Location destination) - { - if (player == null) { - throw new IllegalArgumentException("Player must not be null!"); - } - - if (destination == null) { - throw new IllegalArgumentException("Destination must not be null"); - } - - this.player = player; - this.destination = destination; - } - - - public Player getPlayer() - { - return player; - } - - - public Location getDestination() - { - return destination; - } -}