接口 IBlockEntityExtension
- 所有已知实现类:
AbstractFurnaceBlockEntity
,BannerBlockEntity
,BarrelBlockEntity
,BaseContainerBlockEntity
,BeaconBlockEntity
,BedBlockEntity
,BeehiveBlockEntity
,BellBlockEntity
,BlastFurnaceBlockEntity
,BlockEntity
,BlockPropertyTests.LightBlockEntity
,BrewingStandBlockEntity
,BrushableBlockEntity
,CalibratedSculkSensorBlockEntity
,CampfireBlockEntity
,ChestBlockEntity
,ChiseledBookShelfBlockEntity
,CommandBlockEntity
,ComparatorBlockEntity
,ConduitBlockEntity
,CrafterBlockEntity
,CreakingHeartBlockEntity
,CustomHeadTest.CustomSkullBlockEntity
,CustomItemDisplayContextTest.ItemHangerBlockEntity
,CustomSignsTest.CustomHangingSignBlockEntity
,CustomSignsTest.CustomSignBlockEntity
,DaylightDetectorBlockEntity
,DecoratedPotBlockEntity
,DispenserBlockEntity
,DropperBlockEntity
,EnchantingTableBlockEntity
,EnderChestBlockEntity
,FullPotsAccessorDemo.DioriteFlowerPotBlockEntity
,FurnaceBlockEntity
,HangingSignBlockEntity
,HopperBlockEntity
,JigsawBlockEntity
,JukeboxBlockEntity
,LecternBlockEntity
,MegaModelTest.TestBlock.Entity
,PistonMovingBlockEntity
,RandomizableContainerBlockEntity
,SculkCatalystBlockEntity
,SculkSensorBlockEntity
,SculkShriekerBlockEntity
,ShulkerBoxBlockEntity
,SignBlockEntity
,SkullBlockEntity
,SmokerBlockEntity
,SpawnerBlockEntity
,StructureBlockEntity
,TestBlockEntity
,TestInstanceBlockEntity
,TheEndGatewayBlockEntity
,TheEndPortalBlockEntity
,TrappedChestBlockEntity
,TrialSpawnerBlockEntity
,VaultBlockEntity
public interface IBlockEntityExtension
-
方法概要
修饰符和类型方法说明default ModelData
Allows you to return additional model data.Gets aCompoundTag
that can be used to store custom data for this block entity.default void
handleUpdateTag
(ValueInput input) Called when the chunk's TE update tag, gotten fromBlockEntity.getUpdateTag(HolderLookup.Provider)
, is received on the client.default void
Notify all listeners that the capabilities at the positions of this block entity might have changed.default void
default void
onDataPacket
(Connection net, ValueInput valueInput) Called when you receive a TileEntityData packet for the location this TileEntity is currently in.default void
onLoad()
Called when this is first added to the world (byLevelChunk.addAndRegisterBlockEntity(BlockEntity)
) or right before the first tick when the chunk is generated or loaded from disk.default void
Requests a refresh for the model data of your TE Call this every time yourgetModelData()
changesprivate BlockEntity
self()
-
方法详细资料
-
self
-
onDataPacket
Called when you receive a TileEntityData packet for the location this TileEntity is currently in. On the client, the NetworkManager will always be the remote server. On the server, it will be whomever is responsible for sending the packet.- 参数:
net
- TheConnection
the packet originated fromvalueInput
- TheValueInput
to read the packet data from
-
handleUpdateTag
Called when the chunk's TE update tag, gotten fromBlockEntity.getUpdateTag(HolderLookup.Provider)
, is received on the client.Used to handle this tag in a special way. By default, this simply calls
BlockEntity.loadWithComponents(ValueInput)
.- 参数:
input
- The data sent fromBlockEntity.getUpdateTag(HolderLookup.Provider)
-
getPersistentData
CompoundTag getPersistentData()Gets aCompoundTag
that can be used to store custom data for this block entity. It will be written, and read from disc, so it persists over world saves.- 返回:
- A compound tag for custom persistent data
-
onChunkUnloaded
default void onChunkUnloaded() -
onLoad
default void onLoad()Called when this is first added to the world (byLevelChunk.addAndRegisterBlockEntity(BlockEntity)
) or right before the first tick when the chunk is generated or loaded from disk. Override instead of addingif (firstTick)
stuff in update. -
requestModelDataUpdate
default void requestModelDataUpdate()Requests a refresh for the model data of your TE Call this every time yourgetModelData()
changes -
getModelData
Allows you to return additional model data. This data can be used to provide additional functionality in yourBlockStateModel
. You need to schedule a refresh of you model data viarequestModelDataUpdate()
if the result of this function changes.This method is always called on the main client thread.
- 返回:
- Your model data
-
invalidateCapabilities
@NonExtendable default void invalidateCapabilities()Notify all listeners that the capabilities at the positions of this block entity might have changed. This includes new capabilities becoming available.This is just a convenience method for
ILevelExtension.invalidateCapabilities(BlockPos)
.
-