Class TeslaSynthesizerBlockEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
tech.anonymoushacker1279.immersiveweapons.blockentity.TeslaSynthesizerBlockEntity
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.inventory.StackedContentsCompatible, net.minecraft.world.level.block.EntityBlock, 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 TeslaSynthesizerBlockEntity extends net.minecraft.world.level.block.entity.BaseContainerBlockEntity implements net.minecraft.world.WorldlyContainer, net.minecraft.world.inventory.StackedContentsCompatible, net.minecraft.world.level.block.EntityBlock
  • 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
    final net.minecraft.world.inventory.ContainerData
     
    protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     

    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
    TeslaSynthesizerBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
    Constructor for AbstractTeslaBlockEntity.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canPlaceItem(int index, net.minecraft.world.item.ItemStack stack)
    Check if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
    boolean
    canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStack, @Nullable net.minecraft.core.Direction direction)
    Determine if an item can be placed through a face.
    boolean
    canTakeItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction)
    Determine if an item can be removed through a face.
    void
    Clear the inventory.
    protected net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int id, net.minecraft.world.entity.player.Inventory inventory)
     
    void
    fillStackedContents(net.minecraft.world.entity.player.StackedContents helper)
    Fill stacked contents.
    int
    Get the number of slots in the inventory.
    protected net.minecraft.network.chat.Component
     
    net.minecraft.world.item.ItemStack
    getItem(int index)
    Get the stack in the given slot.
    protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    int[]
    getSlotsForFace(net.minecraft.core.Direction side)
    Get slots for faces.
    net.minecraft.nbt.CompoundTag
    getUpdateTag(net.minecraft.core.HolderLookup.Provider provider)
     
    boolean
    Check if the inventory is empty.
    static boolean
    isFuel(net.minecraft.world.item.ItemStack stack)
    Check if an item is fuel.
    void
    loadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider)
     
    @Nullable net.minecraft.world.level.block.entity.BlockEntity
    newBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
    Create a block entity for the block.
    net.minecraft.world.item.ItemStack
    removeItem(int index, int count)
    Removes up to a specified number of items from an inventory slot and returns them in a new stack.
    net.minecraft.world.item.ItemStack
    removeItemNoUpdate(int index)
    Removes a stack from the given slot and returns it.
    protected void
    saveAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider)
     
    void
    setItem(int index, net.minecraft.world.item.ItemStack stack)
    Sets the given item stack to the specified slot in the inventory.
    protected void
    setItems(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> stacks)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
    Check if the player is still valid.
    void
    tick(net.minecraft.world.level.Level level)
    Runs once per tick.

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

    applyImplicitComponents, canOpen, canUnlock, collectImplicitComponents, createMenu, getCustomName, getDisplayName, 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, getUpdatePacket, 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, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpen

    Methods inherited from interface net.minecraft.world.level.block.EntityBlock

    getListener, getTicker

    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, onDataPacket, onLoad, requestModelDataUpdate

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

    shouldTriggerClientSideContainerClosingOnOpen

    Methods inherited from interface net.minecraft.world.Nameable

    hasCustomName
  • Field Details

    • items

      protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items
    • containerData

      public final net.minecraft.world.inventory.ContainerData containerData
  • Constructor Details

    • TeslaSynthesizerBlockEntity

      public TeslaSynthesizerBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
      Constructor for AbstractTeslaBlockEntity.
  • Method Details

    • getDefaultName

      protected 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> stacks)
      Specified by:
      setItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • createMenu

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

      public static boolean isFuel(net.minecraft.world.item.ItemStack stack)
      Check if an item is fuel.
      Parameters:
      stack - the ItemStack to check
      Returns:
      boolean
    • tick

      public void tick(net.minecraft.world.level.Level level)
      Runs once per tick. Handle smelting procedures here.
    • newBlockEntity

      @Nullable public @Nullable net.minecraft.world.level.block.entity.BlockEntity newBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
      Create a block entity for the block.
      Specified by:
      newBlockEntity in interface net.minecraft.world.level.block.EntityBlock
      Parameters:
      blockPos - the BlockPos the block is at
      blockState - the BlockState of the block
      Returns:
      BlockEntity
    • loadAdditional

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

      protected void saveAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getUpdateTag

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

      public int[] getSlotsForFace(net.minecraft.core.Direction side)
      Get slots for faces.
      Specified by:
      getSlotsForFace in interface net.minecraft.world.WorldlyContainer
      Parameters:
      side - the Direction to check
      Returns:
      int[]
    • getContainerSize

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

      public boolean isEmpty()
      Check if the inventory is empty.
      Specified by:
      isEmpty in interface net.minecraft.world.Container
      Overrides:
      isEmpty in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Returns:
      boolean
    • canPlaceItemThroughFace

      public boolean canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStack, @Nullable @Nullable net.minecraft.core.Direction direction)
      Determine if an item can be placed through a face.
      Specified by:
      canPlaceItemThroughFace in interface net.minecraft.world.WorldlyContainer
      Parameters:
      index - the slot index
      itemStack - the ItemStack to insert
      direction - the Direction the block is facing
      Returns:
      boolean
    • canTakeItemThroughFace

      public boolean canTakeItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction)
      Determine if an item can be removed through a face.
      Specified by:
      canTakeItemThroughFace in interface net.minecraft.world.WorldlyContainer
      Parameters:
      index - the slot index
      itemStack - the ItemStack to remove
      direction - the Direction the block is facing
      Returns:
      boolean
    • getItem

      public net.minecraft.world.item.ItemStack getItem(int index)
      Get the stack in the given slot.
      Specified by:
      getItem in interface net.minecraft.world.Container
      Overrides:
      getItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Parameters:
      index - the slot index
      Returns:
      ItemStack
    • removeItem

      public net.minecraft.world.item.ItemStack removeItem(int index, int count)
      Removes up to a specified number of items from an inventory slot 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:
      index - the slot index
      count - the number to remove
      Returns:
      ItemStack
    • removeItemNoUpdate

      public net.minecraft.world.item.ItemStack removeItemNoUpdate(int index)
      Removes a stack from the given slot and returns it.
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
      Overrides:
      removeItemNoUpdate in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Parameters:
      index - the slot index
      Returns:
      ItemStack
    • setItem

      public void setItem(int index, net.minecraft.world.item.ItemStack stack)
      Sets the given item stack to the specified slot in the inventory.
      Specified by:
      setItem in interface net.minecraft.world.Container
      Overrides:
      setItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Parameters:
      index - the slot index
      stack - the ItemStack to set
    • stillValid

      public boolean stillValid(net.minecraft.world.entity.player.Player player)
      Check if the player is still valid.
      Specified by:
      stillValid in interface net.minecraft.world.Container
      Overrides:
      stillValid in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Parameters:
      player - the PlayerEntity to check
      Returns:
      boolean
    • canPlaceItem

      public boolean canPlaceItem(int index, net.minecraft.world.item.ItemStack stack)
      Check if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
      Specified by:
      canPlaceItem in interface net.minecraft.world.Container
      Parameters:
      index - the slot index
      stack - the ItemStack to insert
    • clearContent

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

      public void fillStackedContents(net.minecraft.world.entity.player.StackedContents helper)
      Fill stacked contents.
      Specified by:
      fillStackedContents in interface net.minecraft.world.inventory.StackedContentsCompatible
      Parameters:
      helper - the RecipeItemHelper instance