diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-06-08 21:43:42 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-06-08 21:43:42 +0100 |
commit | 98e427e831c43a619a57aacc034535c4d5d09213 (patch) | |
tree | ecef8d01df56de718ac8ce37f823c3ab66bf6e47 | |
parent | ac6b74887fbe88d8b1eab0b4aee5f80dca9edf35 (diff) | |
download | Essentials-98e427e831c43a619a57aacc034535c4d5d09213.tar Essentials-98e427e831c43a619a57aacc034535c4d5d09213.tar.gz Essentials-98e427e831c43a619a57aacc034535c4d5d09213.tar.lz Essentials-98e427e831c43a619a57aacc034535c4d5d09213.tar.xz Essentials-98e427e831c43a619a57aacc034535c4d5d09213.zip |
Cleanup ITarget
-rw-r--r-- | Essentials/src/com/earth2me/essentials/LocationTarget.java | 10 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/PlayerTarget.java | 8 |
2 files changed, 2 insertions, 16 deletions
diff --git a/Essentials/src/com/earth2me/essentials/LocationTarget.java b/Essentials/src/com/earth2me/essentials/LocationTarget.java index 58e19fe42..1641373af 100644 --- a/Essentials/src/com/earth2me/essentials/LocationTarget.java +++ b/Essentials/src/com/earth2me/essentials/LocationTarget.java @@ -1,28 +1,20 @@ package com.earth2me.essentials; import org.bukkit.Location; -import org.bukkit.Server; public class LocationTarget implements ITarget { private final Location location; - private final String name; LocationTarget(Location location) { this.location = location; - this.name = null; } @Override - public Location getLocation(Server server) + public Location getLocation() { - if (this.name != null) - { - - return server.getPlayerExact(name).getLocation(); - } return location; } }
\ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/PlayerTarget.java b/Essentials/src/com/earth2me/essentials/PlayerTarget.java index 31aac25bd..867f832d9 100644 --- a/Essentials/src/com/earth2me/essentials/PlayerTarget.java +++ b/Essentials/src/com/earth2me/essentials/PlayerTarget.java @@ -7,22 +7,16 @@ import org.bukkit.entity.Player; public class PlayerTarget implements ITarget { - private final Location location; private final String name; PlayerTarget(Player entity) { this.name = entity.getName(); - this.location = null; } @Override public Location getLocation() { - if (this.name != null) - { - return Bukkit.getServer().getPlayerExact(name).getLocation(); - } - return location; + return Bukkit.getServer().getPlayerExact(name).getLocation(); } }
\ No newline at end of file |