2025-11-24 22:52:51 +03:00

43 lines
2.2 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.renderer.entity;
import net.minecraft.client.model.ZombifiedPiglinModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.renderer.entity.ArmorModelSet;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.HumanoidMobRenderer;
import net.minecraft.client.renderer.entity.PiglinRenderer;
import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer;
import net.minecraft.client.renderer.entity.state.ZombifiedPiglinRenderState;
import net.minecraft.resources.Identifier;
import net.minecraft.world.entity.monster.ZombifiedPiglin;
public class ZombifiedPiglinRenderer
extends HumanoidMobRenderer<ZombifiedPiglin, ZombifiedPiglinRenderState, ZombifiedPiglinModel> {
private static final Identifier ZOMBIFIED_PIGLIN_LOCATION = Identifier.withDefaultNamespace("textures/entity/piglin/zombified_piglin.png");
public ZombifiedPiglinRenderer(EntityRendererProvider.Context context, ModelLayerLocation body, ModelLayerLocation babyBody, ArmorModelSet<ModelLayerLocation> armorSet, ArmorModelSet<ModelLayerLocation> babyArmorSet) {
super(context, new ZombifiedPiglinModel(context.bakeLayer(body)), new ZombifiedPiglinModel(context.bakeLayer(babyBody)), 0.5f, PiglinRenderer.PIGLIN_CUSTOM_HEAD_TRANSFORMS);
this.addLayer(new HumanoidArmorLayer<ZombifiedPiglinRenderState, ZombifiedPiglinModel, ZombifiedPiglinModel>(this, ArmorModelSet.bake(armorSet, context.getModelSet(), ZombifiedPiglinModel::new), ArmorModelSet.bake(babyArmorSet, context.getModelSet(), ZombifiedPiglinModel::new), context.getEquipmentRenderer()));
}
@Override
public Identifier getTextureLocation(ZombifiedPiglinRenderState state) {
return ZOMBIFIED_PIGLIN_LOCATION;
}
@Override
public ZombifiedPiglinRenderState createRenderState() {
return new ZombifiedPiglinRenderState();
}
@Override
public void extractRenderState(ZombifiedPiglin entity, ZombifiedPiglinRenderState state, float partialTicks) {
super.extractRenderState(entity, state, partialTicks);
state.isAggressive = entity.isAggressive();
}
}