mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Moved model scale parts into a single ModelScale class, similar to ModelRotate.
Added NPC model data interfaces to the API.
This commit is contained in:
1 parent
2ef93dd35f
commit
f0b33cf913
63 files changed
+412
-283
No files matched your search
@@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.controllers.data.Line;
|
||||
import noppes.npcs.controllers.data.Lines;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.data.ModelRotate;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -61,6 +61,8 @@ import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.containers.*;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.*;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.items.ItemScripted;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import tconstruct.client.tabs.InventoryTabFactions;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.client.controllers;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -28,10 +28,10 @@ public class Preset {
|
||||
Preset preset = new Preset();
|
||||
preset.name = "Elf Male";
|
||||
preset.data = data;
|
||||
data.legs.setScale(0.85f,1.15f);
|
||||
data.arms.setScale(0.85f,1.15f);
|
||||
data.body.setScale(0.85f,1.15f);
|
||||
data.head.setScale(0.85f,0.95f);
|
||||
data.modelScale.legs.setScale(0.85f,1.15f);
|
||||
data.modelScale.arms.setScale(0.85f,1.15f);
|
||||
data.modelScale.body.setScale(0.85f,1.15f);
|
||||
data.modelScale.head.setScale(0.85f,0.95f);
|
||||
presets.put("elf male", preset);
|
||||
|
||||
data = new ModelData();
|
||||
@@ -39,20 +39,20 @@ public class Preset {
|
||||
preset.name = "Elf Female";
|
||||
preset.data = data;
|
||||
data.breasts = 2;
|
||||
data.legs.setScale(0.8f,1.05f);
|
||||
data.arms.setScale(0.8f,1.05f);
|
||||
data.body.setScale(0.8f,1.05f);
|
||||
data.head.setScale(0.8f,0.85f);
|
||||
data.modelScale.legs.setScale(0.8f,1.05f);
|
||||
data.modelScale.arms.setScale(0.8f,1.05f);
|
||||
data.modelScale.body.setScale(0.8f,1.05f);
|
||||
data.modelScale.head.setScale(0.8f,0.85f);
|
||||
presets.put("elf female", preset);
|
||||
|
||||
data = new ModelData();
|
||||
preset = new Preset();
|
||||
preset.name = "Dwarf Male";
|
||||
preset.data = data;
|
||||
data.legs.setScale(1.1f,0.7f, 0.9f);
|
||||
data.arms.setScale(0.9f,0.7f);
|
||||
data.body.setScale(1.2f, 0.7f, 1.5f);
|
||||
data.head.setScale(0.85f,0.85f);
|
||||
data.modelScale.legs.setScale(1.1f,0.7f, 0.9f);
|
||||
data.modelScale.arms.setScale(0.9f,0.7f);
|
||||
data.modelScale.body.setScale(1.2f, 0.7f, 1.5f);
|
||||
data.modelScale.head.setScale(0.85f,0.85f);
|
||||
presets.put("dwarf male", preset);
|
||||
|
||||
data = new ModelData();
|
||||
@@ -60,20 +60,20 @@ public class Preset {
|
||||
preset.name = "Dwarf Female";
|
||||
preset.data = data;
|
||||
data.breasts = 2;
|
||||
data.legs.setScale(0.9f,0.65f);
|
||||
data.arms.setScale(0.9f,0.65f);
|
||||
data.body.setScale(1f, 0.65f, 1.1f);
|
||||
data.head.setScale(0.85f,0.85f);
|
||||
data.modelScale.legs.setScale(0.9f,0.65f);
|
||||
data.modelScale.arms.setScale(0.9f,0.65f);
|
||||
data.modelScale.body.setScale(1f, 0.65f, 1.1f);
|
||||
data.modelScale.head.setScale(0.85f,0.85f);
|
||||
presets.put("dwarf female", preset);
|
||||
|
||||
data = new ModelData();
|
||||
preset = new Preset();
|
||||
preset.name = "Orc Male";
|
||||
preset.data = data;
|
||||
data.legs.setScale(1.2f,1.05f);
|
||||
data.arms.setScale(1.2f,1.05f);
|
||||
data.body.setScale(1.4f, 1.1f, 1.5f);
|
||||
data.head.setScale(1.2f,1.1f);
|
||||
data.modelScale.legs.setScale(1.2f,1.05f);
|
||||
data.modelScale.arms.setScale(1.2f,1.05f);
|
||||
data.modelScale.body.setScale(1.4f, 1.1f, 1.5f);
|
||||
data.modelScale.head.setScale(1.2f,1.1f);
|
||||
presets.put("orc male", preset);
|
||||
|
||||
data = new ModelData();
|
||||
@@ -81,9 +81,9 @@ public class Preset {
|
||||
preset.name = "Orc Female";
|
||||
preset.data = data;
|
||||
data.breasts = 2;
|
||||
data.legs.setScale(1.1f,1);
|
||||
data.arms.setScale(1.1f,1);
|
||||
data.body.setScale(1.1f, 1f, 1.25f);
|
||||
data.modelScale.legs.setScale(1.1f,1);
|
||||
data.modelScale.arms.setScale(1.1f,1);
|
||||
data.modelScale.body.setScale(1.1f, 1f, 1.25f);
|
||||
presets.put("orc female", preset);
|
||||
|
||||
data = new ModelData();
|
||||
@@ -97,10 +97,10 @@ public class Preset {
|
||||
preset.name = "Human Female";
|
||||
preset.data = data;
|
||||
data.breasts = 2;
|
||||
data.head.setScale(0.95f,0.95f);
|
||||
data.legs.setScale(0.92f,0.92f);
|
||||
data.arms.setScale(0.80f,0.92f);
|
||||
data.body.setScale(0.92f, 0.92f);
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
presets.put("human female", preset);
|
||||
|
||||
data = new ModelData();
|
||||
@@ -132,10 +132,10 @@ public class Preset {
|
||||
tail.setTexture("tail/tail1", 0);
|
||||
tail.color = 0xD9A64E;
|
||||
data.breasts = 2;
|
||||
data.head.setScale(0.95f,0.95f);
|
||||
data.legs.setScale(0.92f,0.92f);
|
||||
data.arms.setScale(0.80f,0.92f);
|
||||
data.body.setScale(0.92f, 0.92f);
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
presets.put("cat female", preset);
|
||||
|
||||
data = new ModelData();
|
||||
@@ -167,18 +167,18 @@ public class Preset {
|
||||
tail.setTexture("tail/tail2", 0);
|
||||
tail.color = 0x5E5855;
|
||||
data.breasts = 2;
|
||||
data.head.setScale(0.95f,0.95f);
|
||||
data.legs.setScale(0.92f,0.92f);
|
||||
data.arms.setScale(0.80f,0.92f);
|
||||
data.body.setScale(0.92f, 0.92f);
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
presets.put("wolf female", preset);
|
||||
|
||||
data = new ModelData();
|
||||
preset = new Preset();
|
||||
preset.name = "Enderchibi";
|
||||
preset.data = data;
|
||||
data.legs.setScale(0.65f,0.75f);
|
||||
data.arms.setScale(0.50f,1.45f);
|
||||
data.modelScale.legs.setScale(0.65f,0.75f);
|
||||
data.modelScale.arms.setScale(0.50f,1.45f);
|
||||
ModelPartData part = data.getOrCreatePart("particles");
|
||||
part.setTexture("particle/type1", 1);
|
||||
part.color = 0xFF0000;
|
||||
|
||||
@@ -3,7 +3,7 @@ package noppes.npcs.client.fx;
|
||||
import net.minecraft.client.particle.EntityPortalFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNPCStringSlot;
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.client.gui.util.ITextfieldListener;
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
|
||||
@@ -2,9 +2,8 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelLimbConfig;
|
||||
import noppes.npcs.ModelRotatePart;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelRotatePart;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
|
||||
@@ -2,8 +2,8 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelLimbConfig;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelScalePart;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
|
||||
addLabel(new GuiNpcLabel(20, "Head", guiLeft + 55, y + 5, 0xFFFFFF));
|
||||
if(type == 0){
|
||||
drawSlider(y, playerdata.head);
|
||||
drawSlider(y, playerdata.modelScale.head);
|
||||
y += 88;
|
||||
}
|
||||
else{
|
||||
@@ -42,7 +42,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
|
||||
addLabel(new GuiNpcLabel(21, "Body", guiLeft + 55, y + 5, 0xFFFFFF));
|
||||
if(type == 1){
|
||||
drawSlider(y, playerdata.body);
|
||||
drawSlider(y, playerdata.modelScale.body);
|
||||
y += 88;
|
||||
}
|
||||
else{
|
||||
@@ -52,7 +52,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
|
||||
addLabel(new GuiNpcLabel(22, "Arms", guiLeft + 55, y + 5, 0xFFFFFF));
|
||||
if(type == 2){
|
||||
drawSlider(y, playerdata.arms);
|
||||
drawSlider(y, playerdata.modelScale.arms);
|
||||
y += 88;
|
||||
}
|
||||
else {
|
||||
@@ -62,7 +62,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
|
||||
addLabel(new GuiNpcLabel(23, "Legs", guiLeft + 55, y + 5, 0xFFFFFF));
|
||||
if(type == 3){
|
||||
drawSlider(y, playerdata.legs);
|
||||
drawSlider(y, playerdata.modelScale.legs);
|
||||
y += 88;
|
||||
}
|
||||
else{
|
||||
@@ -71,7 +71,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
}
|
||||
}
|
||||
|
||||
private void drawSlider(int y, ModelLimbConfig config){
|
||||
private void drawSlider(int y, ModelScalePart config){
|
||||
y += 20;
|
||||
addLabel(new GuiNpcLabel(10, "Width", guiLeft - 25 + offset, y + 5, 0xFFFFFF));
|
||||
scaleWidth = new GuiNpcSlider(this, 10, guiLeft + 50 + offset, y, config.scaleX - 0.5f);
|
||||
@@ -100,13 +100,13 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
}
|
||||
else{
|
||||
// Resetting Type
|
||||
ModelLimbConfig config = playerdata.head;
|
||||
ModelScalePart config = playerdata.modelScale.head;
|
||||
if(type == 1)
|
||||
config = playerdata.body;
|
||||
config = playerdata.modelScale.body;
|
||||
else if(type == 2)
|
||||
config = playerdata.arms;
|
||||
config = playerdata.modelScale.arms;
|
||||
else if(type == 3)
|
||||
config = playerdata.legs;
|
||||
config = playerdata.modelScale.legs;
|
||||
|
||||
if(btn.id == 170){
|
||||
config.scaleX = 1.0f;
|
||||
@@ -143,13 +143,13 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
public void mouseDragged(GuiNpcSlider slider) {
|
||||
int percent = (int) (50 + slider.sliderValue * 100);
|
||||
slider.setString(percent + "%");
|
||||
ModelLimbConfig config = playerdata.head;
|
||||
ModelScalePart config = playerdata.modelScale.head;
|
||||
if(type == 1)
|
||||
config = playerdata.body;
|
||||
config = playerdata.modelScale.body;
|
||||
else if(type == 2)
|
||||
config = playerdata.arms;
|
||||
config = playerdata.modelScale.arms;
|
||||
else if(type == 3)
|
||||
config = playerdata.legs;
|
||||
config = playerdata.modelScale.legs;
|
||||
|
||||
if(slider.id == 10)
|
||||
config.scaleX = slider.sliderValue + 0.5f;
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.controllers.Preset;
|
||||
import noppes.npcs.client.controllers.PresetController;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.client.controllers.Preset;
|
||||
import noppes.npcs.client.controllers.PresetController;
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
@@ -24,6 +24,8 @@ import noppes.npcs.controllers.data.Frame;
|
||||
import noppes.npcs.controllers.data.FramePart;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelScalePart;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -632,7 +634,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
bipedRightArm.rotateAngleZ = (float) (Math.PI - 1f - Math.sin(entity.ticksExisted * 0.27f) * 0.5f );
|
||||
}
|
||||
else if(isSneak){
|
||||
this.bipedBody.rotateAngleX = 0.5F / npc.modelData.body.scaleY;
|
||||
this.bipedBody.rotateAngleX = 0.5F / npc.modelData.modelScale.body.scaleY;
|
||||
}
|
||||
|
||||
AnimationData animationData = npc.display.animationData;
|
||||
@@ -736,7 +738,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
float dancing = entity.ticksExisted / 4f;
|
||||
GL11.glTranslatef((float)Math.sin(dancing) * 0.075F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancing))) * 0.075F);
|
||||
}
|
||||
ModelLimbConfig head = entity.modelData.head;
|
||||
ModelScalePart head = entity.modelData.modelScale.head;
|
||||
|
||||
this.copyAnglesPivots(headwear,bipedHead);
|
||||
this.copyAnglesPivots(bipedHeadwear,bipedHead);
|
||||
@@ -772,7 +774,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
GL11.glTranslatef((float)Math.sin(dancing) * 0.015F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
ModelLimbConfig body = entity.modelData.body;
|
||||
ModelScalePart body = entity.modelData.modelScale.body;
|
||||
|
||||
// Hide Body
|
||||
((ModelScaleRenderer)this.bipedBody).isHidden = entity.modelData.hideBody == 1;
|
||||
@@ -782,7 +784,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
|
||||
if(bipedBodywear.showModel && !bipedBodywear.isHidden){
|
||||
if(entity.modelData.bodywear == 1 || isArmor){
|
||||
((ModelScaleRenderer)this.bipedBodywear).setConfig(entity.modelData.body,x,y,z);
|
||||
((ModelScaleRenderer)this.bipedBodywear).setConfig(entity.modelData.modelScale.body,x,y,z);
|
||||
((ModelScaleRenderer)this.bipedBodywear).render(f);
|
||||
}
|
||||
else if(entity.modelData.bodywear == 2){
|
||||
@@ -792,7 +794,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
this.bodywear.rotationPointX = bipedBodywear.rotationPointX;
|
||||
this.bodywear.rotationPointY = bipedBodywear.rotationPointY;
|
||||
this.bodywear.rotationPointZ = bipedBodywear.rotationPointZ;
|
||||
this.bodywear.setConfig(entity.modelData.body,x,y,z);
|
||||
this.bodywear.setConfig(entity.modelData.modelScale.body,x,y,z);
|
||||
this.bodywear.render(f);
|
||||
}
|
||||
}
|
||||
@@ -804,9 +806,9 @@ public class ModelMPM extends ModelNPCMale{
|
||||
}
|
||||
public void renderArms(EntityCustomNpc entity, float f, boolean bo){
|
||||
loadPlayerTexture(entity);
|
||||
ModelLimbConfig arms = entity.modelData.arms;
|
||||
ModelScalePart arms = entity.modelData.modelScale.arms;
|
||||
|
||||
float x = (1 - entity.modelData.body.scaleX) * 0.25f + (1 - arms.scaleX) * 0.075f;
|
||||
float x = (1 - entity.modelData.modelScale.body.scaleX) * 0.25f + (1 - arms.scaleX) * 0.075f;
|
||||
float y = entity.modelData.getBodyY() + (1 - arms.scaleY) * -0.1f;
|
||||
float z = 0;
|
||||
|
||||
@@ -883,7 +885,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
}
|
||||
private void renderLegs(EntityCustomNpc entity, float f) {
|
||||
loadPlayerTexture(entity);
|
||||
ModelLimbConfig legs = entity.modelData.legs;
|
||||
ModelScalePart legs = entity.modelData.modelScale.legs;
|
||||
|
||||
float x = (1 - legs.scaleX) * 0.125f;
|
||||
float y = entity.modelData.getLegsY();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
@@ -2,8 +2,8 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
@@ -2,8 +2,8 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.part.horns.ModelAntennasBack;
|
||||
import noppes.npcs.client.model.part.horns.ModelAntennasFront;
|
||||
|
||||
@@ -3,7 +3,7 @@ package noppes.npcs.client.model.part;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.part.legs.ModelDigitigradeLegs;
|
||||
@@ -294,8 +294,8 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
spiderNeck.rotateAngleX = (float) (Math.PI / -8);
|
||||
}
|
||||
if(base.isSleeping(entity) || this.entity.currentAnimation == EnumAnimation.CRAWLING){
|
||||
rotationPointY = 12 * this.entity.modelData.legs.scaleY;
|
||||
rotationPointZ = 15 * this.entity.modelData.legs.scaleY;
|
||||
rotationPointY = 12 * this.entity.modelData.modelScale.legs.scaleY;
|
||||
rotationPointZ = 15 * this.entity.modelData.modelScale.legs.scaleY;
|
||||
|
||||
this.rotateAngleX = (float) (Math.PI / -2);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
@@ -3,8 +3,8 @@ package noppes.npcs.client.model.part;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.client.model.util.ModelPlaneRenderer;
|
||||
|
||||
@@ -2,8 +2,8 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.part.tails.*;
|
||||
@@ -87,18 +87,18 @@ public class ModelTail extends ModelScaleRenderer {
|
||||
|
||||
if(this.entity.modelData.legParts.type == 2){
|
||||
rotationPointY = 13f;
|
||||
rotationPointZ = 14 * this.entity.modelData.legs.scaleZ;
|
||||
rotationPointZ = 14 * this.entity.modelData.modelScale.legs.scaleZ;
|
||||
|
||||
if(base.isSleeping(entity) || this.entity.currentAnimation == EnumAnimation.CRAWLING){
|
||||
rotationPointY = 12 + 16 * this.entity.modelData.legs.scaleZ;
|
||||
rotationPointZ = 1f * this.entity.modelData.legs.scaleY;
|
||||
rotationPointY = 12 + 16 * this.entity.modelData.modelScale.legs.scaleZ;
|
||||
rotationPointZ = 1f * this.entity.modelData.modelScale.legs.scaleY;
|
||||
|
||||
rotateAngleX = (float) (Math.PI / -4);
|
||||
}
|
||||
}
|
||||
else if(this.entity.modelData.legParts.type == 3){
|
||||
rotationPointY = 8.6f;
|
||||
rotationPointZ = 19 * this.entity.modelData.legs.scaleZ;
|
||||
rotationPointZ = 19 * this.entity.modelData.modelScale.legs.scaleZ;
|
||||
}
|
||||
else{
|
||||
rotationPointY = 11;
|
||||
|
||||
@@ -2,8 +2,8 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
|
||||
@@ -4,8 +4,8 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.client.model.ModelBox;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import noppes.npcs.ModelLimbConfig;
|
||||
import noppes.npcs.entity.data.ModelScalePart;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelScaleRenderer extends ModelRenderer {
|
||||
@@ -15,7 +15,7 @@ public class ModelScaleRenderer extends ModelRenderer {
|
||||
/** The GL display list rendered by the Tessellator for this model */
|
||||
public int displayList;
|
||||
|
||||
protected ModelLimbConfig config;
|
||||
protected ModelScalePart config;
|
||||
|
||||
public float x, y, z;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ModelScaleRenderer extends ModelRenderer {
|
||||
this.setTextureOffset(par2, par3);
|
||||
}
|
||||
|
||||
public void setConfig(ModelLimbConfig config, float x, float y, float z){
|
||||
public void setConfig(ModelScalePart config, float x, float y, float z){
|
||||
this.config = config;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
@@ -145,17 +145,17 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
modelArmorChestplate.heldItemRight = modelArmor.heldItemRight = modelBipedMain.heldItemRight =
|
||||
itemstack == null ? 0 : npc.hurtResistantTime > 0 ? 3 : 1;
|
||||
|
||||
modelArmorChestplate.heldItemLeft = modelArmor.heldItemLeft = modelBipedMain.heldItemLeft =
|
||||
modelArmorChestplate.heldItemLeft = modelArmor.heldItemLeft = modelBipedMain.heldItemLeft =
|
||||
npc.getOffHand() == null ? 0 : npc.hurtResistantTime > 0 ? 3 : 1;
|
||||
|
||||
|
||||
modelArmorChestplate.isSneak = modelArmor.isSneak = modelBipedMain.isSneak = npc.isSneaking();
|
||||
|
||||
modelArmorChestplate.isSleeping = modelArmor.isSleeping = modelBipedMain.isSleeping = npc.isPlayerSleeping();
|
||||
modelArmorChestplate.isDancing = modelArmor.isDancing = modelBipedMain.isDancing = npc.currentAnimation == EnumAnimation.DANCING;
|
||||
modelArmorChestplate.aimedBow = modelArmor.aimedBow = modelBipedMain.aimedBow = npc.currentAnimation == EnumAnimation.AIMING;
|
||||
|
||||
|
||||
modelArmorChestplate.isRiding = modelArmor.isRiding = modelBipedMain.isRiding = npc.isRiding();
|
||||
|
||||
|
||||
double d3 = d1 - (double)npc.yOffset;
|
||||
if(npc.isSneaking())
|
||||
{
|
||||
@@ -185,7 +185,7 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
EntityCustomNpc cnpc = (EntityCustomNpc) npc;
|
||||
GL11.glTranslatef(0, cnpc.modelData.getBodyY(), 0);
|
||||
this.modelBipedMain.bipedHead.postRender(0.0625F);
|
||||
GL11.glScalef(cnpc.modelData.head.scaleX, cnpc.modelData.head.scaleY, cnpc.modelData.head.scaleZ);
|
||||
GL11.glScalef(cnpc.modelData.modelScale.head.scaleX, cnpc.modelData.modelScale.head.scaleY, cnpc.modelData.modelScale.head.scaleZ);
|
||||
}
|
||||
else
|
||||
this.modelBipedMain.bipedHead.postRender(0.0625F);
|
||||
@@ -218,8 +218,8 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
float x = 0;
|
||||
if(npc instanceof EntityCustomNpc){
|
||||
EntityCustomNpc cnpc = (EntityCustomNpc) npc;
|
||||
y = (cnpc.modelData.arms.scaleY - 1) * 0.7f;
|
||||
x = (1 - cnpc.modelData.body.scaleX) * 0.28f + (1 - cnpc.modelData.arms.scaleX) * 0.175f;
|
||||
y = (cnpc.modelData.modelScale.arms.scaleY - 1) * 0.7f;
|
||||
x = (1 - cnpc.modelData.modelScale.body.scaleX) * 0.28f + (1 - cnpc.modelData.modelScale.arms.scaleX) * 0.175f;
|
||||
GL11.glTranslatef(x, cnpc.modelData.getBodyY(), 0);
|
||||
}
|
||||
this.modelBipedMain.bipedRightArm.postRender(0.0625F);
|
||||
@@ -263,7 +263,7 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, -0.125F, 0.0F);
|
||||
}
|
||||
|
||||
|
||||
if (npc.hurtResistantTime > 0 && npc.stats.resistances.playermelee > 1f)
|
||||
{
|
||||
GL11.glTranslatef(0.05F, 0.0F, -0.1F);
|
||||
@@ -309,7 +309,7 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
}
|
||||
else
|
||||
renderManager.itemRenderer.renderItem(npc, itemstack2, 0);
|
||||
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glColor4f(1, 1, 1, 1.0F);
|
||||
@@ -321,8 +321,8 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
float x = 0;
|
||||
if(npc instanceof EntityCustomNpc){
|
||||
EntityCustomNpc cnpc = (EntityCustomNpc) npc;
|
||||
y = (cnpc.modelData.arms.scaleY - 1) * 0.7f;
|
||||
x = (1 - cnpc.modelData.body.scaleX) * -0.28f + (1 - cnpc.modelData.arms.scaleX) * -0.175f;
|
||||
y = (cnpc.modelData.modelScale.arms.scaleY - 1) * 0.7f;
|
||||
x = (1 - cnpc.modelData.modelScale.body.scaleX) * -0.28f + (1 - cnpc.modelData.modelScale.arms.scaleX) * -0.175f;
|
||||
GL11.glTranslatef(x, cnpc.modelData.getBodyY(), 0);
|
||||
}
|
||||
this.modelBipedMain.bipedLeftArm.postRender(0.0625F);
|
||||
|
||||
@@ -5,8 +5,8 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.VersionCompatibility;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
|
||||
@@ -64,7 +64,7 @@ public class EntityCustomNpc extends EntityNPCFlying {
|
||||
public void updateHitbox() {
|
||||
Entity entity = modelData.getEntity(this);
|
||||
if(modelData == null || entity == null){
|
||||
baseHeight = 1.9f - modelData.getBodyY() + (modelData.head.scaleY - 1) / 2;
|
||||
baseHeight = 1.9f - modelData.getBodyY() + (modelData.modelScale.head.scaleY - 1) / 2;
|
||||
super.updateHitbox();
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
|
||||
@@ -3,7 +3,7 @@ package noppes.npcs.entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class EntityNpcDragon extends EntityNPCInterface{
|
||||
public EntityNpcDragon(World world)
|
||||
|
||||
@@ -3,7 +3,7 @@ package noppes.npcs.entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class EntityNpcPony extends EntityNPCInterface
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ package noppes.npcs.entity;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class EntityNpcSlime extends EntityNPCInterface{
|
||||
public EntityNpcSlime(World world)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package noppes.npcs;
|
||||
package noppes.npcs.entity.data;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
+45
-47
@@ -1,18 +1,18 @@
|
||||
package noppes.npcs;
|
||||
package noppes.npcs.entity.data;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.api.entity.data.IModelData;
|
||||
import noppes.npcs.api.entity.data.IModelRotate;
|
||||
import noppes.npcs.api.entity.data.IModelScale;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class ModelDataShared{
|
||||
public ModelLimbConfig head = new ModelLimbConfig();
|
||||
public ModelLimbConfig arms = new ModelLimbConfig();
|
||||
public ModelLimbConfig body = new ModelLimbConfig();
|
||||
public ModelLimbConfig legs = new ModelLimbConfig();
|
||||
public class ModelDataShared implements IModelData {
|
||||
public ModelScale modelScale = new ModelScale();
|
||||
|
||||
public boolean enableRotation = false;
|
||||
public ModelRotate rotation = new ModelRotate();
|
||||
@@ -48,10 +48,7 @@ public class ModelDataShared{
|
||||
if(entityClass != null)
|
||||
compound.setString("EntityClass", entityClass.getCanonicalName());
|
||||
|
||||
compound.setTag("HeadConfig", head.writeToNBT());
|
||||
compound.setTag("BodyConfig", body.writeToNBT());
|
||||
compound.setTag("ArmsConfig", arms.writeToNBT());
|
||||
compound.setTag("LegsConfig", legs.writeToNBT());
|
||||
compound = this.modelScale.writeToNBT(compound);
|
||||
|
||||
compound.setTag("LegParts", legParts.writeToNBT());
|
||||
|
||||
@@ -87,12 +84,9 @@ public class ModelDataShared{
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
setEntityClass(compound.getString("EntityClass"));
|
||||
setEntity(compound.getString("EntityClass"));
|
||||
|
||||
head.readFromNBT(compound.getCompoundTag("HeadConfig"));
|
||||
body.readFromNBT(compound.getCompoundTag("BodyConfig"));
|
||||
arms.readFromNBT(compound.getCompoundTag("ArmsConfig"));
|
||||
legs.readFromNBT(compound.getCompoundTag("LegsConfig"));
|
||||
this.modelScale.readFromNBT(compound);
|
||||
|
||||
legParts.readFromNBT(compound.getCompoundTag("LegParts"));
|
||||
|
||||
@@ -127,33 +121,6 @@ public class ModelDataShared{
|
||||
this.parts = parts;
|
||||
|
||||
}
|
||||
|
||||
public void readPartsFromNBT(NBTTagCompound compound){
|
||||
legParts.readFromNBT(compound.getCompoundTag("LegParts"));
|
||||
|
||||
HashMap<String,ModelPartData> parts = new HashMap<String,ModelPartData>();
|
||||
NBTTagList list = compound.getTagList("Parts", 10);
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound item = list.getCompoundTagAt(i);
|
||||
ModelPartData part = new ModelPartData();
|
||||
part.readFromNBT(item);
|
||||
parts.put(item.getString("PartName"), part);
|
||||
}
|
||||
this.parts = parts;
|
||||
}
|
||||
|
||||
private void setEntityClass(String string) {
|
||||
entityClass = null;
|
||||
entity = null;
|
||||
try {
|
||||
Class<?> cls = Class.forName(string);
|
||||
if (EntityLivingBase.class.isAssignableFrom(cls))
|
||||
entityClass = cls.asSubclass(EntityLivingBase.class);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void setEntityClass(Class<? extends EntityLivingBase> entityClass){
|
||||
this.entityClass = entityClass;
|
||||
@@ -195,15 +162,46 @@ public class ModelDataShared{
|
||||
|
||||
public float getBodyY(){
|
||||
if(legParts.type == 3)
|
||||
return (0.9f - body.scaleY) * 0.75f + getLegsY();
|
||||
return (0.9f - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
if(legParts.type == 3)
|
||||
return (0.5f - body.scaleY) * 0.75f + getLegsY();
|
||||
return (1 - body.scaleY) * 0.75f + getLegsY();
|
||||
return (0.5f - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
return (1 - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
}
|
||||
|
||||
public float getLegsY() {
|
||||
if(legParts.type == 3)
|
||||
return (0.87f - legs.scaleY) * 1f;
|
||||
return (1 - legs.scaleY) * 0.75f;
|
||||
return (0.87f - modelScale.legs.scaleY);
|
||||
return (1 - modelScale.legs.scaleY) * 0.75f;
|
||||
}
|
||||
|
||||
public void enableRotation(boolean enableRotation) {
|
||||
this.enableRotation = enableRotation;
|
||||
}
|
||||
|
||||
public boolean enableRotation() {
|
||||
return this.enableRotation;
|
||||
}
|
||||
|
||||
public IModelRotate getRotation() {
|
||||
return this.rotation;
|
||||
}
|
||||
|
||||
public IModelScale getScale() {
|
||||
return this.modelScale;
|
||||
}
|
||||
|
||||
public void setEntity(String string) {
|
||||
entityClass = null;
|
||||
entity = null;
|
||||
try {
|
||||
Class<?> cls = Class.forName(string);
|
||||
if (EntityLivingBase.class.isAssignableFrom(cls))
|
||||
entityClass = cls.asSubclass(EntityLivingBase.class);
|
||||
|
||||
} catch (ClassNotFoundException ignored) {}
|
||||
}
|
||||
|
||||
public String getEntity() {
|
||||
return entityClass == null ? null : entityClass.getName();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package noppes.npcs;
|
||||
package noppes.npcs.entity.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
+45
-2
@@ -1,9 +1,11 @@
|
||||
package noppes.npcs;
|
||||
package noppes.npcs.entity.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.entity.data.IModelRotate;
|
||||
import noppes.npcs.api.entity.data.IModelRotatePart;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelRotate {
|
||||
public class ModelRotate implements IModelRotate {
|
||||
// Rotation
|
||||
public boolean whileStanding = true;
|
||||
public boolean whileAttacking = false;
|
||||
@@ -42,4 +44,45 @@ public class ModelRotate {
|
||||
lleg.readFromNBT(compound.getCompoundTag("PuppetLLeg"));
|
||||
}
|
||||
|
||||
public boolean whileStanding() {
|
||||
return this.whileStanding;
|
||||
}
|
||||
|
||||
public void whileStanding(boolean whileStanding) {
|
||||
this.whileStanding = whileStanding;
|
||||
}
|
||||
|
||||
public boolean whileAttacking() {
|
||||
return this.whileAttacking;
|
||||
}
|
||||
|
||||
public void whileAttacking(boolean whileAttacking) {
|
||||
this.whileAttacking = whileAttacking;
|
||||
}
|
||||
|
||||
public boolean whileMoving() {
|
||||
return this.whileMoving;
|
||||
}
|
||||
|
||||
public void whileMoving(boolean whileMoving) {
|
||||
this.whileMoving = whileMoving;
|
||||
}
|
||||
|
||||
public IModelRotatePart getPart(int part) {
|
||||
switch (ValueUtil.CorrectInt(part,0,5)) {
|
||||
case 0:
|
||||
return head;
|
||||
case 1:
|
||||
return body;
|
||||
case 2:
|
||||
return larm;
|
||||
case 3:
|
||||
return rarm;
|
||||
case 4:
|
||||
return lleg;
|
||||
case 5:
|
||||
return rleg;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+28
-2
@@ -1,9 +1,10 @@
|
||||
package noppes.npcs;
|
||||
package noppes.npcs.entity.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.entity.data.IModelRotatePart;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelRotatePart {
|
||||
public class ModelRotatePart implements IModelRotatePart {
|
||||
public float rotationX = 0f, rotationY = 0f, rotationZ = 0f;
|
||||
public boolean disabled = false;
|
||||
|
||||
@@ -23,4 +24,29 @@ public class ModelRotatePart {
|
||||
rotationZ = ValueUtil.correctFloat(compound.getFloat("RotationZ"), -0.5f, 0.5f);
|
||||
}
|
||||
|
||||
public void setRotation(float x, float y, float z) {
|
||||
this.rotationX = x;
|
||||
this.rotationY = y;
|
||||
this.rotationZ = z;
|
||||
}
|
||||
|
||||
public float getRotateX() {
|
||||
return this.rotationX;
|
||||
}
|
||||
|
||||
public float getRotateY() {
|
||||
return this.rotationY;
|
||||
}
|
||||
|
||||
public float getRotateZ() {
|
||||
return this.rotationZ;
|
||||
}
|
||||
|
||||
public void disabled(boolean disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
public boolean disabled() {
|
||||
return this.disabled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package noppes.npcs.entity.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.entity.data.IModelScale;
|
||||
import noppes.npcs.api.entity.data.IModelScalePart;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelScale implements IModelScale {
|
||||
public ModelScalePart head = new ModelScalePart();
|
||||
public ModelScalePart body = new ModelScalePart();
|
||||
public ModelScalePart arms = new ModelScalePart();
|
||||
public ModelScalePart legs = new ModelScalePart();
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
|
||||
compound.setTag("HeadConfig", head.writeToNBT());
|
||||
compound.setTag("BodyConfig", body.writeToNBT());
|
||||
compound.setTag("ArmsConfig", arms.writeToNBT());
|
||||
compound.setTag("LegsConfig", legs.writeToNBT());
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
head.readFromNBT(compound.getCompoundTag("HeadConfig"));
|
||||
body.readFromNBT(compound.getCompoundTag("BodyConfig"));
|
||||
arms.readFromNBT(compound.getCompoundTag("ArmsConfig"));
|
||||
legs.readFromNBT(compound.getCompoundTag("LegsConfig"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelScalePart getPart(int part) {
|
||||
switch (ValueUtil.CorrectInt(part,0,3)) {
|
||||
case 0:
|
||||
return head;
|
||||
case 1:
|
||||
return body;
|
||||
case 2:
|
||||
return arms;
|
||||
case 3:
|
||||
return legs;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+20
-10
@@ -1,19 +1,17 @@
|
||||
package noppes.npcs;
|
||||
package noppes.npcs.entity.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.entity.data.IModelScalePart;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelLimbConfig {
|
||||
|
||||
public class ModelScalePart implements IModelScalePart {
|
||||
public float scaleX = 1, scaleY = 1, scaleZ = 1;
|
||||
public boolean shared = false;
|
||||
|
||||
public NBTTagCompound writeToNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setFloat("ScaleX", scaleX);
|
||||
compound.setFloat("ScaleY", scaleY);
|
||||
compound.setFloat("ScaleZ", scaleZ);
|
||||
compound.setBoolean("Shared", shared);
|
||||
|
||||
return compound;
|
||||
}
|
||||
@@ -28,14 +26,26 @@ public class ModelLimbConfig {
|
||||
return "ScaleX: " + scaleX + " - ScaleY: " + scaleY + " - ScaleZ: " + scaleZ;
|
||||
}
|
||||
|
||||
public void setScale(float x, float y, float z) {
|
||||
scaleX = x;
|
||||
scaleY = y;
|
||||
scaleZ = z;
|
||||
}
|
||||
public void setScale(float x, float y) {
|
||||
scaleZ = scaleX = x;
|
||||
scaleY = y;
|
||||
}
|
||||
|
||||
public void setScale(float x, float y, float z) {
|
||||
scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
}
|
||||
|
||||
public float getScaleX() {
|
||||
return scaleX;
|
||||
}
|
||||
|
||||
public float getScaleY() {
|
||||
return scaleY;
|
||||
}
|
||||
|
||||
public float getScaleZ() {
|
||||
return scaleZ;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -35,10 +35,10 @@ public class EntityNPCDwarfFemale extends EntityNPCInterface
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.legs.setScale(0.8f,1.05f);
|
||||
data.arms.setScale(0.8f,1.05f);
|
||||
data.body.setScale(0.8f,1.05f);
|
||||
data.head.setScale(0.8f,0.85f);
|
||||
data.modelScale.legs.setScale(0.8f,1.05f);
|
||||
data.modelScale.arms.setScale(0.8f,1.05f);
|
||||
data.modelScale.body.setScale(0.8f,1.05f);
|
||||
data.modelScale.head.setScale(0.8f,0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -34,10 +34,10 @@ public class EntityNPCDwarfMale extends EntityNPCInterface
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.legs.setScale(1.1f,0.7f, 0.9f);
|
||||
data.arms.setScale(0.9f,0.7f);
|
||||
data.body.setScale(1.2f, 0.7f, 1.5f);
|
||||
data.head.setScale(0.85f,0.85f);
|
||||
data.modelScale.legs.setScale(1.1f,0.7f, 0.9f);
|
||||
data.modelScale.arms.setScale(0.9f,0.7f);
|
||||
data.modelScale.body.setScale(1.2f, 0.7f, 1.5f);
|
||||
data.modelScale.head.setScale(0.85f,0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -37,10 +37,10 @@ public class EntityNPCElfFemale extends EntityNPCInterface
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.legs.setScale(0.8f,1.05f);
|
||||
data.arms.setScale(0.8f,1.05f);
|
||||
data.body.setScale(0.8f,1.05f);
|
||||
data.head.setScale(0.8f,0.85f);
|
||||
data.modelScale.legs.setScale(0.8f,1.05f);
|
||||
data.modelScale.arms.setScale(0.8f,1.05f);
|
||||
data.modelScale.body.setScale(0.8f,1.05f);
|
||||
data.modelScale.head.setScale(0.8f,0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -36,10 +36,10 @@ public class EntityNPCElfMale extends EntityNPCInterface
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.legs.setScale(0.85f,1.15f);
|
||||
data.arms.setScale(0.85f,1.15f);
|
||||
data.body.setScale(0.85f,1.15f);
|
||||
data.head.setScale(0.85f,0.95f);
|
||||
data.modelScale.legs.setScale(0.85f,1.15f);
|
||||
data.modelScale.arms.setScale(0.85f,1.15f);
|
||||
data.modelScale.body.setScale(0.85f,1.15f);
|
||||
data.modelScale.head.setScale(0.85f,0.95f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
|
||||
@@ -7,7 +7,7 @@ package noppes.npcs.entity.old;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
@@ -6,8 +6,8 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -35,10 +35,10 @@ public class EntityNPCFurryFemale extends EntityNPCInterface
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.head.setScale(0.95f,0.95f);
|
||||
data.legs.setScale(0.92f,0.92f);
|
||||
data.arms.setScale(0.80f,0.92f);
|
||||
data.body.setScale(0.92f, 0.92f);
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
ModelPartData hair = data.getOrCreatePart("ears");
|
||||
hair.playerTexture = true;
|
||||
ModelPartData snout = data.getOrCreatePart("snout");
|
||||
|
||||
@@ -6,8 +6,8 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -34,10 +34,10 @@ public class EntityNPCHumanFemale extends EntityNPCInterface
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.head.setScale(0.95f,0.95f);
|
||||
data.legs.setScale(0.92f,0.92f);
|
||||
data.arms.setScale(0.80f,0.92f);
|
||||
data.body.setScale(0.92f, 0.92f);
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -34,10 +34,10 @@ public class EntityNPCOrcFemale extends EntityNPCInterface
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.legs.setScale(0.9f,0.65f);
|
||||
data.arms.setScale(0.9f,0.65f);
|
||||
data.body.setScale(1f, 0.65f, 1.1f);
|
||||
data.head.setScale(0.85f,0.85f);
|
||||
data.modelScale.legs.setScale(0.9f,0.65f);
|
||||
data.modelScale.arms.setScale(0.9f,0.65f);
|
||||
data.modelScale.body.setScale(1f, 0.65f, 1.1f);
|
||||
data.modelScale.head.setScale(0.85f,0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -34,10 +34,10 @@ public class EntityNPCOrcMale extends EntityNPCInterface
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.legs.setScale(1.2f,1.05f);
|
||||
data.arms.setScale(1.2f,1.05f);
|
||||
data.body.setScale(1.4f, 1.1f, 1.5f);
|
||||
data.head.setScale(1.2f,1.1f);
|
||||
data.modelScale.legs.setScale(1.2f,1.05f);
|
||||
data.modelScale.arms.setScale(1.2f,1.05f);
|
||||
data.modelScale.body.setScale(1.4f, 1.1f, 1.5f);
|
||||
data.modelScale.head.setScale(1.2f,1.1f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
|
||||
@@ -7,7 +7,7 @@ package noppes.npcs.entity.old;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -34,8 +34,8 @@ public class EntityNpcEnderchibi extends EntityNPCInterface
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.legs.setScale(0.65f,0.75f);
|
||||
data.arms.setScale(0.50f,1.45f);
|
||||
data.modelScale.legs.setScale(0.65f,0.75f);
|
||||
data.modelScale.arms.setScale(0.50f,1.45f);
|
||||
ModelPartData part = data.getOrCreatePart("particles");
|
||||
part.playerTexture = true;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
@@ -35,10 +35,10 @@ public class EntityNpcMonsterFemale extends EntityNPCInterface
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.head.setScale(0.95f,0.95f);
|
||||
data.legs.setScale(0.92f,0.92f);
|
||||
data.arms.setScale(0.80f,0.92f);
|
||||
data.body.setScale(0.92f, 0.92f);
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
npc.ai.animationType = EnumAnimation.HUG;
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -35,10 +35,10 @@ public class EntityNpcNagaFemale extends EntityNPCInterface
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.head.setScale(0.95f,0.95f);
|
||||
data.legs.setScale(0.92f,0.92f);
|
||||
data.arms.setScale(0.80f,0.92f);
|
||||
data.body.setScale(0.92f, 0.92f);
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
ModelPartData legs = data.legParts;
|
||||
legs.playerTexture = true;
|
||||
legs.type = 1;
|
||||
|
||||
@@ -6,8 +6,8 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ package noppes.npcs.entity.old;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -189,10 +189,10 @@ public class RoleCompanion extends RoleInterface {
|
||||
EntityCustomNpc npc = (EntityCustomNpc) this.npc;
|
||||
npc.ai.animationType = stage.animation;
|
||||
if(stage == EnumCompanionStage.BABY){
|
||||
npc.modelData.arms.setScale(0.5f, 0.5f, 0.5f);
|
||||
npc.modelData.legs.setScale(0.5f, 0.5f, 0.5f);
|
||||
npc.modelData.body.setScale(0.5f, 0.5f, 0.5f);
|
||||
npc.modelData.head.setScale(0.7f, 0.7f, 0.7f);
|
||||
npc.modelData.modelScale.arms.setScale(0.5f, 0.5f, 0.5f);
|
||||
npc.modelData.modelScale.legs.setScale(0.5f, 0.5f, 0.5f);
|
||||
npc.modelData.modelScale.body.setScale(0.5f, 0.5f, 0.5f);
|
||||
npc.modelData.modelScale.head.setScale(0.7f, 0.7f, 0.7f);
|
||||
|
||||
npc.ai.onAttack = 1;
|
||||
npc.ai.setWalkingSpeed(3);
|
||||
@@ -200,10 +200,10 @@ public class RoleCompanion extends RoleInterface {
|
||||
talents.put(EnumCompanionTalent.INVENTORY, 0);
|
||||
}
|
||||
if(stage == EnumCompanionStage.CHILD){
|
||||
npc.modelData.arms.setScale(0.6f, 0.6f, 0.6f);
|
||||
npc.modelData.legs.setScale(0.6f, 0.6f, 0.6f);
|
||||
npc.modelData.body.setScale(0.6f, 0.6f, 0.6f);
|
||||
npc.modelData.head.setScale(0.8f, 0.8f, 0.8f);
|
||||
npc.modelData.modelScale.arms.setScale(0.6f, 0.6f, 0.6f);
|
||||
npc.modelData.modelScale.legs.setScale(0.6f, 0.6f, 0.6f);
|
||||
npc.modelData.modelScale.body.setScale(0.6f, 0.6f, 0.6f);
|
||||
npc.modelData.modelScale.head.setScale(0.8f, 0.8f, 0.8f);
|
||||
|
||||
npc.ai.onAttack = 0;
|
||||
npc.ai.setWalkingSpeed(4);
|
||||
@@ -211,10 +211,10 @@ public class RoleCompanion extends RoleInterface {
|
||||
talents.put(EnumCompanionTalent.SWORD, 0);
|
||||
}
|
||||
if(stage == EnumCompanionStage.TEEN){
|
||||
npc.modelData.arms.setScale(0.8f, 0.8f, 0.8f);
|
||||
npc.modelData.legs.setScale(0.8f, 0.8f, 0.8f);
|
||||
npc.modelData.body.setScale(0.8f, 0.8f, 0.8f);
|
||||
npc.modelData.head.setScale(0.9f, 0.9f, 0.9f);
|
||||
npc.modelData.modelScale.arms.setScale(0.8f, 0.8f, 0.8f);
|
||||
npc.modelData.modelScale.legs.setScale(0.8f, 0.8f, 0.8f);
|
||||
npc.modelData.modelScale.body.setScale(0.8f, 0.8f, 0.8f);
|
||||
npc.modelData.modelScale.head.setScale(0.9f, 0.9f, 0.9f);
|
||||
|
||||
npc.ai.onAttack = 0;
|
||||
npc.ai.setWalkingSpeed(5);
|
||||
@@ -222,10 +222,10 @@ public class RoleCompanion extends RoleInterface {
|
||||
talents.put(EnumCompanionTalent.ARMOR, 0);
|
||||
}
|
||||
if(stage == EnumCompanionStage.ADULT || stage == EnumCompanionStage.FULLGROWN){
|
||||
npc.modelData.arms.setScale(1f, 1f, 1f);
|
||||
npc.modelData.legs.setScale(1f, 1f, 1f);
|
||||
npc.modelData.body.setScale(1f, 1f, 1f);
|
||||
npc.modelData.head.setScale(1f, 1f, 1f);
|
||||
npc.modelData.modelScale.arms.setScale(1f, 1f, 1f);
|
||||
npc.modelData.modelScale.legs.setScale(1f, 1f, 1f);
|
||||
npc.modelData.modelScale.body.setScale(1f, 1f, 1f);
|
||||
npc.modelData.modelScale.head.setScale(1f, 1f, 1f);
|
||||
|
||||
npc.ai.onAttack = 0;
|
||||
npc.ai.setWalkingSpeed(5);
|
||||
|
||||
@@ -7,6 +7,7 @@ import noppes.npcs.api.ITimers;
|
||||
import noppes.npcs.api.entity.ICustomNpc;
|
||||
import noppes.npcs.api.entity.IEntityLivingBase;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.entity.data.IModelData;
|
||||
import noppes.npcs.api.handler.IOverlayHandler;
|
||||
import noppes.npcs.api.handler.data.IAnimationData;
|
||||
import noppes.npcs.api.handler.data.IFaction;
|
||||
@@ -931,12 +932,16 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
public void executeCommand(String command){
|
||||
NoppesUtilServer.runCommand(npc, npc.getCommandSenderName(), command, null);
|
||||
}
|
||||
|
||||
|
||||
public IModelData getModelData() {
|
||||
return npc instanceof EntityCustomNpc ? ((EntityCustomNpc) npc).modelData : null;
|
||||
}
|
||||
|
||||
public void setHeadScale(float x, float y, float z){
|
||||
if(npc instanceof EntityCustomNpc) {
|
||||
((EntityCustomNpc) this.npc).modelData.head.scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.head.scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.head.scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.head.scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.head.scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.head.scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
|
||||
npc.script.clientNeedsUpdate = true;
|
||||
}
|
||||
@@ -944,9 +949,9 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
|
||||
public void setBodyScale(float x, float y, float z){
|
||||
if(npc instanceof EntityCustomNpc) {
|
||||
((EntityCustomNpc) this.npc).modelData.body.scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.body.scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.body.scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.body.scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.body.scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.body.scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
|
||||
npc.script.clientNeedsUpdate = true;
|
||||
}
|
||||
@@ -954,9 +959,9 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
|
||||
public void setArmsScale(float x, float y, float z){
|
||||
if(npc instanceof EntityCustomNpc) {
|
||||
((EntityCustomNpc) this.npc).modelData.arms.scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.arms.scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.arms.scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.arms.scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.arms.scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.arms.scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
|
||||
npc.script.clientNeedsUpdate = true;
|
||||
}
|
||||
@@ -964,9 +969,9 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
|
||||
public void setLegsScale(float x, float y, float z){
|
||||
if(npc instanceof EntityCustomNpc) {
|
||||
((EntityCustomNpc) this.npc).modelData.legs.scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.legs.scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.legs.scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.legs.scaleX = ValueUtil.correctFloat(x, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.legs.scaleY = ValueUtil.correctFloat(y, 0.5f, 1.5f);
|
||||
((EntityCustomNpc) this.npc).modelData.modelScale.legs.scaleZ = ValueUtil.correctFloat(z, 0.5f, 1.5f);
|
||||
|
||||
npc.script.clientNeedsUpdate = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user