當前位置: 首頁>>代碼示例>>Java>>正文


Java LayerRenderer類代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.entity.layers.LayerRenderer的典型用法代碼示例。如果您正苦於以下問題:Java LayerRenderer類的具體用法?Java LayerRenderer怎麽用?Java LayerRenderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LayerRenderer類屬於net.minecraft.client.renderer.entity.layers包,在下文中一共展示了LayerRenderer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: RenderGuard

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
public RenderGuard(RenderManager renderManagerIn) {
	super(renderManagerIn, new ModelGuard(), 0.5F);

	LayerRenderer<?> layerrenderer = (LayerRenderer) this.layerRenderers.get(0);
	defaultModel = (ModelGuard) mainModel;

	addLayer(new LayerHeldItem(this));

	LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
		protected void initArmor() {
			modelLeggings = new ModelZombie(0.5F, true);
			modelArmor = new ModelZombie(1.0F, true);
		}
	};
	addLayer(layerbipedarmor);

	// addLayer(new LayerCape(this));

	this.defaultLayers = Lists.newArrayList(this.layerRenderers);

}
 
開發者ID:ToroCraft,項目名稱:ToroQuest,代碼行數:22,代碼來源:RenderGuard.java

示例2: replaceCapeLayer

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
private static void replaceCapeLayer(@Nonnull RenderPlayer renderLivingBase) {
  try {
    List<LayerRenderer<AbstractClientPlayer>> value = ReflectionHelper.getPrivateValue(RenderLivingBase.class, renderLivingBase, "layerRenderers",
        "field_177097_h");
    if (value != null) {
      LayerRenderer<AbstractClientPlayer> capeLayer = null;
      for (LayerRenderer<AbstractClientPlayer> layerRenderer : value) {
        if (layerRenderer instanceof LayerCape && !(layerRenderer instanceof CapeFilterLayer)) {
          capeLayer = layerRenderer;
          break;
        }
      }
      if (capeLayer != null) {
        renderLivingBase.addLayer(new CapeFilterLayer(capeLayer));
        value.remove(capeLayer);
      }
    }
  } catch (UnableToAccessFieldException e) {
    Log.warn("Unable to access RenderLivingBase.layerRenderers, reason: " + e);
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:22,代碼來源:UpgradeRenderManager.java

示例3: doRenderLayer

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
@Redirect(method = "renderLayers", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/entity/layers/LayerRenderer.doRenderLayer(Lnet/minecraft/entity/EntityLivingBase;FFFFFFF)V"))
@SuppressWarnings("unchecked")
private void doRenderLayer(LayerRenderer renderer, EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scaleIn) {
    LayerRenderEvent event = new LayerRenderEvent(entitylivingbaseIn, renderer);
    ClientAPI.EVENT_BUS.post(event);
    if (!event.isCancelled())
        renderer.doRenderLayer(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scaleIn);
}
 
開發者ID:ImpactDevelopment,項目名稱:ClientAPI,代碼行數:9,代碼來源:MixinRenderLivingBase.java

示例4: RenderZombie

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
public RenderZombie(RenderManager renderManagerIn)
{
    super(renderManagerIn, new ModelZombie(), 0.5F, 1.0F);
    LayerRenderer layerrenderer = (LayerRenderer)this.layerRenderers.get(0);
    this.field_82434_o = this.modelBipedMain;
    this.zombieVillagerModel = new ModelZombieVillager();
    this.addLayer(new LayerHeldItem(this));
    LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this)
    {
        protected void initArmor()
        {
            this.field_177189_c = new ModelZombie(0.5F, true);
            this.field_177186_d = new ModelZombie(1.0F, true);
        }
    };
    this.addLayer(layerbipedarmor);
    this.field_177122_o = Lists.newArrayList(this.layerRenderers);

    if (layerrenderer instanceof LayerCustomHead)
    {
        this.removeLayer(layerrenderer);
        this.addLayer(new LayerCustomHead(this.zombieVillagerModel.bipedHead));
    }

    this.removeLayer(layerbipedarmor);
    this.addLayer(new LayerVillagerArmor(this));
    this.field_177121_n = Lists.newArrayList(this.layerRenderers);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:29,代碼來源:RenderZombie.java

示例5: renderLayers

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
protected void renderLayers(T entitylivingbaseIn, float p_177093_2_, float p_177093_3_, float partialTicks, float p_177093_5_, float p_177093_6_, float p_177093_7_, float p_177093_8_)
{
    for (LayerRenderer<T> layerrenderer : this.layerRenderers)
    {
        boolean flag = this.setBrightness(entitylivingbaseIn, partialTicks, layerrenderer.shouldCombineTextures());
        layerrenderer.doRenderLayer(entitylivingbaseIn, p_177093_2_, p_177093_3_, partialTicks, p_177093_5_, p_177093_6_, p_177093_7_, p_177093_8_);

        if (flag)
        {
            this.unsetBrightness();
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:14,代碼來源:RendererLivingEntity.java

示例6: RenderTreater

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
private RenderTreater(RenderManager renderManager, ModelBase model)
{
	super(renderManager, model, 0.25F);

	this.defaultTreaterModel = this.mainModel;
	this.spiderTreaterModel = new ModelTreaterSpider();

	this.defaultLayers = Lists.newArrayList(this.layerRenderers);
	this.creeperLayers = Collections.singletonList((LayerRenderer<EntityTreater>)new LayerTreaterCreeper(this));
	this.witchLayers = Collections.singletonList((LayerRenderer<EntityTreater>)new LayerWitchClothes(this));
}
 
開發者ID:crazysnailboy,項目名稱:Halloween,代碼行數:12,代碼來源:RenderTreater.java

示例7: makeEntityRender

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize)
{
    RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
    Render render = (Render)rendermanager.getEntityRenderMap().get(EntitySheep.class);

    if (!(render instanceof RenderSheep))
    {
        Config.warn("Not a RenderSheep: " + render);
        return null;
    }
    else
    {
        if (render.getEntityClass() == null)
        {
            RenderSheep rendersheep = new RenderSheep(rendermanager);
            rendersheep.mainModel = new ModelSheep2();
            rendersheep.shadowSize = 0.7F;
            render = rendersheep;
        }

        RenderSheep rendersheep1 = (RenderSheep)render;
        List<LayerRenderer<EntitySheep>> list = rendersheep1.getLayerRenderers();
        Iterator iterator = list.iterator();

        while (iterator.hasNext())
        {
            LayerRenderer layerrenderer = (LayerRenderer)iterator.next();

            if (layerrenderer instanceof LayerSheepWool)
            {
                iterator.remove();
            }
        }

        LayerSheepWool layersheepwool = new LayerSheepWool(rendersheep1);
        layersheepwool.sheepModel = (ModelSheep1)modelBase;
        rendersheep1.addLayer(layersheepwool);
        return rendersheep1;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:41,代碼來源:ModelAdapterSheepWool.java

示例8: renderLayers

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
protected void renderLayers(T entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scaleIn)
{
    for (LayerRenderer<T> layerrenderer : this.layerRenderers)
    {
        boolean flag = this.setBrightness(entitylivingbaseIn, partialTicks, layerrenderer.shouldCombineTextures());
        layerrenderer.doRenderLayer(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scaleIn);

        if (flag)
        {
            this.unsetBrightness();
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:14,代碼來源:RenderLivingBase.java

示例9: RenderZombie

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
public RenderZombie(RenderManager renderManagerIn)
{
    super(renderManagerIn, new ModelZombie(), 0.5F, 1.0F);
    LayerRenderer<?> layerrenderer = (LayerRenderer)this.layerRenderers.get(0);
    this.defaultModel = this.modelBipedMain;
    this.zombieVillagerModel = new ModelZombieVillager();
    this.addLayer(new LayerHeldItem(this));
    LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this)
    {
        protected void initArmor()
        {
            this.modelLeggings = new ModelZombie(0.5F, true);
            this.modelArmor = new ModelZombie(1.0F, true);
        }
    };
    this.addLayer(layerbipedarmor);
    this.defaultLayers = Lists.newArrayList(this.layerRenderers);

    if (layerrenderer instanceof LayerCustomHead)
    {
        this.removeLayer(layerrenderer);
        this.addLayer(new LayerCustomHead(this.zombieVillagerModel.bipedHead));
    }

    this.removeLayer(layerbipedarmor);
    this.addLayer(new LayerVillagerArmor(this));
    this.villagerLayers = Lists.newArrayList(this.layerRenderers);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:29,代碼來源:RenderZombie.java

示例10: getElytraLayer

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
@Override
protected LayerRenderer<EntityLivingBase> getElytraLayer() {
    final LayerRenderer<EntityLivingBase> elytra = super.getElytraLayer();
    final ModelPonyElytra modelElytra = new ModelPonyElytra();
    return new AbstractPonyLayer<EntityLivingBase>(this, elytra) {

        @Override
        public void doPonyRender(EntityLivingBase entityBase, float swing, float swingAmount, float ticks, float age, float yaw, float head,
                float scale) {

            EntityPonyModel entity = (EntityPonyModel) entityBase;

            ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.CHEST);

            if (itemstack.getItem() == Items.ELYTRA) {
                GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

                bindTexture(entity.getElytraTexture());

                GlStateManager.pushMatrix();
                GlStateManager.translate(0.0F, 0.25F, 0.125F);
                ((AbstractPonyModel) mainModel).transform(BodyPart.BODY);

                modelElytra.setRotationAngles(swing, swingAmount, age, yaw, head, scale, entity);
                modelElytra.render(entity, swing, swingAmount, age, yaw, head, scale);


                GlStateManager.popMatrix();
            }
        }

    };
}
 
開發者ID:MineLittlePony,項目名稱:MineLittlePony,代碼行數:34,代碼來源:RenderPonyModel.java

示例11: getElytraLayer

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
protected LayerRenderer<EntityLivingBase> getElytraLayer() {
    final ModelElytra modelElytra = new ModelElytra();
    return new LayerRenderer<EntityLivingBase>() {
        @Override
        public void doRenderLayer(EntityLivingBase entityBase, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
            EntityPlayerModel entity = (EntityPlayerModel) entityBase;
            ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.CHEST);

            if (itemstack.getItem() == Items.ELYTRA) {
                GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                GlStateManager.enableBlend();
                GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);

                bindTexture(entity.getElytraTexture());

                GlStateManager.pushMatrix();
                GlStateManager.translate(0.0F, 0.0F, 0.125F);

                modelElytra.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entity);
                modelElytra.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);

                GlStateManager.disableBlend();
                GlStateManager.popMatrix();
            }
        }

        @Override
        public boolean shouldCombineTextures() {
            return false;
        }
    };
}
 
開發者ID:MineLittlePony,項目名稱:MineLittlePony,代碼行數:33,代碼來源:RenderPlayerModel.java

示例12: init_RenderBendsPlayer

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
public static <V extends EntityLivingBase, U extends LayerRenderer<V>> void init_RenderBendsPlayer(RenderBendsPlayer render) {
	render.addLayer(new BaublesRenderLayer());
	try {
		U layer = $("Lvazkii.botania.client.core.handler.ContributorFancinessHandler", "new");
		if (layer != null)
			render.addLayer(layer);
		layer = $("Lvazkii.botania.client.core.handler.BaubleRenderHandler", "new");
		if (layer != null)
			render.addLayer(layer);
		layer = $("Lvazkii.botania.client.render.entity.LayerGaiaHead", "new", render.getMainModel().bipedHead);
		if (layer != null)
			render.addLayer(layer);
	} catch (Exception e) { }
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:15,代碼來源:ExMobends.java

示例13: renderLayers

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
@Override
protected void renderLayers(EntityTameableDragon dragon, float moveTime,
        float moveSpeed, float partialTicks, float ticksExisted, float lookYaw,
        float lookPitch, float scale) {
    List<LayerRenderer<EntityTameableDragon>> layers = getBreedRenderer(dragon).getLayers();
    layers.forEach(layer -> {
        boolean brighnessSet = setBrightness(dragon, partialTicks,
                layer.shouldCombineTextures());
        layer.doRenderLayer(dragon, moveTime, moveSpeed, partialTicks,
                ticksExisted, lookYaw, lookPitch, scale);
        if (brighnessSet) {
            unsetBrightness();
        }
    });
}
 
開發者ID:ata4,項目名稱:dragon-mounts,代碼行數:16,代碼來源:DragonRenderer.java

示例14: RenderZombieVillager

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public RenderZombieVillager(RenderManager p_i46127_1_) {
    super(p_i46127_1_, new ModelZombie(), 0.5F, 1.0F);
    final LayerRenderer layerrenderer = (LayerRenderer) this.layerRenderers.get(0);
    this.field_82434_o = this.modelBipedMain;
    this.zombieVillagerProfessionModel = new ModelZombieVillagerProfession();
    this.addLayer(new LayerHeldItem(this));
    final LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this)
    {
        @Override
        protected void func_177177_a()
        {
            this.field_177189_c = new ModelZombie(0.5F, true);
            this.field_177186_d = new ModelZombie(1.0F, true);
        }
    };
    this.addLayer(layerbipedarmor);
    this.field_177122_o = Lists.newArrayList(this.layerRenderers);

    if (layerrenderer instanceof LayerCustomHead) {
        this.removeLayer(layerrenderer);
        this.addLayer(new LayerCustomHead(this.zombieVillagerProfessionModel.bipedHead));
    }

    this.removeLayer(layerbipedarmor);
    this.addLayer(new LayerVillagerArmor(this));
    this.field_177121_n = Lists.newArrayList(this.layerRenderers);
}
 
開發者ID:sidben,項目名稱:VillagerTweaks,代碼行數:29,代碼來源:RenderZombieVillager.java

示例15: LayerRenderEvent

import net.minecraft.client.renderer.entity.layers.LayerRenderer; //導入依賴的package包/類
public LayerRenderEvent(EntityLivingBase entity, LayerRenderer layerRenderer) {
    this.entity = entity;
    this.layerRenderer = layerRenderer;
}
 
開發者ID:ImpactDevelopment,項目名稱:ClientAPI,代碼行數:5,代碼來源:LayerRenderEvent.java


注:本文中的net.minecraft.client.renderer.entity.layers.LayerRenderer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。