Disassembling

There are three different objects that can be disassembled: Blocks, Entities, and Items. Here are some examples:

// Blocks
Disassembler.getBlock(Blocks.GRASS_BLOCK.getDefaultState(), new BlockPos(0, 0, 0), level, null);

// Block Entities
Disassembler.getBlockEntity(level.getBlockEntity(new BlockPos(0, 0, 0)), null);

// Entities
Disassembler.getEntity(new CowEntity(EntityTypes.COW_ENTITY, level), null);

// Items
Disassembler.getItem(Items.APPLE, null); 

For each type of object, the disassembler returns a Pattern which contains quad information. Each pattern generated is automatically beamed to the server, but you're also returned a local copy on the client.

Each buffer will be synced to the server on the next tick. From the server, you can access the patterns by calling:

// Blocks
PatternBuffer.getBlock(Block.getId(Blocks.GRASS_BLOCK));

// Block Entities
PatternBuffer.getBlock(Block.getId(Blocks.CHEST));

// Entities
PatternBuffer.getEntity(Entity.getId(EntityTypes.COW_ENTITY));

// Items
PatternBuffer.getItem(Item.getId(Items.APPLE));

Last updated