Class LodestoneBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntity
- All Implemented Interfaces:
net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.common.extensions.IBlockEntityExtension
- Direct Known Subclasses:
ItemHolderBlockEntity,MultiBlockComponentEntity,MultiBlockCoreEntity
public class LodestoneBlockEntity
extends net.minecraft.world.level.block.entity.BlockEntity
A simple block entity with various methods normally found inside of Block delegated here from
LodestoneEntityBlock-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInputNested 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, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionLodestoneBlockEntity(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 TypeMethodDescriptionnet.minecraft.network.protocol.game.ClientboundBlockEntityDataPacketnet.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider pRegistries) protected voidloadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) voidloadWithLevel(Consumer<net.minecraft.world.level.Level> levelConsumer) Call fromloadAdditional(CompoundTag, HolderLookup.Provider)for anything tied to the entity being initialized/updated that requires a non-null levelvoidonBreak(@Nullable net.minecraft.world.entity.player.Player player) net.minecraft.world.item.ItemStackonClone(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.HitResult target, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) voidonDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket pkt, net.minecraft.core.HolderLookup.Provider lookupProvider) voidonEntityInside(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity) voidonNeighborUpdate(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos neighbor) voidonPlace(net.minecraft.world.entity.LivingEntity placer, net.minecraft.world.item.ItemStack stack) net.minecraft.world.ItemInteractionResultonUse(net.minecraft.world.entity.player.Player pPlayer, net.minecraft.world.InteractionHand pHand) net.minecraft.world.ItemInteractionResultonUseWithItem(net.minecraft.world.entity.player.Player pPlayer, net.minecraft.world.item.ItemStack pStack, net.minecraft.world.InteractionHand pHand) net.minecraft.world.InteractionResultonUseWithoutItem(net.minecraft.world.entity.player.Player pPlayer) voidtick()final voidvoidupdate(net.minecraft.world.level.Level level) A method designed to run anytime substantial changes to the entity are made.Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveAdditional, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdate
-
Constructor Details
-
LodestoneBlockEntity
public LodestoneBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider pRegistries) - Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacketin classnet.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) -
loadAdditional
protected void loadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
loadAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
onBreak
public void onBreak(@Nullable @Nullable net.minecraft.world.entity.player.Player player) -
onPlace
public void onPlace(net.minecraft.world.entity.LivingEntity placer, net.minecraft.world.item.ItemStack stack) -
onNeighborUpdate
public void onNeighborUpdate(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos neighbor) -
onClone
public net.minecraft.world.item.ItemStack onClone(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.HitResult target, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) -
onUse
public net.minecraft.world.ItemInteractionResult onUse(net.minecraft.world.entity.player.Player pPlayer, net.minecraft.world.InteractionHand pHand) -
onUseWithoutItem
public net.minecraft.world.InteractionResult onUseWithoutItem(net.minecraft.world.entity.player.Player pPlayer) -
onUseWithItem
public net.minecraft.world.ItemInteractionResult onUseWithItem(net.minecraft.world.entity.player.Player pPlayer, net.minecraft.world.item.ItemStack pStack, net.minecraft.world.InteractionHand pHand) -
onEntityInside
public void onEntityInside(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity) -
update
public void update(@Nonnull net.minecraft.world.level.Level level) A method designed to run anytime substantial changes to the entity are made. Called the tick after the entity is updated from the server to the client, or loaded from memory -
tick
public void tick() -
loadWithLevel
Call fromloadAdditional(CompoundTag, HolderLookup.Provider)for anything tied to the entity being initialized/updated that requires a non-null level -
triggerLevelConsumers
public final void triggerLevelConsumers()
-