Class EnchantmentBaseBlockEntity

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
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
Direct Known Subclasses:
DisenchanterBlockEntity, EnchanterBlockEntity

public abstract class EnchantmentBaseBlockEntity extends net.minecraft.world.level.block.entity.BaseContainerBlockEntity implements IEnchantmentMachine
  • 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
    EnchantmentBaseBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> tileEntityType, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    void
    loadAdditional(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider provider)
     
    void
    onNeighbourChanged(net.minecraft.world.level.LevelReader iWorld, net.minecraft.core.BlockPos neighborPos)
     
    protected void
    saveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player playerEntity)
     

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

    applyImplicitComponents, canOpen, canUnlock, clearContent, collectImplicitComponents, createMenu, createMenu, getCustomName, getDefaultName, getDisplayName, getItem, getItems, getName, isEmpty, removeComponentsFromTag, removeItem, removeItemNoUpdate, setItem, setItems

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

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

    shouldTriggerClientSideContainerClosingOnOpen

    Methods inherited from interface net.minecraft.world.Nameable

    hasCustomName
  • Constructor Details

    • EnchantmentBaseBlockEntity

      public EnchantmentBaseBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> tileEntityType, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • stillValid

      public boolean stillValid(@Nonnull net.minecraft.world.entity.player.Player playerEntity)
      Specified by:
      stillValid in interface net.minecraft.world.Container
      Overrides:
      stillValid in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getConnectedEnchantmentTE

      public Optional<StorageBlockEntity> getConnectedEnchantmentTE()
      Specified by:
      getConnectedEnchantmentTE in interface IEnchantmentMachine
    • onNeighbourChanged

      public void onNeighbourChanged(net.minecraft.world.level.LevelReader iWorld, net.minecraft.core.BlockPos neighborPos)
    • hasConnectedTE

      public boolean hasConnectedTE()
      Specified by:
      hasConnectedTE in interface IEnchantmentMachine
      Returns:
      Whether an associated block pos is present. In most cases this should mean that getConnectedEnchantmentTE returns non empty TE
    • saveAdditional

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

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