Interface IClientBlockExtensions
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanaddDestroyEffects(BlockState state, Level Level, BlockPos pos, ParticleEngine manager) Spawn particles for when the block is destroyed.default booleanaddHitEffects(BlockState state, Level level, @Nullable HitResult target, ParticleEngine manager) Spawn a digging particle effect in the level, this is a wrapper around EffectRenderer.addBlockHitEffects to allow the block more control over the particles.default voidcollectDynamicTintValues(BlockState state, BlockAndTintGetter level, BlockPos pos, it.unimi.dsi.fastutil.ints.IntList tintValues) Collect tint values for blocks with a dynamic tint layer count.default Vector3dgetFogColor(BlockState state, LevelReader level, BlockPos pos, Entity entity, Vector3d originalColor, float partialTick) NOT CURRENTLY IMPLEMENTEDstatic IClientBlockExtensionsstatic IClientBlockExtensionsof(BlockState state) default booleanplayBreakSound(BlockState state, Level level, BlockPos pos) Play breaking sound(s) when the block is destroyed.default booleanplayHitSound(BlockState state, Level level, BlockPos pos, Direction face, SoundManager soundManager) Play hit sound(s) when the block is punched.
-
Field Details
-
DEFAULT
-
-
Method Details
-
of
-
of
-
addHitEffects
default boolean addHitEffects(BlockState state, Level level, @Nullable HitResult target, ParticleEngine manager) Spawn a digging particle effect in the level, this is a wrapper around EffectRenderer.addBlockHitEffects to allow the block more control over the particles. Useful when you have entirely different texture sheets for different sides/locations in the level.- Parameters:
state- The current statelevel- The current leveltarget- The target the player is looking at {x/y/z/side/sub}, if availablemanager- A reference to the current particle manager.- Returns:
- True to prevent vanilla digging particles form spawning.
-
addDestroyEffects
default boolean addDestroyEffects(BlockState state, Level Level, BlockPos pos, ParticleEngine manager) Spawn particles for when the block is destroyed. Due to the nature of how this is invoked, the x/y/z locations are not always guaranteed to host your block. So be sure to do proper sanity checks before assuming that the location is this block.- Parameters:
Level- The current Levelpos- Position to spawn the particlemanager- A reference to the current particle manager.- Returns:
- True to prevent vanilla break particles from spawning.
-
playHitSound
default boolean playHitSound(BlockState state, Level level, BlockPos pos, Direction face, SoundManager soundManager) Play hit sound(s) when the block is punched.- Parameters:
state- The current statelevel- The current levelpos- The position of the blockface- The face of the block that was hitsoundManager- The sound manager to play the sound(s) through- Returns:
- True to prevent vanilla hit sounds from playing
-
playBreakSound
Play breaking sound(s) when the block is destroyed. This allows playing sounds dependent on BE data as it is called before the block and BE are actually removed on the client.- Parameters:
state- The current statelevel- The current levelpos- The position of the block- Returns:
- True to prevent vanilla break sounds from playing
-
getFogColor
default Vector3d getFogColor(BlockState state, LevelReader level, BlockPos pos, Entity entity, Vector3d originalColor, float partialTick) NOT CURRENTLY IMPLEMENTEDUse this to change the fog color used when the entity is "inside" a material. Vec3d is used here as "r/g/b" 0 - 1 values.
- Parameters:
state- The state at the entity viewport.level- The level.pos- The position at the entity viewport.entity- the entityoriginalColor- The current fog color, You are not expected to use this, Return as the default if applicable.- Returns:
- The new fog color.
-
collectDynamicTintValues
default void collectDynamicTintValues(BlockState state, BlockAndTintGetter level, BlockPos pos, it.unimi.dsi.fastutil.ints.IntList tintValues) Collect tint values for blocks with a dynamic tint layer count.
Tint values must be appended to the provided list such that their index in the list matches the tint index specified by the quad(s) that should be affected by them.
Intended to be used by blocks which imitate other blocks and pull their tint values from the imitated block. This method is only called when
BlockColors.getTintSources(BlockState)returns an empty list for the block these extensions are associated to.- Parameters:
state- The block state whose tint values are being queriedlevel- The level in which the block is being renderedpos- The position at which the block is being renderedtintValues- The list to append the tint values to
-