Interface ILevelExtension
- All Known Implementing Classes:
- ClientLevel,- Level,- ServerLevel
- 
Method SummaryModifier and TypeMethodDescriptiondefault <T,C> T getCapability(BlockCapability<T, C> cap, BlockPos pos, C context) Retrieve a block capability.default <T,C> T getCapability(BlockCapability<T, C> cap, BlockPos pos, @Nullable BlockState state, @Nullable BlockEntity blockEntity, C context) Retrieve a block capability.doubleThe maximum radius to scan for entities when trying to check bounding boxes.default @Nullable ModelDataManagerRetrieves the model data manager for the given level.default Collection<PartEntity<?>> All part entities in this world.doubleincreaseMaxEntityRadius(double value) Increases the max entity radius, this is safe to call with any value.default voidNotify all listeners that the capabilities at a specific position might have changed.default voidNotify all listeners that the capabilities at all the positions in a chunk might have changed.private Levelself()
- 
Method Details- 
self
- 
getMaxEntityRadiusdouble getMaxEntityRadius()The maximum radius to scan for entities when trying to check bounding boxes. Vanilla's default is 2.0D But mods that add larger entities may increase this.
- 
increaseMaxEntityRadiusdouble increaseMaxEntityRadius(double value) Increases the max entity radius, this is safe to call with any value. The setter will verify the input value is larger then the current setting.- Parameters:
- value- New max radius to set.
- Returns:
- The new max radius
 
- 
getPartEntitiesAll part entities in this world. Used when collecting entities in an AABB to fix parts being ignored whose parent entity is in a chunk that does not intersect with the AABB.
- 
getModelDataManagerRetrieves the model data manager for the given level. May be null on a server level.For model data retrieval, prefer calling IBlockGetterExtension.getModelData(BlockPos)rather than this method, as it works on more than just a level.
- 
getCapabilityRetrieve a block capability.If the block state and/or the block entity is known, pass them via getCapability(BlockCapability, BlockPos, BlockState, BlockEntity, Object)instead.
- 
getCapability@Nullable default <T,C> T getCapability(BlockCapability<T, C> cap, BlockPos pos, @Nullable @Nullable BlockState state, @Nullable @Nullable BlockEntity blockEntity, C context) Retrieve a block capability.Use this override if the block state and/or the block entity is known, otherwise prefer the shorter getCapability(BlockCapability, BlockPos, Object).If either the block state or the block entity is unknown, simply pass null. This function will fetchnullparameters from the level, with some extra checks to attempt to skip unnecessary fetches.- Parameters:
- state- the block state, if known, or- nullif unknown
- blockEntity- the block entity, if known, or- nullif unknown
 
- 
invalidateCapabilitiesNotify all listeners that the capabilities at a specific position might have changed. This includes new capabilities becoming available.This method will only do something on ServerLevels, but it is safe to call on anyLevel, without the need for aninstanceofcheck.If you already have a block entity at that position, you can call IBlockEntityExtension.invalidateCapabilities()instead.
- 
invalidateCapabilitiesNotify all listeners that the capabilities at all the positions in a chunk might have changed. This includes new capabilities becoming available.This method will only do something on ServerLevels, but it is safe to call on anyLevel, without the need for aninstanceofcheck.
 
-