Interface FabricBlockStateParticleEffect
public interface FabricBlockStateParticleEffect
Note: This interface is automatically implemented on
BlockStateParticleEffect
via Mixin and interface injection.-
Method Summary
Modifier and TypeMethodDescriptionstatic BlockStateParticleEffect
create
(ParticleType<BlockStateParticleEffect> type, BlockState blockState, @Nullable BlockPos blockPos) Alternative forBlockStateParticleEffect(ParticleType, BlockState)
that also accepts aBlockPos
.default @Nullable BlockPos
-
Method Details
-
create
static BlockStateParticleEffect create(ParticleType<BlockStateParticleEffect> type, BlockState blockState, @Nullable @Nullable BlockPos blockPos) Alternative forBlockStateParticleEffect(ParticleType, BlockState)
that also accepts aBlockPos
. This method should be used instead of the vanilla constructor when the block state is retrieved using a block pos, most commonly throughBlockView.getBlockState(BlockPos)
. This ensures that any particles created from this effect use an accurate pos for any client-side logic.If an instance with a non-null block pos needs to be synced to the client, the block pos will only be synced if it is known that the client supports decoding it (has this Fabric API module installed); otherwise, the effect will be sent as a vanilla effect and the client will produce a null block pos.
- Parameters:
type
- the particle typeblockState
- the block stateblockPos
- the block pos from which the block state was retrieved- Returns:
- the particle effect
-
getBlockPos
- Returns:
- the block pos from which the block state was
retrieved, or
null
if not applicable or this instance was synced from a remote server that does not have this Fabric API module installed
-