Package org.cyclops.evilcraft.core.item
Class ItemBloodContainer
java.lang.Object
net.minecraft.world.item.Item
net.minecraftforge.fluids.capability.ItemFluidContainer
org.cyclops.cyclopscore.item.DamageIndicatedItemFluidContainer
org.cyclops.evilcraft.core.item.ItemBloodContainer
- All Implemented Interfaces:
net.minecraft.world.level.ItemLike,net.minecraftforge.common.extensions.IForgeItem,org.cyclops.cyclopscore.item.IInformationProvider
- Direct Known Subclasses:
ItemBloodExtractor,ItemBloodPearlOfTeleportation,ItemBroom,ItemCreativeBloodDrop,ItemInvigoratingPendant,ItemKineticator,ItemMace,ItemNecromancerStaff,ItemPrimedPendant,ItemRejuvenatedFlesh
public class ItemBloodContainer
extends org.cyclops.cyclopscore.item.DamageIndicatedItemFluidContainer
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
net.minecraft.world.item.Item.Properties -
Field Summary
FieldsFields inherited from class org.cyclops.cyclopscore.item.DamageIndicatedItemFluidContainer
component, fluidFields inherited from class net.minecraftforge.fluids.capability.ItemFluidContainer
capacityFields inherited from class net.minecraft.world.item.Item
BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, category, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZEFields inherited from interface org.cyclops.cyclopscore.item.IInformationProvider
BLOCK_PREFIX, INFO_PREFIX, INFO_PREFIX_STYLES, ITEM_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionItemBloodContainer(net.minecraft.world.item.Item.Properties builder, int capacity) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConsume(int amount, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.player.Player player) If this container can consume a given fluid amount.net.minecraftforge.fluids.FluidStackconsume(int amount, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.player.Player player) Consume a given fluid amount.booleandoesSneakBypassUse(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) protected net.minecraftforge.fluids.FluidStackdrainFromOthers(int amount, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.material.Fluid fluid, net.minecraft.world.entity.player.Player player, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action) booleanIf this item can pick up fluids when right-clicking (non-sneaking).booleanIf this item can place fluids when right-clicking (non-sneaking).net.minecraft.world.InteractionResultonItemUseFirst(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.context.UseOnContext context) voidsetPlaceFluids(boolean placeFluids) Set whether or not this item should be able to place fluids in the world when right-clicking (non-sneaking).net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack>use(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand) Methods inherited from class org.cyclops.cyclopscore.item.DamageIndicatedItemFluidContainer
appendHoverText, canDrain, fillItemCategory, getBarColor, getBarWidth, getFluid, getInfo, initCapabilities, isBarVisible, provideInformationMethods inherited from class net.minecraft.world.item.Item
allowedIn, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, finishUsingItem, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getEquipSound, getFoodProperties, getId, getItemCategory, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isComplex, isCorrectToolForDrops, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, shouldOverrideMultiplayerNbt, toString, useOn, useOnRelease, verifyTagAfterLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getItemEnchantability, getItemStackLimit, getMaxDamage, getShareTag, getSweepHitBox, getXpRepairRatio, hasContainerItem, hasCustomEntity, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onLeftClickEntity, onUsingTick, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Field Details
-
canPickUp
protected boolean canPickUp
-
-
Constructor Details
-
ItemBloodContainer
public ItemBloodContainer(net.minecraft.world.item.Item.Properties builder, int capacity)
-
-
Method Details
-
use
public net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack> use(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand) - Overrides:
usein classnet.minecraft.world.item.Item
-
isPlaceFluids
public boolean isPlaceFluids()If this item can place fluids when right-clicking (non-sneaking). The fluid will only be placed if the container has at least 1000 mB inside of it and will drain that accordingly.- Returns:
- If it can place fluids.
-
isPickupFluids
public boolean isPickupFluids()If this item can pick up fluids when right-clicking (non-sneaking).- Returns:
- If it can pick up fluids.
-
setPlaceFluids
public void setPlaceFluids(boolean placeFluids) Set whether or not this item should be able to place fluids in the world when right-clicking (non-sneaking). The fluid will only be placed if the container has at least 1000 mB inside of it and will drain that accordingly.- Parameters:
placeFluids- If it can place fluids.
-
onItemUseFirst
public net.minecraft.world.InteractionResult onItemUseFirst(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.context.UseOnContext context) -
doesSneakBypassUse
public boolean doesSneakBypassUse(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.LevelReader world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) -
drainFromOthers
protected net.minecraftforge.fluids.FluidStack drainFromOthers(int amount, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.material.Fluid fluid, net.minecraft.world.entity.player.Player player, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action) -
canConsume
public boolean canConsume(int amount, net.minecraft.world.item.ItemStack itemStack, @Nullable net.minecraft.world.entity.player.Player player) If this container can consume a given fluid amount. Will also check other containers inside the player inventory.- Parameters:
amount- The amount to drain.itemStack- The fluid container.player- The player.- Returns:
- If the given amount can be drained.
-
consume
public net.minecraftforge.fluids.FluidStack consume(int amount, net.minecraft.world.item.ItemStack itemStack, @Nullable net.minecraft.world.entity.player.Player player) Consume a given fluid amount. Will also check other containers inside the player inventory.- Parameters:
amount- The amount to drain.itemStack- The fluid container.player- The player.- Returns:
- The fluid that was drained.
-