Package logisticspipes.proxy.bs

Source Code of logisticspipes.proxy.bs.BetterStorageProxy

package logisticspipes.proxy.bs;

import logisticspipes.proxy.interfaces.IBetterStorageProxy;
import net.mcft.copy.betterstorage.api.crate.ICrateStorage;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;

public class BetterStorageProxy implements IBetterStorageProxy {

  @Override
  public boolean isBetterStorageCrate(TileEntity tile) {
    return tile instanceof ICrateStorage;
  }

  @Override
  public ICrateStorageProxy getCrateStorageProxy(TileEntity tile) {
    final ICrateStorage crate = (ICrateStorage) tile;
    return new ICrateStorageProxy() {
      @Override
      public Iterable<ItemStack> getContents() {
        return crate.getContents();
      }

      @Override
      public int getUniqueItems() {
        return crate.getUniqueItems();
      }

      @Override
      public int getItemCount(ItemStack stack) {
        return crate.getItemCount(stack);
      }

      @Override
      public ItemStack extractItems(ItemStack stack, int count) {
        return crate.extractItems(stack, count);
      }

      @Override
      public int getSpaceForItem(ItemStack stack) {
        return crate.getSpaceForItem(stack);
      }

      @Override
      public ItemStack insertItems(ItemStack stack) {
        return crate.insertItems(stack);
      }
    };
  }
}
TOP

Related Classes of logisticspipes.proxy.bs.BetterStorageProxy

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.