Class BlockEntityBase
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
org.moddingx.libx.base.tile.BlockEntityBase
- All Implemented Interfaces:
net.minecraft.core.TypedInstance<net.minecraft.world.level.block.entity.BlockEntityType<?>>, net.minecraft.util.debug.DebugValueSource, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.IBlockEntityExtension, net.neoforged.neoforge.common.extensions.TypedInstanceExtension<net.minecraft.world.level.block.entity.BlockEntityType<?>>, net.neoforged.neoforge.registries.datamaps.IWithData<net.minecraft.world.level.block.entity.BlockEntityType<?>>
public class BlockEntityBase
extends net.minecraft.world.level.block.entity.BlockEntity
A base class for
block entities. This provides some useful methods.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsFieldNested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource
net.minecraft.util.debug.DebugValueSource.Registration, net.minecraft.util.debug.DebugValueSource.ValueGetter<T> -
Field Summary
FieldsFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
blockState, level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionBlockEntityBase(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionfinal <T,C> T getCapability(net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability, C context) net.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider registries) voidonLoad()If the block entity is loaded on the logical client, this will update the block entity usinggetUpdateTag(HolderLookup.Provider)andIBlockEntityExtension.handleUpdateTag(ValueInput).voidpreRemoveSideEffects(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) voidvoidWhen called on the logical server, this will update the block entity to all clients that are tracking it usinggetUpdateTag(HolderLookup.Provider)andIBlockEntityExtension.handleUpdateTag(ValueInput)at the end of the current tick.Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, getUpdatePacket, hasLevel, isRemoved, isValidBlockState, loadAdditional, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, problemPath, registerDebugValues, removeComponentsFromTag, removeData, saveAdditional, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setComponents, setData, setLevel, setRemoved, syncData, triggerEvent, typeHolderMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
applyStructureRotation, getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, requestModelDataUpdateMethods inherited from interface net.minecraft.core.TypedInstance
is, is, is, is, is, tagsMethods inherited from interface net.neoforged.neoforge.common.extensions.TypedInstanceExtension
getData
-
Field Details
-
LOGGER
-
-
Constructor Details
-
BlockEntityBase
public BlockEntityBase(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
preRemoveSideEffects
-
getCapability
@Nullable public final <T,C> T getCapability(net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability, C context) -
getUpdateTag
-
onLoad
public void onLoad()If the block entity is loaded on the logical client, this will update the block entity usinggetUpdateTag(HolderLookup.Provider)andIBlockEntityExtension.handleUpdateTag(ValueInput). -
setChanged
public void setChanged()- Overrides:
setChangedin classnet.minecraft.world.level.block.entity.BlockEntity
-
setDispatchable
public void setDispatchable()When called on the logical server, this will update the block entity to all clients that are tracking it usinggetUpdateTag(HolderLookup.Provider)andIBlockEntityExtension.handleUpdateTag(ValueInput)at the end of the current tick.
-