Class InfuserTileEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
com.pixelmonmod.pixelmon.blocks.tileentity.InfuserTileEntity
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.inventory.StackedContentsCompatible, net.minecraft.world.MenuProvider, net.minecraft.world.Nameable, net.minecraft.world.WorldlyContainer, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.client.extensions.IMenuProviderExtension, net.neoforged.neoforge.common.extensions.IBlockEntityExtension

public class InfuserTileEntity extends net.minecraft.world.level.block.entity.BaseContainerBlockEntity implements net.minecraft.world.MenuProvider, net.minecraft.world.WorldlyContainer, net.minecraft.world.inventory.StackedContentsCompatible
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity

    net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The number of ticks that a fresh copy of the currently-burning item would keep the infuser running for.
    int
    The current animation frame.
    int
    The number of ticks that the current item has been running for.
    int
    The number of ticks that the infuser will keep running for.
    int
    The number of ticks the current item must infuse for to complete
    boolean
    Whether the infuser is processing an item.
    net.minecraft.world.item.Item
    The item being processed by the infuser.
    int
    Rendering only fields
    net.minecraft.world.item.Item
    The secondary item being processed by the infuser.
    int
    The animation state of the mechanical infuser.

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY

    Fields inherited from interface net.minecraft.world.Container

    DEFAULT_DISTANCE_BUFFER
  • Constructor Summary

    Constructors
    Constructor
    Description
    InfuserTileEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
     
    InfuserTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntityType, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canPlaceItem(int slotIndex, net.minecraft.world.item.ItemStack itemStack)
    Automation.
    boolean
    canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStackIn, net.minecraft.core.Direction direction)
    Returns true if automation can insert the given item in the given slot from the given side.
    boolean
    canTakeItemThroughFace(int slotIndex, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction)
    Returns true if automation can extract the given item in the given slot from the given side.
    void
     
    net.minecraft.world.item.crafting.CraftingInput
     
    protected net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int p_58627_, net.minecraft.world.entity.player.Inventory p_58628_)
     
    net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int id, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player)
     
    void
    fillStackedContents(net.minecraft.world.entity.player.StackedContents stackedContents)
     
    int
    getBurnTimeRemainingScaled(int p_145955_1_)
    Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel item, where 0 means that the item is exhausted and the passed value means that the item is fresh.
    int
    Returns the number of slots in the inventory.
    protected @NotNull net.minecraft.network.chat.Component
     
    net.minecraft.network.chat.Component
     
    net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    int
    getInfusionProgressScaled(int p_145953_1_)
    Returns an integer between 0 and the passed value representing how close the current item is to being completely hammered.
    net.minecraft.world.item.ItemStack
    getItem(int slotIndex)
    Returns the stack in slot i.
    protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    int
     
    int[]
    getSlotsForFace(net.minecraft.core.Direction side)
    Returns an array containing the indices of the slots that can be accessed by automation on the given side of this block.
    net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
     
    net.minecraft.nbt.CompoundTag
    getUpdateTag(net.minecraft.core.HolderLookup.Provider lookup)
     
    boolean
     
    boolean
    Checks if the infuser is running.
    void
    loadAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup)
     
    void
    onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt, net.minecraft.core.HolderLookup.Provider lookup)
     
    net.minecraft.world.item.crafting.RecipeInput
     
    net.minecraft.world.item.ItemStack
    removeItem(int slotIndex, int decreaseBy)
    Removes from an inventory slot up to a specified number of items and returns them in a new stack.
    net.minecraft.world.item.ItemStack
    removeItemNoUpdate(int slotIndex)
    When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.
    void
    saveAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup)
     
    static void
    serverTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, InfuserTileEntity entity)
     
    void
    setItem(int slotIndex, net.minecraft.world.item.ItemStack itemStack)
    Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
    protected void
    setItems(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items)
     
    void
    startOpen(net.minecraft.world.entity.player.Player playerIn)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
    Do not give this method the name canInteractWith because it clashes with Container.
    void
    stopOpen(net.minecraft.world.entity.player.Player playerIn)
     

    Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity

    applyImplicitComponents, canOpen, canUnlock, collectImplicitComponents, getCustomName, getName, removeComponentsFromTag

    Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity

    addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEvent

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.world.Container

    canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, hasData, removeData, setData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

    getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdate

    Methods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension

    shouldTriggerClientSideContainerClosingOnOpen, writeClientSideData

    Methods inherited from interface net.minecraft.world.Nameable

    hasCustomName
  • Field Details

    • infuserRunTime

      public int infuserRunTime
      The number of ticks that the infuser will keep running for.
    • currentItemRunTime

      public int currentItemRunTime
      The number of ticks that a fresh copy of the currently-burning item would keep the infuser running for.
    • infuserProgressTime

      public int infuserProgressTime
      The number of ticks that the current item has been running for.
    • infuserTotalTime

      public int infuserTotalTime
      The number of ticks the current item must infuse for to complete
    • renderPass

      public int renderPass
      Rendering only fields
    • isRunning

      public boolean isRunning
      Whether the infuser is processing an item.
    • itemOnInfuser

      public net.minecraft.world.item.Item itemOnInfuser
      The item being processed by the infuser.
    • secondItemOnInfuser

      public net.minecraft.world.item.Item secondItemOnInfuser
      The secondary item being processed by the infuser.
    • state

      public int state
      The animation state of the mechanical infuser.
    • frame

      public int frame
      The current animation frame.
  • Constructor Details

    • InfuserTileEntity

      public InfuserTileEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
    • InfuserTileEntity

      public InfuserTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntityType, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
  • Method Details

    • getContainerSize

      public int getContainerSize()
      Returns the number of slots in the inventory.
      Specified by:
      getContainerSize in interface net.minecraft.world.Container
      Returns:
      The number of slots in the inventory.
    • getInfuserItemStacks

      public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getInfuserItemStacks()
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface net.minecraft.world.Container
      Overrides:
      isEmpty in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • recipeInput

      public net.minecraft.world.item.crafting.RecipeInput recipeInput()
    • craftingInput

      public net.minecraft.world.item.crafting.CraftingInput craftingInput()
    • getItem

      public net.minecraft.world.item.ItemStack getItem(int slotIndex)
      Returns the stack in slot i.
      Specified by:
      getItem in interface net.minecraft.world.Container
      Overrides:
      getItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Returns:
      The stack in slot i.
    • removeItem

      public net.minecraft.world.item.ItemStack removeItem(int slotIndex, int decreaseBy)
      Removes from an inventory slot up to a specified number of items and returns them in a new stack.
      Specified by:
      removeItem in interface net.minecraft.world.Container
      Overrides:
      removeItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Parameters:
      slotIndex - An inventory slot.
      decreaseBy - A specified number of items.
      Returns:
      The items in a new stack.
    • removeItemNoUpdate

      public net.minecraft.world.item.ItemStack removeItemNoUpdate(int slotIndex)
      When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
      Overrides:
      removeItemNoUpdate in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Returns:
      The EntityItem to drop.
    • setItem

      public void setItem(int slotIndex, net.minecraft.world.item.ItemStack itemStack)
      Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
      Specified by:
      setItem in interface net.minecraft.world.Container
      Overrides:
      setItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Parameters:
      slotIndex - A specified slot in the inventory.
      itemStack - An item stack.
    • getMaxStackSize

      public int getMaxStackSize()
      Specified by:
      getMaxStackSize in interface net.minecraft.world.Container
    • stillValid

      public boolean stillValid(net.minecraft.world.entity.player.Player player)
      Do not give this method the name canInteractWith because it clashes with Container.
      Specified by:
      stillValid in interface net.minecraft.world.Container
      Overrides:
      stillValid in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • canPlaceItem

      public boolean canPlaceItem(int slotIndex, net.minecraft.world.item.ItemStack itemStack)
      Automation. Slot index: 0 = fuel 1 and 2 = inputs 3 = output.
      Specified by:
      canPlaceItem in interface net.minecraft.world.Container
    • getSlotsForFace

      public int[] getSlotsForFace(net.minecraft.core.Direction side)
      Returns an array containing the indices of the slots that can be accessed by automation on the given side of this block.
      Specified by:
      getSlotsForFace in interface net.minecraft.world.WorldlyContainer
      Parameters:
      side - A side.
      Returns:
      An array containing the indices of the slots that can be accessed by automation on the given side of this block.
    • canPlaceItemThroughFace

      public boolean canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStackIn, net.minecraft.core.Direction direction)
      Returns true if automation can insert the given item in the given slot from the given side.
      Specified by:
      canPlaceItemThroughFace in interface net.minecraft.world.WorldlyContainer
      Parameters:
      index - Slot.
      itemStackIn - Item.
      direction - Side.
      Returns:
      True if automation can insert the given item in the given slot from the given side.
    • canTakeItemThroughFace

      public boolean canTakeItemThroughFace(int slotIndex, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction)
      Returns true if automation can extract the given item in the given slot from the given side.
      Specified by:
      canTakeItemThroughFace in interface net.minecraft.world.WorldlyContainer
      Parameters:
      slotIndex - Slot.
      itemStack - Item.
      direction - Side.
      Returns:
      True if automation can extract the given item in the given slot from the given side.
    • getUpdateTag

      public net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider lookup)
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • getUpdatePacket

      public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()
      Overrides:
      getUpdatePacket in class net.minecraft.world.level.block.entity.BlockEntity
    • onDataPacket

      public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt, net.minecraft.core.HolderLookup.Provider lookup)
      Specified by:
      onDataPacket in interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
    • loadAdditional

      public void loadAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup)
      Overrides:
      loadAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound, net.minecraft.core.HolderLookup.Provider lookup)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getInfusionProgressScaled

      public int getInfusionProgressScaled(int p_145953_1_)
      Returns an integer between 0 and the passed value representing how close the current item is to being completely hammered.
      Returns:
      An integer between 0 and the passed value representing how close the current item is to being completely hammered.
    • getBurnTimeRemainingScaled

      public int getBurnTimeRemainingScaled(int p_145955_1_)
      Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel item, where 0 means that the item is exhausted and the passed value means that the item is fresh.
      Parameters:
      p_145955_1_ - The fresh burn time.
      Returns:
      An integer between 0 and the passed value representing how much burn time is left on the current fuel item, where 0 means that the item is exhausted and the passed value means that the item is fresh.
    • isRunning

      public boolean isRunning()
      Checks if the infuser is running.
      Returns:
      Whether the infuser is running.
    • startOpen

      public void startOpen(net.minecraft.world.entity.player.Player playerIn)
      Specified by:
      startOpen in interface net.minecraft.world.Container
    • stopOpen

      public void stopOpen(net.minecraft.world.entity.player.Player playerIn)
      Specified by:
      stopOpen in interface net.minecraft.world.Container
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface net.minecraft.world.Clearable
      Overrides:
      clearContent in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getDisplayName

      public net.minecraft.network.chat.Component getDisplayName()
      Specified by:
      getDisplayName in interface net.minecraft.world.MenuProvider
      Specified by:
      getDisplayName in interface net.minecraft.world.Nameable
      Overrides:
      getDisplayName in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getDefaultName

      @NotNull protected @NotNull net.minecraft.network.chat.Component getDefaultName()
      Specified by:
      getDefaultName in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getItems

      protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()
      Specified by:
      getItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • setItems

      protected void setItems(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items)
      Specified by:
      setItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • createMenu

      public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
      Overrides:
      createMenu in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • createMenu

      protected net.minecraft.world.inventory.AbstractContainerMenu createMenu(int p_58627_, net.minecraft.world.entity.player.Inventory p_58628_)
      Specified by:
      createMenu in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • serverTick

      public static void serverTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, InfuserTileEntity entity)
    • fillStackedContents

      public void fillStackedContents(net.minecraft.world.entity.player.StackedContents stackedContents)
      Specified by:
      fillStackedContents in interface net.minecraft.world.inventory.StackedContentsCompatible