public class ItemBlockFluidContainer extends ItemBlockNBT implements net.minecraftforge.fluids.IFluidContainerItem
ItemBlock that can be used for blocks that have a tile entity with a fluid container.
The block must implement IBlockTank.
Instances of this will also keep it's tank capacity next to the contents.informationProvider, rarityProvider| Constructor and Description |
|---|
ItemBlockFluidContainer(net.minecraft.block.Block block)
Make a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInformation(net.minecraft.item.ItemStack itemStack,
net.minecraft.entity.player.EntityPlayer entityPlayer,
java.util.List list,
boolean par4) |
protected void |
autofill(net.minecraftforge.fluids.IFluidContainerItem item,
net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.Entity entity) |
net.minecraftforge.fluids.FluidStack |
drain(net.minecraft.item.ItemStack container,
int maxDrain,
boolean doDrain) |
int |
fill(net.minecraft.item.ItemStack container,
net.minecraftforge.fluids.FluidStack resource,
boolean doFill) |
IBlockTank |
getBlockTank() |
int |
getCapacity(net.minecraft.item.ItemStack container) |
net.minecraftforge.fluids.FluidStack |
getFluid(net.minecraft.item.ItemStack container) |
net.minecraft.item.ItemStack |
onItemRightClick(net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.player.EntityPlayer player) |
void |
onUpdate(net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.Entity entity,
int par4,
boolean par5) |
protected void |
readAdditionalInfo(net.minecraft.tileentity.TileEntity tile,
net.minecraft.item.ItemStack itemStack)
Read additional info about the item into the tile.
|
void |
setCapacity(net.minecraft.item.ItemStack container,
int capacity)
Set the maximal tank capacity.
|
protected void |
setFluid(net.minecraft.item.ItemStack container,
net.minecraftforge.fluids.FluidStack fluidStack) |
placeBlockAtgetRaritygetIconFromDamage, getMetadatafunc_150936_a, getCreativeTab, getSpriteNumber, getSubItems, getUnlocalizedName, getUnlocalizedName, onItemUse, registerIcons, setUnlocalizedName, setUnlocalizedNamecanHarvestBlock, canItemEditBlocks, createEntity, doesContainerItemLeaveCraftingGrid, doesSneakBypassUse, func_150893_a, func_150897_b, getArmorModel, getArmorTexture, getAttributeModifiers, getChestGenBase, getColorFromItemStack, getContainerItem, getContainerItem, getCreativeTabs, getDamage, getDigSpeed, getDisplayDamage, getDurabilityForDisplay, getEntityLifespan, getFontRenderer, getHarvestLevel, getHasSubtypes, getIcon, getIcon, getIconFromDamageForRenderPass, getIconIndex, getIconString, getIdFromItem, getIsRepairable, getItemAttributeModifiers, getItemById, getItemEnchantability, getItemEnchantability, getItemFromBlock, getItemStackDisplayName, getItemStackLimit, getItemStackLimit, getItemUseAction, getMaxDamage, getMaxDamage, getMaxItemUseDuration, getMovingObjectPositionFromPlayer, getPotionEffect, getRenderPasses, getShareTag, getSmeltingExperience, getToolClasses, getUnlocalizedNameInefficiently, hasContainerItem, hasContainerItem, hasCustomEntity, hasEffect, hasEffect, hitEntity, isBeaconPayment, isBookEnchantable, isDamageable, isDamaged, isFull3D, isItemTool, isMap, isPotionIngredient, isRepairable, isValidArmor, itemInteractionForEntity, onArmorTick, onBlockDestroyed, onBlockStartBreak, onCreated, onDroppedByPlayer, onEaten, onEntityItemUpdate, onEntitySwing, onItemUseFirst, onLeftClickEntity, onPlayerStoppedUsing, onUsingTick, registerItems, renderHelmetOverlay, requiresMultipleRenderPasses, setContainerItem, setCreativeTab, setDamage, setFull3D, setHarvestLevel, setHasSubtypes, setMaxDamage, setMaxStackSize, setNoRepair, setPotionEffect, setTextureName, shouldRotateAroundWhenRendering, showDurabilityBarpublic ItemBlockFluidContainer(net.minecraft.block.Block block)
block - The block instance.public IBlockTank getBlockTank()
public net.minecraftforge.fluids.FluidStack getFluid(net.minecraft.item.ItemStack container)
getFluid in interface net.minecraftforge.fluids.IFluidContainerItemprotected void setFluid(net.minecraft.item.ItemStack container,
net.minecraftforge.fluids.FluidStack fluidStack)
public int getCapacity(net.minecraft.item.ItemStack container)
getCapacity in interface net.minecraftforge.fluids.IFluidContainerItempublic void setCapacity(net.minecraft.item.ItemStack container,
int capacity)
container - The item stack.capacity - The maximal tank capacity in mB.protected void readAdditionalInfo(net.minecraft.tileentity.TileEntity tile,
net.minecraft.item.ItemStack itemStack)
ItemBlockNBTreadAdditionalInfo in class ItemBlockNBTtile - The tile that is being created.itemStack - The item that is placed.public int fill(net.minecraft.item.ItemStack container,
net.minecraftforge.fluids.FluidStack resource,
boolean doFill)
fill in interface net.minecraftforge.fluids.IFluidContainerItempublic net.minecraftforge.fluids.FluidStack drain(net.minecraft.item.ItemStack container,
int maxDrain,
boolean doDrain)
drain in interface net.minecraftforge.fluids.IFluidContainerItempublic net.minecraft.item.ItemStack onItemRightClick(net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.player.EntityPlayer player)
onItemRightClick in class net.minecraft.item.Itemprotected void autofill(net.minecraftforge.fluids.IFluidContainerItem item,
net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.Entity entity)
public void onUpdate(net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.Entity entity,
int par4,
boolean par5)
onUpdate in class net.minecraft.item.Itempublic void addInformation(net.minecraft.item.ItemStack itemStack,
net.minecraft.entity.player.EntityPlayer entityPlayer,
java.util.List list,
boolean par4)
addInformation in class ItemBlockMetadata