java类net.minecraft.client.renderer.block.statemap.DefaultStateMapper的实例源码

BlockDetector.java 文件源码 项目:EnderIO 阅读 16 收藏 0 点赞 0 评论 0
@Override
@SideOnly(Side.CLIENT)
public void registerRenderers(@Nonnull IModObject modObject) {
  Item item = Item.getItemFromBlock(this);
  Map<IBlockState, ModelResourceLocation> locations = new DefaultStateMapper().putStateModelLocations(this);
  IBlockState state = getDefaultState().withProperty(IS_ON, true).withProperty(FACING, EnumFacing.UP);
  ModelResourceLocation mrl = locations.get(state);
  ModelLoader.setCustomModelResourceLocation(item, 0, mrl);
}
BlockDecoration.java 文件源码 项目:EnderIO 阅读 17 收藏 0 点赞 0 评论 0
@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);
    ModelLoader.setCustomModelResourceLocation(item, EnumDecoBlock.getMetaFromType(type), mrl);
  }
}
BlockDecorationFacing.java 文件源码 项目:EnderIO 阅读 16 收藏 0 点赞 0 评论 0
@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);
    ModelLoader.setCustomModelResourceLocation(item, EnumDecoBlock.getMetaFromType(type), mrl);
  }
}


问题


面经


文章

微信
公众号

扫码关注公众号