Class EnchanterBlockEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
de.cheaterpaul.enchantmentmachine.block.entity.EnchantmentBaseBlockEntity
de.cheaterpaul.enchantmentmachine.block.entity.EnchanterBlockEntity
All Implemented Interfaces:
IEnchantmentMachine, net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.minecraft.world.Nameable, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.client.extensions.IMenuProviderExtension, net.neoforged.neoforge.common.extensions.IBlockEntityExtension

public class EnchanterBlockEntity extends EnchantmentBaseBlockEntity
  • 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 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
    EnchanterBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int i, net.minecraft.world.entity.player.Inventory playerInventory)
     
    boolean
    executeEnchantments(net.minecraft.world.entity.player.Player user, List<EnchantmentInstanceMod> enchantments)
    Apply the given list of enchantments to the item in the inventory.
    int
     
    protected net.minecraft.network.chat.Component
     
    net.minecraft.world.item.ItemStack
    getItem(int i)
     
    protected @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    net.minecraft.nbt.CompoundTag
    getUpdateTag(net.minecraft.core.HolderLookup.Provider pRegistries)
     
    boolean
     
    void
    onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt, net.minecraft.core.HolderLookup.Provider lookupProvider)
     
    net.minecraft.world.item.ItemStack
    removeItem(int i, int i1)
     
    net.minecraft.world.item.ItemStack
     
    void
    setItem(int i, net.minecraft.world.item.ItemStack itemStack)
     
    protected void
    setItems(@NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> nonNullList)
     

    Methods inherited from class de.cheaterpaul.enchantmentmachine.block.entity.EnchantmentBaseBlockEntity

    getConnectedEnchantmentTE, hasConnectedTE, loadAdditional, onNeighbourChanged, saveAdditional, stillValid

    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

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

    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

    Methods inherited from interface net.minecraft.world.Nameable

    hasCustomName
  • Constructor Details

    • EnchanterBlockEntity

      public EnchanterBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • getDefaultName

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

      @NotNull protected @NotNull 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(@NotNull @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> nonNullList)
      Specified by:
      setItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • createMenu

      @Nonnull protected net.minecraft.world.inventory.AbstractContainerMenu createMenu(int i, @Nonnull net.minecraft.world.entity.player.Inventory playerInventory)
      Specified by:
      createMenu in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getContainerSize

      public int getContainerSize()
    • isEmpty

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

      @Nonnull public net.minecraft.world.item.ItemStack getItem(int i)
      Specified by:
      getItem in interface net.minecraft.world.Container
      Overrides:
      getItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • removeItem

      @Nonnull public net.minecraft.world.item.ItemStack removeItem(int i, int i1)
      Specified by:
      removeItem in interface net.minecraft.world.Container
      Overrides:
      removeItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • removeItemNoUpdate

      @Nonnull public net.minecraft.world.item.ItemStack removeItemNoUpdate(int i)
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
      Overrides:
      removeItemNoUpdate in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • setItem

      public void setItem(int i, @Nonnull net.minecraft.world.item.ItemStack itemStack)
      Specified by:
      setItem in interface net.minecraft.world.Container
      Overrides:
      setItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • clearContent

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

      public boolean executeEnchantments(net.minecraft.world.entity.player.Player user, List<EnchantmentInstanceMod> enchantments)
      Apply the given list of enchantments to the item in the inventory. It is expected that only available and valid (for the itemstack) enchantments are requested. Otherwise this will log a warning and return false.
      Parameters:
      user - The player entity that provides the experience points
      enchantments - List of enchantments to apply
      Returns:
      If all enchantments and sufficient skill points were available
    • getUpdateTag

      public net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider pRegistries)
      Overrides:
      getUpdateTag 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 lookupProvider)