本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}
}
}
示例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));
}
示例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;
}
}
示例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();
}
}
}
示例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);
}
示例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();
}
}
};
}
示例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;
}
};
}
示例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) { }
}
示例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();
}
});
}
示例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);
}
示例15: LayerRenderEvent
import net.minecraft.client.renderer.entity.layers.LayerRenderer; //导入依赖的package包/类
public LayerRenderEvent(EntityLivingBase entity, LayerRenderer layerRenderer) {
this.entity = entity;
this.layerRenderer = layerRenderer;
}