use of crazypants.enderio.base.render.property.EnumDecoBlock in project EnderIO by SleepyTrousers.
the class BlockDecoration method registerRenderers.
@Override
@SideOnly(Side.CLIENT)
public void registerRenderers(@Nonnull IModObject modObject) {
Item item = Item.getItemFromBlock(this);
Map<IBlockState, ModelResourceLocation> locations = new DefaultStateMapper().putStateModelLocations(this);
NNIterator<EnumDecoBlock> iterator = NNList.of(EnumDecoBlock.class).iterator();
while (iterator.hasNext()) {
EnumDecoBlock type = iterator.next();
IBlockState state = getDefaultState().withProperty(EnumDecoBlock.TYPE, type);
ModelResourceLocation mrl = locations.get(state);
if (mrl != null) {
ModelLoader.setCustomModelResourceLocation(item, EnumDecoBlock.getMetaFromType(type), mrl);
}
}
}
use of crazypants.enderio.base.render.property.EnumDecoBlock in project EnderIO by SleepyTrousers.
the class BlockDecoration method getSubBlocks.
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) {
NNIterator<EnumDecoBlock> iterator = NNList.of(EnumDecoBlock.class).iterator();
while (iterator.hasNext()) {
EnumDecoBlock type = iterator.next();
list.add(new ItemStack(this, 1, EnumDecoBlock.getMetaFromType(type)));
if (type == maxMeta) {
return;
}
}
}
use of crazypants.enderio.base.render.property.EnumDecoBlock in project EnderIO by SleepyTrousers.
the class BlockDecorationFacing method registerRenderers.
@Override
@SideOnly(Side.CLIENT)
public void registerRenderers(@Nonnull IModObject modObject) {
Item item = Item.getItemFromBlock(this);
Map<IBlockState, ModelResourceLocation> locations = new DefaultStateMapper().putStateModelLocations(this);
NNIterator<EnumDecoBlock> iterator = NNList.of(EnumDecoBlock.class).iterator();
while (iterator.hasNext()) {
EnumDecoBlock type = iterator.next();
IBlockState state = getDefaultState().withProperty(EnumDecoBlock.TYPE, type).withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false);
ModelResourceLocation mrl = locations.get(state);
if (mrl != null) {
ModelLoader.setCustomModelResourceLocation(item, EnumDecoBlock.getMetaFromType(type), mrl);
}
}
}
Aggregations