Package extracells.handler

Source Code of extracells.handler.FluidCellHandler

package extracells.handler;

import net.minecraft.item.ItemStack;
import appeng.api.ICellHandler;
import appeng.api.me.util.IMEInventoryHandler;
import extracells.ItemEnum;
import extracells.items.ItemStorageFluid;

public class FluidCellHandler implements ICellHandler
{
  @Override
  public boolean isCell(ItemStack is)
  {
    return is != null ? is.getItem() == ItemEnum.STORAGEFLUID.getItemInstance() : false;
  }

  @Override
  public IMEInventoryHandler getCellHandler(ItemStack itemstack)
  {
    if (itemstack.getItem() == ItemEnum.STORAGEFLUID.getItemInstance())
    {
      ItemStorageFluid cell = (ItemStorageFluid) itemstack.getItem();
      return new FluidStorageInventoryHandler(itemstack, cell.getBytes(itemstack), cell.getTotalTypes(itemstack));
    }
    return null;
  }
}
TOP

Related Classes of extracells.handler.FluidCellHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.