ChestShop-3/com/Acrobot/ChestShop/Shop/ShopManagement.java

28 lines
901 B
Java
Raw Normal View History

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) {
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-29 13:25:25 +02:00
public static boolean sell(Sign sign, Player player) {
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);
}
}