当前位置: 首页>>代码示例>>Java>>正文


Java RenderPlayer.getMainModel方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.entity.RenderPlayer.getMainModel方法的典型用法代码示例。如果您正苦于以下问题:Java RenderPlayer.getMainModel方法的具体用法?Java RenderPlayer.getMainModel怎么用?Java RenderPlayer.getMainModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.entity.RenderPlayer的用法示例。


在下文中一共展示了RenderPlayer.getMainModel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: injectModel

import net.minecraft.client.renderer.entity.RenderPlayer; //导入方法依赖的package包/类
void injectModel(EntityPlayer player) {
    Minecraft mc = Minecraft.getMinecraft();
    Render<EntityPlayer> pr = mc.getRenderManager().getEntityRenderObject(player);
    if (!((Render) pr instanceof RenderPlayer)) {
        if (!invalid) {
            Core.logWarning("Unable to patch Player model!");
        }
        invalid = true;
        return;
    }
    RenderPlayer playerRenderer = (RenderPlayer) (Render) pr;
    ModelRenderer head = playerRenderer.getMainModel().bipedHead;
    if (head.childModels != null) {
        for (Iterator<ModelRenderer> it = head.childModels.iterator(); it.hasNext(); ) {
            ModelRenderer child = it.next();
            if (child instanceof LmpMaskRenderer) {
                it.remove();
            }

        }
    }
    head.addChild(new LmpMaskRenderer(playerRenderer.getMainModel()));
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:24,代码来源:NeptuneCape.java

示例2: replaceOldModel

import net.minecraft.client.renderer.entity.RenderPlayer; //导入方法依赖的package包/类
public static void replaceOldModel() {
    RenderPlayer renderer = getOldRenderer("default");
    if(renderer == null) {
        InfinityLib.instance.getLogger().debug("Failed overriding left arm swing behaviour");
        return;
    }
    ModelPlayer oldModel = renderer.getMainModel();
    ModelPlayer newModel = null;
    for(Field field : RenderLivingBase.class.getDeclaredFields()) {
        if(field.getType() == ModelBase.class) {
            try {
                field.setAccessible(true);
                Object obj = field.get(renderer);
                if (obj == oldModel) {
                    newModel = MODEL_MAIN;
                    field.set(renderer, newModel);
                    break;
                }
            } catch (Exception e) {
                InfinityLib.instance.getLogger().printStackTrace(e);
            }
        }
    }
    if(newModel != null) {
        //replace relevant fields in RenderPlayer
        replaceEntriesInRenderPlayer(renderer, newModel);
        replaceEntriesInRenderPlayer(getOldRenderer("slim"), MODEL_SLIM);
    }
}
 
开发者ID:InfinityRaider,项目名称:InfinityLib,代码行数:30,代码来源:ModelPlayerCustomized.java

示例3: getTarget

import net.minecraft.client.renderer.entity.RenderPlayer; //导入方法依赖的package包/类
private static ModelBiped getTarget(RenderPlayer render, ModelBase chest, ModelBase legs, boolean onBack) {
    if (chest instanceof ModelBiped) {
        return (ModelBiped) chest;
    } else if (legs instanceof ModelBiped && !onBack) {
        return (ModelBiped) legs;
    }
    return render.getMainModel();
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:9,代码来源:BattlegearRenderHelper.java


注:本文中的net.minecraft.client.renderer.entity.RenderPlayer.getMainModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。