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


Java Render类代码示例

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


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

示例1: onInitGuiPost

import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
    if(!hasShownFirstGui)
    {
        hasShownFirstGui = true;

        //Add the layer renderers
        Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityLlama.class);
        if(renderer instanceof RenderLlama)
        {
            RenderLlama renderLlama = (RenderLlama)renderer;
            renderLlama.addLayer(new LayerFancyLlama(renderLlama));
        }
    }
}
 
开发者ID:iChun,项目名称:BetterThanLlamas,代码行数:17,代码来源:BetterThanLlamas.java

示例2: renderArm

import net.minecraft.client.renderer.entity.Render; //导入依赖的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

示例3: func_178095_a

import net.minecraft.client.renderer.entity.Render; //导入依赖的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: func_178095_a

import net.minecraft.client.renderer.entity.Render; //导入依赖的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

示例5: resetDisplayListModels

import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
public static void resetDisplayListModels()
{
    if (needResetModels)
    {
        needResetModels = false;
        SMCLog.info("Reset model renderers");

        for (Render render : mc.getRenderManager().getEntityRenderMap().values())
        {
            if (render instanceof RenderLiving)
            {
                RenderLiving renderliving = (RenderLiving)render;
                resetDisplayListModel(renderliving.getMainModel());
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:Shaders.java

示例6: renderArm

import net.minecraft.client.renderer.entity.Render; //导入依赖的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.Render; //导入依赖的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: onInitGuiPost

import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
    if(!hasShownFirstGui)
    {
        hasShownFirstGui = true;

        //Add the layer renderers
        Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityRabbit.class);
        if(renderer instanceof RenderRabbit)
        {
            RenderRabbit renderRabbit = (RenderRabbit)renderer;
            renderRabbit.addLayer(new LayerFancyBunny(renderRabbit));
        }
    }
}
 
开发者ID:iChun,项目名称:Better-Than-Bunnies,代码行数:17,代码来源:BetterThanBunnies.java

示例9: preInit

import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent evt) {
    MCDoom.instance.getGoreProperty().setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class);
    MCDoom.instance.getMaxGoreParticles().setConfigEntryClass(GuiConfigEntries.NumberSliderEntry.class);

    MinecraftForge.EVENT_BUS.register(screenEventHandler);
    MinecraftForge.EVENT_BUS.register(soundEventsHandler);
    registerItems();

    RenderingRegistry.registerEntityRenderingHandler(PlasmaBallEntity.class, new IRenderFactory<PlasmaBallEntity>() {
        @Override
        public Render<? super PlasmaBallEntity> createRenderFor(RenderManager manager) {
            return new RenderPlasmaBall(manager);
        }
    });

    loadWeaponRenderers();
}
 
开发者ID:jglrxavpok,项目名称:MCDoom,代码行数:19,代码来源:MCDoomClientProxy.java

示例10: register

import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
public static <ENTITY extends Entity> void register(Class<ENTITY> classes, final Class<? extends Render<ENTITY>> render)
{
	RenderingRegistry.registerEntityRenderingHandler(classes, new IRenderFactory<ENTITY>() {

		@Override
		public Render<ENTITY> createRenderFor(RenderManager manager) 
		{
			try
			{
				return render.getConstructor(RenderManager.class).newInstance(manager);
			}
			catch (Exception e)
			{
				e.printStackTrace();
			}

			return null;
		}
	});
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:21,代码来源:AetherEntityRenderingRegistry.java

示例11: injectModel

import net.minecraft.client.renderer.entity.Render; //导入依赖的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

示例12: sanitizeEntityRenderers

import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@SideOnly (Side.CLIENT)
public static void sanitizeEntityRenderers(RenderManager renderManager) {
    if (!hasSanitized) {
        try {
            for (Render<? extends Entity> render : renderManager.entityRenderMap.values()) {
                if (render != null) {
                    for (Field field : render.getClass().getDeclaredFields()) {
                        if (field.getType().equals(RenderItem.class)) {
                            field.setAccessible(true);
                            field.set(render, CCRenderItem.getOverridenRenderItem());
                        }
                    }
                }
            }
        } catch (Exception e) {
            throw new RuntimeException("Unable to reflect an EntityRenderer!", e);
        }
        hasSanitized = true;
    }
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:21,代码来源:ProxyClient.java

示例13: getOldRenderer

import net.minecraft.client.renderer.entity.Render; //导入依赖的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

示例14: createRenderFor

import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
@Override
public Render<E> createRenderFor(RenderManager manager) {
	try {
		return renderClass.getConstructor(RenderManager.class).newInstance(manager);
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:9,代码来源:EntityRenderFactory.java

示例15: setRenderHead

import net.minecraft.client.renderer.entity.Render; //导入依赖的package包/类
private void setRenderHead(EntityLivingBase entity, boolean setRender) {
    if (entity.getItemStackFromSlot(EntityEquipmentSlot.HEAD).getItem() == Itemss.PNEUMATIC_HELMET
            && (ConfigHandler.client.useHelmetModel || DateEventHandler.isIronManEvent())) {
        Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityRenderObject(entity);
        if (renderer instanceof RenderBiped) {
            ModelBiped modelBiped = (ModelBiped) ((RenderBiped) renderer).getMainModel();
            modelBiped.bipedHead.showModel = setRender;
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:11,代码来源:ClientEventHandler.java


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