Search in sources :

Example 1 with BlockStateRenderer

use of com.lowdragmc.lowdraglib.client.renderer.impl.BlockStateRenderer in project Multiblocked by Low-Drag-MC.

the class MBDBlockStateRenderer method createConfigurator.

@Override
public Supplier<IMultiblockedRenderer> createConfigurator(WidgetGroup parent, DraggableScrollableWidgetGroup group, IMultiblockedRenderer current) {
    BlockSelectorWidget blockSelectorWidget = new BlockSelectorWidget(0, 1, true);
    if (current instanceof BlockStateRenderer) {
        blockSelectorWidget.setBlock(((BlockStateRenderer) current).blockInfo.getBlockState());
    }
    group.addWidget(blockSelectorWidget);
    return () -> {
        if (blockSelectorWidget.getBlock() == null) {
            return null;
        } else {
            return new MBDBlockStateRenderer(blockSelectorWidget.getBlock());
        }
    };
}
Also used : BlockStateRenderer(com.lowdragmc.lowdraglib.client.renderer.impl.BlockStateRenderer) BlockSelectorWidget(com.lowdragmc.lowdraglib.gui.widget.BlockSelectorWidget)

Aggregations

BlockStateRenderer (com.lowdragmc.lowdraglib.client.renderer.impl.BlockStateRenderer)1 BlockSelectorWidget (com.lowdragmc.lowdraglib.gui.widget.BlockSelectorWidget)1