Advertisement
jadenquinn

IItemCart.java

Sep 28th, 2018
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.38 KB | None | 0 0
  1. /*******************************************************************************
  2.  * Copyright 2011-2016 CovertJaguar
  3.  *
  4.  * This work (the API) is licensed under the "MIT" License, see LICENSE.md for details.
  5.  ******************************************************************************/
  6. package mods.railcraft.api.carts;
  7.  
  8. import net.minecraft.entity.item.EntityMinecart;
  9. import net.minecraft.item.ItemStack;
  10.  
  11. /**
  12.  * This class replaces IItemTransfer for controlling how items move through a train.
  13.  * It is entirely optional to implement this class, default values will be determined based on several factors.
  14.  * <p/>
  15.  * Created by CovertJaguar on 5/9/2015.
  16.  *
  17.  * @see mods.railcraft.api.carts.ITrainTransferHelper
  18.  */
  19. public interface IItemCart {
  20.     /**
  21.      * This function controls whether a cart can pass push or pull requests.
  22.      * This function is only called if the cart cannot fulfill the request itself.
  23.      * <p/>
  24.      * If this interface is not implemented, a default value will be inferred based on the size of the inventory of the Minecart.
  25.      * Anything with eight or more slots will be assumed to allow passage.
  26.      *
  27.      * @return true if can pass push and pull requests
  28.      */
  29.     boolean canPassItemRequests();
  30.  
  31.     /**
  32.      * This function controls whether a cart will accept a pushed Item.
  33.      * Even if this function returns true, there still must be a slot that accepts the item in question before it can be added to the cart.
  34.      * <p/>
  35.      * If this interface is not implemented, it is assumed to be true.
  36.      *
  37.      * @param requester the EntityMinecart that initiated the action
  38.      * @param stack     the ItemStack
  39.      * @return true if the cart can accept the item
  40.      */
  41.     boolean canAcceptPushedItem(EntityMinecart requester, ItemStack stack);
  42.  
  43.     /**
  44.      * This function controls whether a cart will fulfill a pull request for a specific item.
  45.      * Even if this function returns true, there still must be a slot that can extract the item in question before it can be removed from the cart.
  46.      * <p/>
  47.      * If this interface is not implemented, it is assumed to be true.
  48.      *
  49.      * @param requester the EntityMinecart that initiated the action
  50.      * @param stack     the ItemStack
  51.      * @return true if the cart can provide the item
  52.      */
  53.     boolean canProvidePulledItem(EntityMinecart requester, ItemStack stack);
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement