MetaAwareBlocks
This library provides functionality for working with block metadata in various rendering functions from the net.minecraft.block.Block class.
Current Status and Compatibility
Currently, the library only transforms native Minecraft code. Support for other mods is not planned in the near future, as ensuring compatibility with them represents significant technical challenges. The system requires creating specialized mixins for each individual mod, which is not a practical solution. If other developers want to add support for additional mods through pull requests, this will be welcomed.
Library Usage
Creating a New Block
class NewBlock implements IMetaAware {
...
@Override
public boolean renderAsNormalBlock(IBlockAccess world, int x, int y, int z) {
return world.getBlockMetadata(world, x, y, z) != 0;
}
...
}
Adding Functionality to an Existing Block
@Mixin(NewBlock.class)
public abstract class MixinNewBlock implements IMetaAware {
@Override
public boolean renderAsNormalBlock(IBlockAccess world, int x, int y, int z) {
return world.getBlockMetadata(world, x, y, z) != 0;
}
}