summaryrefslogtreecommitdiff
path: root/src/main/java/jp/plusplus/fbs/container/ContainerShopAuthor.java
blob: b34c78a03f7b67f1d2fd63cae80eb447a1dc28ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package jp.plusplus.fbs.container;

import jp.plusplus.fbs.entity.EntityMagicAuthor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ContainerMerchant;
import net.minecraft.world.World;
import shift.mceconomy2.api.shop.IShop;
import shift.mceconomy2.gui.ContainerShop;

/**
 * Created by plusplus_F on 2016/02/24.
 */
public class ContainerShopAuthor extends ContainerShop {
    protected EntityMagicAuthor author;

    public ContainerShopAuthor(EntityPlayer entityPlayer, IShop par2IProductList, World par3World, EntityMagicAuthor author) {
        super(entityPlayer, par2IProductList, par3World);
        this.author=author;
    }

    @Override
    public void onContainerClosed(EntityPlayer player){
        if(author!=null){
            author.setCustomer(null);
        }
    }

    @Override
    public boolean canInteractWith(EntityPlayer entityplayer) {
        return author==null || author.getCustomer() == entityplayer;
    }
}