2020-08-14 19:24:29 +02:00
|
|
|
package mod.acgaming.spackenmobs.render;
|
2020-08-23 10:30:02 +02:00
|
|
|
|
2020-08-14 19:24:29 +02:00
|
|
|
import mod.acgaming.spackenmobs.entities.EntityWolfMZTE;
|
|
|
|
import net.minecraft.client.renderer.GlStateManager;
|
|
|
|
import net.minecraft.client.renderer.entity.Render;
|
|
|
|
import net.minecraft.client.renderer.entity.RenderManager;
|
|
|
|
import net.minecraft.client.renderer.entity.RenderWolf;
|
|
|
|
import net.minecraft.client.renderer.entity.layers.LayerWolfCollar;
|
|
|
|
import net.minecraft.entity.passive.EntityWolf;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2020-08-23 15:38:40 +02:00
|
|
|
public class RenderWolfMZTE extends RenderWolf
|
|
|
|
{
|
2020-08-27 20:12:55 +02:00
|
|
|
public static class Factory implements IRenderFactory<EntityWolfMZTE>
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public Render<? super EntityWolfMZTE> createRenderFor(RenderManager manager)
|
|
|
|
{
|
|
|
|
return new RenderWolfMZTE(manager);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-23 15:38:40 +02:00
|
|
|
private static final ResourceLocation WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte.png");
|
|
|
|
private static final ResourceLocation TAMED_WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte_tame.png");
|
|
|
|
private static final ResourceLocation ANRGY_WOLFMZTE_TEXTURE = new ResourceLocation("spackenmobs:textures/entities/wolfmzte_angry.png");
|
2020-08-27 20:12:55 +02:00
|
|
|
|
2020-08-23 15:38:40 +02:00
|
|
|
public static final Factory FACTORY = new Factory();
|
|
|
|
|
|
|
|
public RenderWolfMZTE(RenderManager renderManagerIn)
|
|
|
|
{
|
|
|
|
super(renderManagerIn);
|
|
|
|
this.addLayer(new LayerWolfCollar(this));
|
2020-08-23 10:30:02 +02:00
|
|
|
}
|
2020-08-14 19:24:29 +02:00
|
|
|
|
2020-08-23 15:38:40 +02:00
|
|
|
@Override
|
|
|
|
public void doRender(EntityWolf entity, double x, double y, double z, float entityYaw, float partialTicks)
|
|
|
|
{
|
|
|
|
if (entity.isWolfWet())
|
|
|
|
{
|
|
|
|
float f = entity.getBrightness() * entity.getShadingWhileWet(partialTicks);
|
|
|
|
GlStateManager.color(f, f, f);
|
|
|
|
}
|
|
|
|
|
|
|
|
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
2020-08-23 10:30:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-08-23 15:38:40 +02:00
|
|
|
protected ResourceLocation getEntityTexture(EntityWolf entity)
|
|
|
|
{
|
|
|
|
if (entity.isTamed())
|
|
|
|
{
|
|
|
|
return TAMED_WOLFMZTE_TEXTURE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return entity.isAngry() ? ANRGY_WOLFMZTE_TEXTURE : WOLFMZTE_TEXTURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-27 20:12:55 +02:00
|
|
|
@Override
|
|
|
|
protected float handleRotationFloat(EntityWolf livingBase, float partialTicks)
|
2020-08-23 15:38:40 +02:00
|
|
|
{
|
2020-08-27 20:12:55 +02:00
|
|
|
return livingBase.getTailRotation();
|
2020-08-23 10:30:02 +02:00
|
|
|
}
|
2020-08-14 19:24:29 +02:00
|
|
|
}
|