35 lines
1.2 KiB
Java
35 lines
1.2 KiB
Java
package net.minecraft.client.renderer.entity;
|
|
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.minecraft.client.model.SpiderModel;
|
|
import net.minecraft.client.model.geom.ModelLayerLocation;
|
|
import net.minecraft.client.model.geom.ModelLayers;
|
|
import net.minecraft.client.renderer.entity.layers.SpiderEyesLayer;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.world.entity.monster.Spider;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public class SpiderRenderer<T extends Spider> extends MobRenderer<T, SpiderModel<T>> {
|
|
private static final ResourceLocation SPIDER_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/spider/spider.png");
|
|
|
|
public SpiderRenderer(EntityRendererProvider.Context context) {
|
|
this(context, ModelLayers.SPIDER);
|
|
}
|
|
|
|
public SpiderRenderer(EntityRendererProvider.Context context, ModelLayerLocation layer) {
|
|
super(context, new SpiderModel<>(context.bakeLayer(layer)), 0.8F);
|
|
this.addLayer(new SpiderEyesLayer<>(this));
|
|
}
|
|
|
|
protected float getFlipDegrees(T livingEntity) {
|
|
return 180.0F;
|
|
}
|
|
|
|
/**
|
|
* Returns the location of an entity's texture.
|
|
*/
|
|
public ResourceLocation getTextureLocation(T entity) {
|
|
return SPIDER_LOCATION;
|
|
}
|
|
}
|