Package: com.codex.composer.api.v1.block
Canonical Name: com.codex.composer.api.v1.block.AbstractPlushieBlock
Provides a rotatable, waterloggable plushie block.
Inheritors need to implement the following:
abstract void playSound(World world, BlockState state, BlockPos pos, PlayerEntity player);abstract BlockEntityType<AbstractPlushieBlockEntity> getType()/* Optional, defaults to composer's plush_boop statistic */Identifier boopStat() { return ModStatistics.PLUSH_BOOP; }
Example implementation:
From [Composer]
public class PlushBlock extends AbstractPlushieBlock {public PlushBlock(Settings settings) {... }//? if minecraft: >=1.20.4 {@Overrideprotected MapCodec<? extends BlockWithEntity> getCodec() {return BlockWithEntity.createCodec(PlushBlock::new);}//? }@Overrideprotected void playSound(World world, BlockState state, BlockPos pos, PlayerEntity player) {Vec3d mid = pos.toCenterPos();world.playSound(null, mid.x, mid.y, mid.z, ModSounds.LILBRO_SQUISH, SoundCategory.BLOCKS, 1f, 1f);}@Overrideprotected BlockEntityType<AbstractPlushieBlockEntity> getType() { return ModBlockEntities.PLUSH; }@Overridepublic @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state) {...}}