本文整理汇总了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();
}
示例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));
}
示例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();
}
示例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");
}
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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;
}
}
示例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;
}
示例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;
}
}
}
示例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()));
}
示例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;
}
}
示例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());
}
示例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();
}