Undid previous commit, messed with offsets too much.

This commit is contained in:
Luis C.M committed 2023-01-10 15:06:37 -06:00
1 parent 7f407c3c44
commit cbc0b82356
2 files changed
+5 -8

No files matched your search

@@ -23,7 +23,7 @@ import org.lwjgl.opengl.GL11;
public class RenderCustomNpc extends RenderNPCHumanMale{
private RendererLivingEntity renderEntity;
private EntityLivingBase entity;
public static EntityLivingBase entity;
private ModelRenderPassHelper renderpass = new ModelRenderPassHelper();
@@ -6,6 +6,7 @@ import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.EntityLivingBase;
import noppes.npcs.client.Client;
import noppes.npcs.client.ClientEventHandler;
import noppes.npcs.client.renderer.RenderCustomNpc;
import noppes.npcs.controllers.data.PlayerModelData;
import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityNPCInterface;
@@ -73,7 +74,7 @@ public class MixinModelRenderer {
}
}
}
if (ClientEventHandler.renderingNpc != null && ClientEventHandler.renderingNpc.jobInterface instanceof JobPuppet) {
if (ClientEventHandler.renderingNpc != null && ClientEventHandler.renderingNpc.jobInterface instanceof JobPuppet && RenderCustomNpc.entity != null) {
ClientEventHandler.undoRotations = new float[]{this.rotateAngleX,this.rotateAngleY,this.rotateAngleZ};
ClientEventHandler.undoPivots = new float[]{this.rotationPointX,this.rotationPointY,this.rotationPointZ};
@@ -82,16 +83,12 @@ public class MixinModelRenderer {
this.setModelParts(modelData);
if (modelData.isActive()) {
JobPuppet.PartConfig[] partConfigs = new JobPuppet.PartConfig[]{modelData.head, modelData.body, modelData.larm, modelData.rarm, modelData.lleg, modelData.rleg};
EntityLivingBase entityModel = ((EntityCustomNpc) ClientEventHandler.renderingNpc).modelData.getEntity(ClientEventHandler.renderingNpc);
if (entityModel == null || entityModel instanceof EntityNPCInterface) {
return;
}
for (JobPuppet.PartConfig partConfig : partConfigs) {
if (isPart(partConfig)) {
if (partConfig.npcModel == null || !partConfig.npcModel.getClass().equals(entityModel.getClass())) {
if (partConfig.npcModel == null || !partConfig.npcModel.getClass().equals(RenderCustomNpc.entity.getClass())) {
partConfig.setOriginalPivot = false;
partConfig.npcModel = entityModel;
partConfig.npcModel = RenderCustomNpc.entity;
}
this.rotateAngleX = partConfig.prevRotations[0];
this.rotateAngleY = partConfig.prevRotations[1];