public class ItemFluidContainer extends Item implements IFluidContainerItem
IFluidContainerItem
. Use/extend this or implement your own.Item.ToolMaterial
Modifier and Type | Field and Description |
---|---|
protected int |
capacity |
bFull3D, canRepair, delegate, hasSubtypes, itemModifierUUID, itemRand, itemRegistry, maxStackSize
Constructor and Description |
---|
ItemFluidContainer(int itemID) |
ItemFluidContainer(int itemID,
int capacity) |
Modifier and Type | Method and Description |
---|---|
FluidStack |
drain(ItemStack container,
int maxDrain,
boolean doDrain) |
int |
fill(ItemStack container,
FluidStack resource,
boolean doFill) |
int |
getCapacity(ItemStack container) |
FluidStack |
getFluid(ItemStack container) |
ItemFluidContainer |
setCapacity(int capacity) |
addInformation, canHarvestBlock, canHarvestBlock, canItemEditBlocks, createEntity, doesSneakBypassUse, getArmorModel, getArmorModel, getArmorTexture, getAttributeModifiers, getByNameOrId, getChestGenBase, getColorFromItemStack, getContainerItem, getContainerItem, getCreativeTab, getCreativeTabs, getDamage, getDigSpeed, getDurabilityForDisplay, getEntityLifespan, getFontRenderer, getHarvestLevel, getHasSubtypes, getHighlightTip, getIdFromItem, getIsRepairable, getItemAttributeModifiers, getItemById, getItemEnchantability, getItemEnchantability, getItemFromBlock, getItemStackDisplayName, getItemStackLimit, getItemStackLimit, getItemUseAction, getMaxDamage, getMaxDamage, getMaxItemUseDuration, getMetadata, getMetadata, getModel, getMovingObjectPositionFromPlayer, getPotionEffect, getRarity, getRegistryName, getShareTag, getSmeltingExperience, getStrVsBlock, getSubItems, getToolClasses, getUnlocalizedName, getUnlocalizedName, getUnlocalizedNameInefficiently, hasContainerItem, hasContainerItem, hasCustomEntity, hasEffect, hitEntity, initCapabilities, isBeaconPayment, isBookEnchantable, isDamageable, isDamaged, isFull3D, isItemTool, isMap, isPotionIngredient, isRepairable, isValidArmor, itemInteractionForEntity, onArmorTick, onBlockDestroyed, onBlockStartBreak, onCreated, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onItemRightClick, onItemUse, onItemUseFinish, onItemUseFirst, onLeftClickEntity, onPlayerStoppedUsing, onUpdate, onUsingTick, registerItemBlock, registerItems, renderHelmetOverlay, setContainerItem, setCreativeTab, setDamage, setFull3D, setHarvestLevel, setHasSubtypes, setMaxDamage, setMaxStackSize, setNoRepair, setPotionEffect, setRegistryName, setRegistryName, setRegistryName, setUnlocalizedName, shouldCauseReequipAnimation, shouldRotateAroundWhenRendering, showDurabilityBar, updateItemStackNBT
public ItemFluidContainer(int itemID)
public ItemFluidContainer(int itemID, int capacity)
public ItemFluidContainer setCapacity(int capacity)
public FluidStack getFluid(ItemStack container)
getFluid
in interface IFluidContainerItem
container
- ItemStack which is the fluid container.public int getCapacity(ItemStack container)
getCapacity
in interface IFluidContainerItem
container
- ItemStack which is the fluid container.public int fill(ItemStack container, FluidStack resource, boolean doFill)
fill
in interface IFluidContainerItem
container
- ItemStack which is the fluid container.resource
- FluidStack attempting to fill the container.doFill
- If false, the fill will only be simulated.public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain)
drain
in interface IFluidContainerItem
container
- ItemStack which is the fluid container.maxDrain
- Maximum amount of fluid to be removed from the container.