From 670c0979c96e208ceb183ca6fc2d06ee91a30415 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 22 Feb 2015 00:58:01 +1100 Subject: [PATCH] buy --- .../java/com/intellectualcrafters/plot/commands/Buy.java | 2 +- .../plot/listeners/InventoryListener.java | 3 --- .../java/com/intellectualcrafters/plot/util/EconHandler.java | 5 +++++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Buy.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Buy.java index 0191f73c9..3cf112d76 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Buy.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Buy.java @@ -102,7 +102,7 @@ public class Buy extends SubCommand { EconHandler.withdrawPlayer(plr, price); sendMessage(plr, C.REMOVED_BALANCE, price + ""); EconHandler.depositPlayer(UUIDHandler.uuidWrapper.getOfflinePlayer(plot.owner), initPrice); - final Player owner = UUIDHandler.uuidWrapper.getPlayer(plot.owner); + PlotPlayer owner = UUIDHandler.getPlayer(plot.owner); if (owner != null) { sendMessage(plr, C.PLOT_SOLD, plot.id + "", plr.getName(), initPrice + ""); } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/InventoryListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/InventoryListener.java index 8ec12926f..70649c1ae 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/InventoryListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/InventoryListener.java @@ -14,10 +14,8 @@ import com.intellectualcrafters.plot.util.bukkit.BukkitUtil; /** * Created 2014-11-18 for PlotSquared - * * @author Citymonstret */ -@SuppressWarnings("unused") public class InventoryListener implements Listener { @EventHandler public void onInventoryAction(final InventoryInteractEvent event) { @@ -31,7 +29,6 @@ public class InventoryListener implements Listener { final Inventory inventory = event.getInventory(); final Player player = (Player) event.getWhoClicked(); if (inventory.getHolder() instanceof InfoInventory) { - // TODO: Do stuff switch (event.getSlot()) { case 3: case 4: diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/EconHandler.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/EconHandler.java index 63cc1600e..38e581168 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/EconHandler.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/EconHandler.java @@ -1,6 +1,7 @@ package com.intellectualcrafters.plot.util; import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.object.OfflinePlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer; public class EconHandler { @@ -16,4 +17,8 @@ public class EconHandler { public static void depositPlayer(PlotPlayer player, double amount) { PlotSquared.economy.depositPlayer(player.getName(), amount); } + + public static void depositPlayer(OfflinePlotPlayer player, double amount) { + PlotSquared.economy.depositPlayer(player.getName(), amount); + } }