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

48 lines
1.8 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.renderer.entity;
import net.minecraft.client.model.WitchModel;
import net.minecraft.client.model.geom.ModelLayers;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.layers.WitchItemLayer;
import net.minecraft.client.renderer.entity.state.HoldingEntityRenderState;
import net.minecraft.client.renderer.entity.state.WitchRenderState;
import net.minecraft.resources.Identifier;
import net.minecraft.world.entity.monster.Witch;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
public class WitchRenderer
extends MobRenderer<Witch, WitchRenderState, WitchModel> {
private static final Identifier WITCH_LOCATION = Identifier.withDefaultNamespace("textures/entity/witch.png");
public WitchRenderer(EntityRendererProvider.Context context) {
super(context, new WitchModel(context.bakeLayer(ModelLayers.WITCH)), 0.5f);
this.addLayer(new WitchItemLayer(this));
}
@Override
public Identifier getTextureLocation(WitchRenderState state) {
return WITCH_LOCATION;
}
@Override
public WitchRenderState createRenderState() {
return new WitchRenderState();
}
@Override
public void extractRenderState(Witch entity, WitchRenderState state, float partialTicks) {
super.extractRenderState(entity, state, partialTicks);
HoldingEntityRenderState.extractHoldingEntityRenderState(entity, state, this.itemModelResolver);
state.entityId = entity.getId();
ItemStack mainHandItem = entity.getMainHandItem();
state.isHoldingItem = !mainHandItem.isEmpty();
state.isHoldingPotion = mainHandItem.is(Items.POTION);
}
}