}
if (distance == 1 && entity instanceof EntityMinecartChest) {
EntityMinecartChest cart = (EntityMinecartChest) entity;
if (!cart.isDead) {
ITransactor trans = Transactor.getTransactorFor(cart);
ForgeDirection openOrientation = getOpenOrientation();
ItemStack stack = trans.remove(StackFilter.ALL, openOrientation, false);
if (stack != null && battery.useEnergy(10, 10, false) > 0) {
trans.remove(StackFilter.ALL, openOrientation, true);
EntityItem entityitem = new EntityItem(container.getWorldObj(), cart.posX, cart.posY + 0.3F, cart.posZ, stack);
entityitem.delayBeforeCanPickup = 10;
container.getWorldObj().spawnEntityInWorld(entityitem);
pullItemIntoPipe(entityitem, 1);