package ar.com.companeros.horror.client; import ar.com.companeros.Companeros; import ar.com.companeros.horror.ParasiteEntity; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; /** La apariencia se decide por observador; el cuerpo del servidor sigue siendo el mismo. */ public final class ParasiteRenderer extends MobRenderer { private static final ResourceLocation FRIENDLY = new ResourceLocation(Companeros.ID, "textures/entity/parasite_friendly.png"); private final ParasiteModel original; private final ParasiteModel friendly; public ParasiteRenderer(EntityRendererProvider.Context context) { super(context, new ParasiteModel(context.bakeLayer(ParasiteModel.LAYER), false), .45F); original = model; friendly = new ParasiteModel(context.bakeLayer(ParasiteModel.FRIENDLY_LAYER), true); } @Override public ResourceLocation getTextureLocation(ParasiteEntity entity) { return HorrorClientSafety.isEnabled() ? FRIENDLY : ParasiteHostSkin.texture(entity); } @Override public void render(ParasiteEntity entity, float yaw, float partialTick, PoseStack pose, MultiBufferSource buffers, int light) { model = HorrorClientSafety.isEnabled() ? friendly : original; super.render(entity, yaw, partialTick, pose, buffers, light); } }