From 81f3e6ef241a8b1a808a8f9c60a012012309b98f Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 22 Feb 2015 23:46:47 +1100 Subject: [PATCH] target --- .../java/com/intellectualcrafters/plot/commands/Target.java | 3 ++- .../com/intellectualcrafters/plot/object/BukkitPlayer.java | 6 ++++++ .../com/intellectualcrafters/plot/object/PlotPlayer.java | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Target.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Target.java index 3890c8555..b037251b4 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Target.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Target.java @@ -22,6 +22,7 @@ package com.intellectualcrafters.plot.commands; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; +import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.util.MainUtil; @@ -44,7 +45,7 @@ public class Target extends SubCommand { MainUtil.sendMessage(plr, C.NOT_VALID_PLOT_ID); return false; } - final Location loc = MainUtil.getPlotHome(loc.getWorld(), id); + final Location loc = MainUtil.getPlotHome(ploc.getWorld(), id); plr.setCompassTarget(loc); MainUtil.sendMessage(plr, C.COMPASS_TARGET); return true; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/BukkitPlayer.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/BukkitPlayer.java index 5c75a4ebf..02735f673 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/BukkitPlayer.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/BukkitPlayer.java @@ -95,5 +95,11 @@ public class BukkitPlayer implements PlotPlayer { public boolean isOnline() { return this.player.isOnline(); } + + @Override + public void setCompassTarget(Location loc) { + player.setCompassTarget(new org.bukkit.Location(BukkitUtil.getWorld(loc.getWorld()), loc.getX(), loc.getY(), loc.getZ())); + + } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotPlayer.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotPlayer.java index f5682afdf..f74f500f8 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotPlayer.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotPlayer.java @@ -23,4 +23,6 @@ public interface PlotPlayer { public boolean isOnline(); public String getName(); + + public void setCompassTarget(Location loc); }