50 lines
2.0 KiB
Java
50 lines
2.0 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.google.common.collect.Maps
|
|
*/
|
|
package net.minecraft.client.renderer.entity;
|
|
|
|
import com.google.common.collect.Maps;
|
|
import java.util.Map;
|
|
import net.minecraft.client.model.CowModel;
|
|
import net.minecraft.client.model.geom.ModelLayers;
|
|
import net.minecraft.client.renderer.entity.AgeableMobRenderer;
|
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
|
import net.minecraft.client.renderer.entity.layers.MushroomCowMushroomLayer;
|
|
import net.minecraft.client.renderer.entity.state.MushroomCowRenderState;
|
|
import net.minecraft.resources.Identifier;
|
|
import net.minecraft.util.Util;
|
|
import net.minecraft.world.entity.animal.MushroomCow;
|
|
|
|
public class MushroomCowRenderer
|
|
extends AgeableMobRenderer<MushroomCow, MushroomCowRenderState, CowModel> {
|
|
private static final Map<MushroomCow.Variant, Identifier> TEXTURES = Util.make(Maps.newHashMap(), map -> {
|
|
map.put(MushroomCow.Variant.BROWN, Identifier.withDefaultNamespace("textures/entity/cow/brown_mooshroom.png"));
|
|
map.put(MushroomCow.Variant.RED, Identifier.withDefaultNamespace("textures/entity/cow/red_mooshroom.png"));
|
|
});
|
|
|
|
public MushroomCowRenderer(EntityRendererProvider.Context context) {
|
|
super(context, new CowModel(context.bakeLayer(ModelLayers.MOOSHROOM)), new CowModel(context.bakeLayer(ModelLayers.MOOSHROOM_BABY)), 0.7f);
|
|
this.addLayer(new MushroomCowMushroomLayer(this, context.getBlockRenderDispatcher()));
|
|
}
|
|
|
|
@Override
|
|
public Identifier getTextureLocation(MushroomCowRenderState state) {
|
|
return TEXTURES.get(state.variant);
|
|
}
|
|
|
|
@Override
|
|
public MushroomCowRenderState createRenderState() {
|
|
return new MushroomCowRenderState();
|
|
}
|
|
|
|
@Override
|
|
public void extractRenderState(MushroomCow entity, MushroomCowRenderState state, float partialTicks) {
|
|
super.extractRenderState(entity, state, partialTicks);
|
|
state.variant = entity.getVariant();
|
|
}
|
|
}
|
|
|