mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 23:26:45 +01:00
buy
This commit is contained in:
parent
7bd99afa25
commit
670c0979c9
@ -102,7 +102,7 @@ public class Buy extends SubCommand {
|
|||||||
EconHandler.withdrawPlayer(plr, price);
|
EconHandler.withdrawPlayer(plr, price);
|
||||||
sendMessage(plr, C.REMOVED_BALANCE, price + "");
|
sendMessage(plr, C.REMOVED_BALANCE, price + "");
|
||||||
EconHandler.depositPlayer(UUIDHandler.uuidWrapper.getOfflinePlayer(plot.owner), initPrice);
|
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) {
|
if (owner != null) {
|
||||||
sendMessage(plr, C.PLOT_SOLD, plot.id + "", plr.getName(), initPrice + "");
|
sendMessage(plr, C.PLOT_SOLD, plot.id + "", plr.getName(), initPrice + "");
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,8 @@ import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Created 2014-11-18 for PlotSquared
|
* Created 2014-11-18 for PlotSquared
|
||||||
*
|
|
||||||
* @author Citymonstret
|
* @author Citymonstret
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public class InventoryListener implements Listener {
|
public class InventoryListener implements Listener {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInventoryAction(final InventoryInteractEvent event) {
|
public void onInventoryAction(final InventoryInteractEvent event) {
|
||||||
@ -31,7 +29,6 @@ public class InventoryListener implements Listener {
|
|||||||
final Inventory inventory = event.getInventory();
|
final Inventory inventory = event.getInventory();
|
||||||
final Player player = (Player) event.getWhoClicked();
|
final Player player = (Player) event.getWhoClicked();
|
||||||
if (inventory.getHolder() instanceof InfoInventory) {
|
if (inventory.getHolder() instanceof InfoInventory) {
|
||||||
// TODO: Do stuff
|
|
||||||
switch (event.getSlot()) {
|
switch (event.getSlot()) {
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.intellectualcrafters.plot.util;
|
package com.intellectualcrafters.plot.util;
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.PlotSquared;
|
import com.intellectualcrafters.plot.PlotSquared;
|
||||||
|
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
|
|
||||||
public class EconHandler {
|
public class EconHandler {
|
||||||
@ -16,4 +17,8 @@ public class EconHandler {
|
|||||||
public static void depositPlayer(PlotPlayer player, double amount) {
|
public static void depositPlayer(PlotPlayer player, double amount) {
|
||||||
PlotSquared.economy.depositPlayer(player.getName(), amount);
|
PlotSquared.economy.depositPlayer(player.getName(), amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void depositPlayer(OfflinePlotPlayer player, double amount) {
|
||||||
|
PlotSquared.economy.depositPlayer(player.getName(), amount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user