Add GeckoLib Support

This commit is contained in:
Kam committed 2023-11-16 16:01:32 -05:00
1 parent 6f8d99d94a
commit c67a8e43cb
13 files changed
+565 -16

No files matched your search

@@ -29,6 +29,7 @@ import noppes.npcs.controllers.data.SkinOverlay;
import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityNPCInterface;
import org.lwjgl.opengl.GL11;
import software.bernie.geckolib3.core.IAnimatable;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
@@ -217,9 +218,35 @@ public class RenderNPCInterface extends RenderLiving{
super.doRender(entityliving, d, d1, d2, f, f1);
}
private void renderGeoModel(EntityNPCInterface npc, float rot, float partial)
{
if (!npc.isInvisible())
{
RenderManager.instance.renderEntityWithPosYaw(((ModelMPM) mainModel).entity, 0,0,0,rot,partial);
}
else if (!npc.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer))
{
GL11.glPushMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
RenderManager.instance.renderEntityWithPosYaw(((ModelMPM) mainModel).entity, 0,0,0,rot,partial);
GL11.glDisable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glPopMatrix();
GL11.glDepthMask(true);
}
}
protected void renderModel(EntityLivingBase entityliving, float par2, float par3, float par4, float par5, float par6, float par7) {
EntityNPCInterface npc = (EntityNPCInterface) entityliving;
if (this.getEntityTexture(entityliving) != null) {
if(mainModel instanceof ModelMPM && ((ModelMPM) mainModel).entity instanceof IAnimatable){
GL11.glRotatef(180, 1,0,0);
GL11.glTranslated(0, -1.5,0);
renderGeoModel(npc, npc.rotationYaw, Minecraft.getMinecraft().timer.renderPartialTicks);
} else if (this.getEntityTexture(entityliving) != null) {
super.renderModel(entityliving, par2, par3, par4, par5, par6, par7);
}