HtmlConversionTypesetter.java 文件源码

java
阅读 15 收藏 0 点赞 0 评论 0

项目:Factorization 作者:
@Override
public void putItem(ItemStack theItem, String link) {
    String imgType = "item";
    String found_icon;
    if (theItem == null) {
        found_icon = "factorization:transparent_item";
    } else {
        ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
        IBakedModel ibm = mesher.getItemModel(theItem);
        if (ibm == null) {
            found_icon = "error";
        } else {
            found_icon = ibm.getParticleTexture().getIconName();
        }
        if (theItem.getItem() instanceof ItemBlock) {
            imgType = "block";
        }
    }
    html("<img class=\"" + imgType + "\" src=\"" + img(found_icon) + "\" />");
    found_icon = null;
    // TODO (and this is crazy!) render the item to a texture
    // Would be good to do this only if it isn't a standard item texture, maybe.
    // Same mechanism could probably be used for docfigures; maybe make an animated gif? Would be rad.
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号