Search in sources :

Example 1 with ContainerSeedStorageBase

use of com.infinityraider.agricraft.container.ContainerSeedStorageBase in project AgriCraft by AgriCraft.

the class MessageGuiSeedStorageClearSeed method processMessage.

@Override
protected void processMessage(MessageContext ctx) {
    final Container container = this.player.openContainer;
    if (container instanceof ContainerSeedStorageBase) {
        final ContainerSeedStorageBase storage = ((ContainerSeedStorageBase) container);
        final TileEntity tileEntity = storage.getTile();
        if (tileEntity instanceof ISeedStorageControllable) {
            ((ISeedStorageControllable) tileEntity).clearLockedSeed();
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) Container(net.minecraft.inventory.Container) ISeedStorageControllable(com.infinityraider.agricraft.tiles.storage.ISeedStorageControllable) ContainerSeedStorageBase(com.infinityraider.agricraft.container.ContainerSeedStorageBase)

Example 2 with ContainerSeedStorageBase

use of com.infinityraider.agricraft.container.ContainerSeedStorageBase in project AgriCraft by AgriCraft.

the class MessageContainerSeedStorage method processMessage.

@Override
protected void processMessage(MessageContext ctx) {
    if (player.openContainer instanceof ContainerSeedStorageBase) {
        ContainerSeedStorageBase storage = (ContainerSeedStorageBase) player.openContainer;
        storage.moveStackFromTileEntityToPlayer(slotId, new ItemStack(item, amount, meta));
    }
}
Also used : ContainerSeedStorageBase(com.infinityraider.agricraft.container.ContainerSeedStorageBase) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ContainerSeedStorageBase (com.infinityraider.agricraft.container.ContainerSeedStorageBase)2 ISeedStorageControllable (com.infinityraider.agricraft.tiles.storage.ISeedStorageControllable)1 Container (net.minecraft.inventory.Container)1 ItemStack (net.minecraft.item.ItemStack)1 TileEntity (net.minecraft.tileentity.TileEntity)1