2011-05-21 19:55:55 +02:00
|
|
|
package com.Acrobot.ChestShop.Shop;
|
|
|
|
|
|
|
|
import com.Acrobot.ChestShop.Chests.MinecraftChest;
|
|
|
|
import com.Acrobot.ChestShop.Items.Items;
|
|
|
|
import com.Acrobot.ChestShop.Utils.SearchForBlock;
|
|
|
|
import org.bukkit.block.Chest;
|
|
|
|
import org.bukkit.block.Sign;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Acrobot
|
|
|
|
*/
|
|
|
|
public class ShopManagement {
|
2011-05-29 13:25:25 +02:00
|
|
|
public static boolean buy(Sign sign, Player player) {
|
2011-05-21 19:55:55 +02:00
|
|
|
Chest chestMc = SearchForBlock.findChest(sign);
|
|
|
|
Shop shop = new Shop(chestMc != null ? new MinecraftChest(chestMc) : null, sign, Items.getItemStack(sign.getLine(3)));
|
|
|
|
|
2011-05-29 13:25:25 +02:00
|
|
|
return shop.buy(player);
|
2011-05-21 19:55:55 +02:00
|
|
|
}
|
|
|
|
|
2011-05-29 13:25:25 +02:00
|
|
|
public static boolean sell(Sign sign, Player player) {
|
2011-05-21 19:55:55 +02:00
|
|
|
Chest chestMc = SearchForBlock.findChest(sign);
|
|
|
|
Shop shop = new Shop(chestMc != null ? new MinecraftChest(chestMc) : null, sign, Items.getItemStack(sign.getLine(3)));
|
|
|
|
|
2011-05-29 13:25:25 +02:00
|
|
|
return shop.sell(player);
|
2011-05-21 19:55:55 +02:00
|
|
|
}
|
|
|
|
}
|