Advertisement
jadenquinn

IFluidCart.java

Sep 28th, 2018
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.60 KB | None | 0 0
  1. /*
  2.  * ******************************************************************************
  3.  *  Copyright 2011-2015 CovertJaguar
  4.  *
  5.  *  This work (the API) is licensed under the "MIT" License,
  6.  *  see LICENSE.md for details.
  7.  * ******************************************************************************
  8.  */
  9. package mods.railcraft.api.carts;
  10.  
  11. import net.minecraft.entity.item.EntityMinecart;
  12. import net.minecraftforge.fluids.Fluid;
  13.  
  14. /**
  15.  * Replaces ILiquidTransfer with a simpler interface for moving Fluids between Minecarts.
  16.  * <p/>
  17.  * Created by CovertJaguar on 5/9/2015.
  18.  *
  19.  * @see mods.railcraft.api.carts.ITrainTransferHelper
  20.  */
  21. public interface IFluidCart {
  22.     /**
  23.      * This function controls whether a cart can pass push or pull requests.
  24.      * This function is only called if the cart cannot fulfill the request itself.
  25.      * <p/>
  26.      * If this interface is not implemented, a default value will be inferred based on the size of the tanks of the Minecart.
  27.      * Anything with eight or more buckets will be assumed to allow passage, but only if the contained fluid matches the request.
  28.      *
  29.      * @return true if can pass push and pull requests
  30.      */
  31.     boolean canPassFluidRequests(Fluid fluid);
  32.  
  33.     /**
  34.      * This function controls whether a cart will accept a pushed Fluid.
  35.      * Even if this function returns true, there still must be a tank that accepts the Fluid in question before it can be added to the cart.
  36.      * <p/>
  37.      * If this interface is not implemented, it is assumed to be true.
  38.      *
  39.      * @param requester the EntityMinecart that initiated the action
  40.      * @param fluid     the Fluid
  41.      * @return true if cart will accept the fluid
  42.      */
  43.     boolean canAcceptPushedFluid(EntityMinecart requester, Fluid fluid);
  44.  
  45.     /**
  46.      * This function controls whether a cart will fulfill a pull request for a specific Fluid.
  47.      * Even if this function returns true, there still must be a tank that can extract the Fluid in question before it can be removed from the cart.
  48.      * <p/>
  49.      * If this interface is not implemented, it is assumed to be true.
  50.      *
  51.      * @param requester the EntityMinecart that initiated the action
  52.      * @param fluid     the Fluid
  53.      * @return true if the cart can provide the fluid
  54.      */
  55.     boolean canProvidePulledFluid(EntityMinecart requester, Fluid fluid);
  56.  
  57.     /**
  58.      * Set by the Liquid Loader while filling, primarily used for rendering a
  59.      * visible change while being filled.
  60.      *
  61.      * @param filling true if the cart is being filled from above
  62.      */
  63.     void setFilling(boolean filling);
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement