Class InfuserTileEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
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.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeBlockEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

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.minecraftforge.common.capabilities.CapabilityProvider

    net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>>
  • 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.
    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 interface net.minecraft.world.Container

    DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE

    Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    INFINITE_EXTENT_AABB
  • 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
     
    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.
    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
     
    boolean
     
    boolean
    Checks if the infuser is running.
    void
    load(net.minecraft.nbt.CompoundTag nbtTagCompound)
     
    void
    onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt)
     
    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)
     
    static void
    serverTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, InfuserTileEntity blockEntity)
     
    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).
    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

    canOpen, canUnlock, createUnSidedHandler, getCapability, getCustomName, getName, invalidateCaps, reviveCaps, setCustomName

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

    addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEvent

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps

    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, hasAnyMatching, hasAnyOf, setChanged

    Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider

    getCapability

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onLoad, requestModelDataUpdate, serializeNBT

    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.
    • 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
    • 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
      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
      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
      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
      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
    • 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()
      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)
      Specified by:
      onDataPacket in interface net.minecraftforge.common.extensions.IForgeBlockEntity
    • load

      public void load(net.minecraft.nbt.CompoundTag nbtTagCompound)
      Overrides:
      load in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag nbtTagCompound)
      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
    • 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
    • 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 blockEntity)
    • fillStackedContents

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