mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 15:03:04 +00:00
1 parent
276929901f
commit
6cd56ebed6
22 files changed
+3021
-5
No files matched your search
@@ -0,0 +1,61 @@
|
||||
|
||||
package net.minecraftforge.fluids;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface on Item classes that support external manipulation of their internal
|
||||
* fluid storage.
|
||||
*
|
||||
* A reference implementation is provided {@link ItemFluidContainer}.
|
||||
*
|
||||
* NOTE: Use of NBT data on the containing ItemStack is encouraged.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IFluidContainerItem {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param container
|
||||
* ItemStack which is the fluid container.
|
||||
* @return FluidStack representing the fluid in the container, null if the container is empty.
|
||||
*/
|
||||
FluidStack getFluid(ItemStack container);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param container
|
||||
* ItemStack which is the fluid container.
|
||||
* @return Capacity of this fluid container.
|
||||
*/
|
||||
int getCapacity(ItemStack container);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param container
|
||||
* ItemStack which is the fluid container.
|
||||
* @param resource
|
||||
* FluidStack attempting to fill the container.
|
||||
* @param doFill
|
||||
* If false, the fill will only be simulated.
|
||||
* @return Amount of fluid that was (or would have been, if simulated) filled into the
|
||||
* container.
|
||||
*/
|
||||
int fill(ItemStack container, FluidStack resource, boolean doFill);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param container
|
||||
* ItemStack which is the fluid container.
|
||||
* @param maxDrain
|
||||
* Maximum amount of fluid to be removed from the container.
|
||||
* @param doFill
|
||||
* If false, the drain will only be simulated.
|
||||
* @return Amount of fluid that was (or would have been, if simulated) drained from the
|
||||
* container.
|
||||
*/
|
||||
FluidStack drain(ItemStack container, int maxDrain, boolean doDrain);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user