當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。