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


Java RenderPlayer类代码示例

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


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

示例1: renderArm

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
private static void renderArm(EnumHandSide p_187455_1_) {
	Minecraft mc = Minecraft.getMinecraft();

	mc.getTextureManager().bindTexture(mc.player.getLocationSkin());
	Render<AbstractClientPlayer> render = mc.getRenderManager()
			.<AbstractClientPlayer>getEntityRenderObject(mc.player);
	RenderPlayer renderplayer = (RenderPlayer) render;
	GlStateManager.pushMatrix();
	float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
	GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
	GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
	GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
	GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);

	if (p_187455_1_ == EnumHandSide.RIGHT) {
		renderplayer.renderRightArm(mc.player);
	} else {
		renderplayer.renderLeftArm(mc.player);
	}

	GlStateManager.popMatrix();
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:23,代码来源:SeeingStoneHandler.java

示例2: init

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
@Override
public void init()
{
    ClientRegistry.registerKeyBinding(keyOpenToolMenu =
            new KeyBinding("key.toolbelt.open", Keyboard.KEY_R, "key.toolbelt.category"));
    //keyOpenToolMenu.

    ClientRegistry.registerKeyBinding(keyCycleToolMenuL =
            new KeyBinding("key.toolbelt.cycle.left", 0, "key.toolbelt.category"));

    ClientRegistry.registerKeyBinding(keyCycleToolMenuR =
            new KeyBinding("key.toolbelt.cycle.right", 0, "key.toolbelt.category"));

    Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();

    RenderPlayer render = skinMap.get("default");
    render.addLayer(new LayerToolBelt(render));

    render = skinMap.get("slim");
    render.addLayer(new LayerToolBelt(render));
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:22,代码来源:ClientProxy.java

示例3: func_178095_a

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
private void func_178095_a(AbstractClientPlayer clientPlayer, float p_178095_2_, float p_178095_3_)
{
    float f = -0.3F * MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI);
    float f1 = 0.4F * MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI * 2.0F);
    float f2 = -0.4F * MathHelper.sin(p_178095_3_ * (float)Math.PI);
    GlStateManager.translate(f, f1, f2);
    GlStateManager.translate(0.64000005F, -0.6F, -0.71999997F);
    GlStateManager.translate(0.0F, p_178095_2_ * -0.6F, 0.0F);
    GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
    float f3 = MathHelper.sin(p_178095_3_ * p_178095_3_ * (float)Math.PI);
    float f4 = MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI);
    GlStateManager.rotate(f4 * 70.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(f3 * -20.0F, 0.0F, 0.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(clientPlayer.getLocationSkin());
    GlStateManager.translate(-1.0F, 3.6F, 3.5F);
    GlStateManager.rotate(120.0F, 0.0F, 0.0F, 1.0F);
    GlStateManager.rotate(200.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.scale(1.0F, 1.0F, 1.0F);
    GlStateManager.translate(5.6F, 0.0F, 0.0F);
    Render<AbstractClientPlayer> render = this.renderManager.<AbstractClientPlayer>getEntityRenderObject(this.mc.thePlayer);
    GlStateManager.disableCull();
    RenderPlayer renderplayer = (RenderPlayer)render;
    renderplayer.renderRightArm(this.mc.thePlayer);
    GlStateManager.enableCull();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:ItemRenderer.java

示例4: register

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
public static void register(Map p_register_0_)
{
    Set set = p_register_0_.keySet();
    boolean flag = false;

    for (Object object : set)
    {
        Object object1 = p_register_0_.get(object);

        if (object1 instanceof RenderPlayer)
        {
            RenderPlayer renderplayer = (RenderPlayer)object1;
            renderplayer.addLayer(new PlayerItemsLayer(renderplayer));
            flag = true;
        }
    }

    if (!flag)
    {
        Config.warn("PlayerItemsLayer not registered");
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:23,代码来源:PlayerItemsLayer.java

示例5: func_178095_a

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
private void func_178095_a(AbstractClientPlayer clientPlayer, float p_178095_2_, float p_178095_3_)
{
    float f = -0.3F * MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI);
    float f1 = 0.4F * MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI * 2.0F);
    float f2 = -0.4F * MathHelper.sin(p_178095_3_ * (float)Math.PI);
    GlStateManager.translate(f, f1, f2);
    GlStateManager.translate(0.64000005F, -0.6F, -0.71999997F);
    GlStateManager.translate(0.0F, p_178095_2_ * -0.6F, 0.0F);
    GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
    float f3 = MathHelper.sin(p_178095_3_ * p_178095_3_ * (float)Math.PI);
    float f4 = MathHelper.sin(MathHelper.sqrt_float(p_178095_3_) * (float)Math.PI);
    GlStateManager.rotate(f4 * 70.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(f3 * -20.0F, 0.0F, 0.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(clientPlayer.getLocationSkin());
    GlStateManager.translate(-1.0F, 3.6F, 3.5F);
    GlStateManager.rotate(120.0F, 0.0F, 0.0F, 1.0F);
    GlStateManager.rotate(200.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.scale(1.0F, 1.0F, 1.0F);
    GlStateManager.translate(5.6F, 0.0F, 0.0F);
    Render render = this.renderManager.getEntityRenderObject(this.mc.thePlayer);
    GlStateManager.disableCull();
    RenderPlayer renderplayer = (RenderPlayer)render;
    renderplayer.renderRightArm(this.mc.thePlayer);
    GlStateManager.enableCull();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:27,代码来源:ItemRenderer.java

示例6: renderArm

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
private void renderArm(EnumHandSide p_187455_1_)
{
    this.mc.getTextureManager().bindTexture(this.mc.player.getLocationSkin());
    Render<AbstractClientPlayer> render = this.renderManager.<AbstractClientPlayer>getEntityRenderObject(this.mc.player);
    RenderPlayer renderplayer = (RenderPlayer)render;
    GlStateManager.pushMatrix();
    float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
    GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
    GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);

    if (p_187455_1_ == EnumHandSide.RIGHT)
    {
        renderplayer.renderRightArm(this.mc.player);
    }
    else
    {
        renderplayer.renderLeftArm(this.mc.player);
    }

    GlStateManager.popMatrix();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:ItemRenderer.java

示例7: renderArm

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
private void renderArm(EnumHandSide p_187455_1_)
{
    this.mc.getTextureManager().bindTexture(this.mc.thePlayer.getLocationSkin());
    Render<AbstractClientPlayer> render = this.renderManager.<AbstractClientPlayer>getEntityRenderObject(this.mc.thePlayer);
    RenderPlayer renderplayer = (RenderPlayer)render;
    GlStateManager.pushMatrix();
    float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
    GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
    GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);

    if (p_187455_1_ == EnumHandSide.RIGHT)
    {
        renderplayer.renderRightArm(this.mc.thePlayer);
    }
    else
    {
        renderplayer.renderLeftArm(this.mc.thePlayer);
    }

    GlStateManager.popMatrix();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:ItemRenderer.java

示例8: renderEquippedGlove

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
@SubscribeEvent
public void renderEquippedGlove(final RenderPlayerEvent.Specials.Post event) {
    if (event.entityPlayer == null) {
        return;
    }
    final ItemStack heldItem = event.entityPlayer.getHeldItem();
    if (heldItem == null || heldItem.getItem() != ExtraUtils.glove) {
        return;
    }
    final int dmg = heldItem.getItemDamage();
    final RenderPlayer renderplayer = event.renderer;
    float[] col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(1, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove1);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
    col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(0, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove2);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:21,代码来源:RenderItemGlove.java

示例9: gunRenderEvent

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
@SubscribeEvent(priority=EventPriority.LOW)
public void gunRenderEvent(RenderPlayerEvent.Pre event) {

	ItemStack item = event.entityPlayer.getHeldItem();

	RenderPlayer rp = event.renderer;
	
	if (item != null && item.getItem() instanceof ItemGun) {
		
		rp.modelBipedMain.aimedBow = true;
		rp.modelArmor.aimedBow = true;
		rp.modelArmorChestplate.aimedBow = true;
	} 
	
	else {
		rp.modelBipedMain.aimedBow = false;
		rp.modelArmor.aimedBow = false;
		rp.modelArmorChestplate.aimedBow = false;
	}
}
 
开发者ID:TeamMonumental,项目名称:FissionWarfare,代码行数:21,代码来源:GunRenderEvent.java

示例10: getOldRenderer

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static RenderPlayer getOldRenderer(String keyword) {
    RenderManager manager = Minecraft.getMinecraft().getRenderManager();
    Map< Class <? extends Entity > , Render<? extends Entity >> entityRenderMap = manager.entityRenderMap;
    for(Field field : manager.getClass().getDeclaredFields()) {
        if(field.getType() == Map.class) {
            field.setAccessible(true);
            try {
                Object obj = field.get(manager);
                if(obj == entityRenderMap) {
                    continue;
                }
                Map<String, RenderPlayer> skinMap = (Map<String, RenderPlayer>) obj;
                return skinMap.get(keyword);
            } catch (IllegalAccessException e) {
                InfinityLib.instance.getLogger().printStackTrace(e);
            }
        }
    }
    return null;
}
 
开发者ID:InfinityRaider,项目名称:InfinityLib,代码行数:22,代码来源:ModelPlayerCustomized.java

示例11: replaceEntriesInRenderPlayer

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
private static void replaceEntriesInRenderPlayer(RenderPlayer renderer, ModelPlayer newModel) {
    if(renderer == null) {
        return;
    }
    //replace relevant fields in RenderPlayer
    for(Field field : RenderLivingBase.class.getDeclaredFields()) {
        if(field.getType() == ModelBase.class) {
            field.setAccessible(true);
            try {
                field.set(renderer, newModel);
            } catch (IllegalAccessException e) {
                InfinityLib.instance.getLogger().printStackTrace(e);
            }
            break;
        }
    }
}
 
开发者ID:InfinityRaider,项目名称:InfinityLib,代码行数:18,代码来源:ModelPlayerCustomized.java

示例12: 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

示例13: gunRenderEvent

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
@SubscribeEvent(priority=EventPriority.LOW)
public void gunRenderEvent(RenderPlayerEvent.Pre event) {

	ItemStack item = event.entityPlayer.getHeldItem();

	RenderPlayer rp = event.renderer;
	
	if (item != null && (item.getItem() instanceof ItemFusionGun || item.getItem() instanceof ItemRocketLauncher)) {

		rp.modelBipedMain.aimedBow = true;
		rp.modelArmor.aimedBow = true;
		rp.modelArmorChestplate.aimedBow = true;
	} else {
		rp.modelBipedMain.aimedBow = false;
		rp.modelArmor.aimedBow = false;
		rp.modelArmorChestplate.aimedBow = false;
	}
}
 
开发者ID:TeamMonumental,项目名称:FusionWarfare,代码行数:19,代码来源:GunRenderEvent.java

示例14: init

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
@Override
public void init() {
	super.init();
	Minecraft mc = Minecraft.getMinecraft();
	
	if (BackpacksContent.BACKPACK != null) {
		mc.getBlockColors().registerBlockColorHandler(BLOCK_COLOR, MiscUtils.getBlockFromItem(BackpacksContent.BACKPACK));
		mc.getItemColors().registerItemColorHandler(ITEM_COLOR, BackpacksContent.BACKPACK);
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBackpack.class, new RendererBackpack.TileEntity());
	}
	
	RenderManager manager = mc.getRenderManager();
	Map<String, RenderPlayer> skinMap = manager.getSkinMap();
	skinMap.get("default").addLayer(new RendererBackpack.Layer());
	skinMap.get("slim").addLayer(new RendererBackpack.Layer());
}
 
开发者ID:copygirl,项目名称:WearableBackpacks,代码行数:17,代码来源:ProxyClient.java

示例15: doRenderLayer

import net.minecraft.client.renderer.entity.RenderPlayer; //导入依赖的package包/类
@Override
public void doRenderLayer(@Nonnull RenderPlayer renderPlayer, EntityEquipmentSlot equipmentSlot, @Nonnull ItemStack piece,
    @Nonnull AbstractClientPlayer entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_,
    float p_177141_7_, float scale) {
  if (equipmentSlot != null) {
    return;
  }

  GlStateManager.pushMatrix();

  if (entitylivingbaseIn.isSneaking()) {
    GlStateManager.translate(0.0F, 0.2F, 0.0F);
  }

  renderPlayer.getMainModel().bipedHead.postRender(0.0625F);
  GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

  GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
  GlStateManager.scale(0.75f, 0.9f, 2);
  GlStateManager.translate(0.0F, 2.7f * 0.0625F, .49 * 0.0625F);

  Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, piece, TransformType.NONE);

  GlStateManager.popMatrix();
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:26,代码来源:MagnetLayer.java


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