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, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

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.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_LIMIT, LARGE_MAX_STACK_SIZE
  • 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.
    int[]
    getSlotsForFace(net.minecraft.core.Direction side)
    Get slots for faces.
    boolean
    Check if the inventory is empty.
    static boolean
    isFuel(net.minecraft.world.item.ItemStack stack)
    Check if an item is fuel.
    void
    load(net.minecraft.nbt.CompoundTag nbt)
    Load NBT data.
    @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 pTag)
    Save NBT data.
    void
    setItem(int index, net.minecraft.world.item.ItemStack stack)
    Sets the given item stack to the specified slot in the inventory.
    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

    canOpen, canUnlock, createMenu, getCustomName, getDisplayName, getName, setCustomName

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

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

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

    areAttachmentsCompatible, 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, 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

    deserializeNBT, getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT

    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
    • 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
    • load

      public void load(net.minecraft.nbt.CompoundTag nbt)
      Load NBT data.
      Overrides:
      load in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Parameters:
      nbt - the CompoundNBT to load
    • saveAdditional

      protected void saveAdditional(net.minecraft.nbt.CompoundTag pTag)
      Save NBT data.
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
      Parameters:
      pTag - the CompoundNBT to save
    • 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
      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
      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
      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
      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
      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
      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
    • 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