Class AmmunitionTableBlockEntity

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
tech.anonymoushacker1279.immersiveweapons.blockentity.AmmunitionTableBlockEntity
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.level.block.EntityBlock, net.minecraft.world.MenuProvider, net.minecraft.world.Nameable, 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 AmmunitionTableBlockEntity extends net.minecraft.world.level.block.entity.BaseContainerBlockEntity implements net.minecraft.world.level.block.EntityBlock
  • 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
    protected final net.minecraft.world.inventory.ContainerData
     
    protected float
     
    protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    protected net.minecraft.core.NonNullList<Integer>
     

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

    Modifier and Type
    Method
    Description
    void
    Clear the inventory.
    void
    Runs after a result stack has been taken.
    protected net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int id, net.minecraft.world.entity.player.Inventory inventory)
     
    int
    Get the number of slots in the inventory.
    protected net.minecraft.network.chat.Component
     
    net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    net.minecraft.world.item.ItemStack
    getItem(int index)
    Get the stack in the given slot.
    net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
     
    net.minecraft.nbt.CompoundTag
     
    boolean
    Check if the inventory is empty.
    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)
     
    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
     
    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)
     

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

    canOpen, canUnlock, createMenu, createUnSidedHandler, getCapability, getCustomName, getDisplayName, 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, 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

    canPlaceItem, canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpen

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

    getListener, getTicker

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

    getCapability

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

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

    Methods inherited from interface net.minecraft.world.Nameable

    hasCustomName
  • Field Details

    • inventory

      protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> inventory
    • densityModifier

      protected float densityModifier
    • slotCosts

      protected net.minecraft.core.NonNullList<Integer> slotCosts
    • containerData

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

    • AmmunitionTableBlockEntity

      public AmmunitionTableBlockEntity(net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
  • 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
    • 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)
      Specified by:
      newBlockEntity in interface net.minecraft.world.level.block.EntityBlock
    • 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
    • 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
    • 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
    • getUpdateTag

      public net.minecraft.nbt.CompoundTag getUpdateTag()
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • getInventory

      public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getInventory()
    • getUpdatePacket

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

      public boolean stillValid(net.minecraft.world.entity.player.Player player)
      Specified by:
      stillValid in interface net.minecraft.world.Container
    • clearContent

      public void clearContent()
      Clear the inventory.
      Specified by:
      clearContent in interface net.minecraft.world.Clearable
    • setChanged

      public void setChanged()
      Specified by:
      setChanged in interface net.minecraft.world.Container
      Overrides:
      setChanged in class net.minecraft.world.level.block.entity.BlockEntity
    • completeCraft

      public void completeCraft()
      Runs after a result stack has been taken. Decreases the stack size of each input item by the amount specified in the slotCosts list.