Compare commits

...
5 Commits
Author SHA1 Message Date
KAMKEEL 0088f750ee Update Gradle
Updated Mod Version
2021-05-10 16:13:33 -04:00
KAMKEEL 63f448b67d Removed Print Statements
Fixed Custom Entity's not loading Url64
2021-05-10 16:11:50 -04:00
KAMKEEL 0a665a46be Added Rotation Resets in Puppet Menu
Completed.
2021-05-10 15:13:30 -04:00
KAMKEEL 69a85769a4 Created Scale Reset Button 2021-05-09 04:17:44 -04:00
KAMKEEL 169eba238b Fixed Missing Texture Error
FIxed the Missing Texture Bug
Started to work on Reset Buttons
2021-05-09 02:58:18 -04:00
10 changed files with 102 additions and 83 deletions

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
version = "1.01"
version = "1.1"
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "CustomNPC-Plus"
-65
View File
@@ -1,65 +0,0 @@
package kam.npcs;
import net.minecraft.client.model.ModelBase;
import noppes.npcs.client.model.util.Model2DRenderer;
public class LegacyCode {
// Old MPM Model : Unused
// public ModelMPM(float par1) {
// super(par1);
// isArmor = par1 > 0;
// float par2 = 0;
// this.bipedCloak = new ModelRenderer(this, 0, 0);
// this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, par1);
// this.bipedEars = new ModelRenderer(this, 24, 0);
// this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, par1);
// this.bipedHead = new ModelScaleRenderer(this, 0, 0);
// this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1);
// this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
// this.bipedHeadwear = new ModelScaleRenderer(this, 32, 0);
// this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F);
// this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
// this.bipedBody = new ModelScaleRenderer(this, 16, 16);
// this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1);
// this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
// this.bipedRightArm = new ModelScaleRenderer(this, 40, 16);
// this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1);
// this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
// this.bipedLeftArm = new ModelScaleRenderer(this, 40, 16);
// this.bipedLeftArm.mirror = true;
// this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1);
// this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
// this.bipedRightLeg = new ModelScaleRenderer(this, 0, 16);
// this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
// this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F);
// this.bipedLeftLeg = new ModelScaleRenderer(this, 0, 16);
// this.bipedLeftLeg.mirror = true;
// this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
// this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F);
//
// headwear = new ModelHeadwear(this);
// legs = new ModelLegs(this, (ModelScaleRenderer)bipedRightLeg, (ModelScaleRenderer)bipedLeftLeg);
//
// this.bipedBody.addChild(breasts = new ModelBreasts(this));
// if(!isArmor){
// this.bipedHead.addChild(ears = new ModelEars(this));
// this.bipedHead.addChild(mohawk = new ModelMohawk(this));
// this.bipedHead.addChild(hair = new ModelHair(this));
// this.bipedHead.addChild(beard = new ModelBeard(this));
// this.bipedHead.addChild(snout = new ModelSnout(this));
// this.bipedHead.addChild(horns = new ModelHorns(this));
//
// tail = new ModelTail(this);
//
// this.bipedBody.addChild(wings = new ModelWings(this));
// this.bipedBody.addChild(skirt = new ModelSkirt(this));
// this.bipedBody.addChild(fin = new ModelFin(this));
//
// this.bipedLeftArm.addChild(clawsL = new ModelClaws(this, false));
// this.bipedRightArm.addChild(clawsR = new ModelClaws(this, true));
// }
// }
}
+1 -1
View File
@@ -63,7 +63,7 @@ import noppes.npcs.entity.old.EntityNpcNagaFemale;
import noppes.npcs.entity.old.EntityNpcNagaMale;
import noppes.npcs.entity.old.EntityNpcSkeleton;
@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.0.1")
@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.1")
public class CustomNpcs {
@ConfigProp(info = "Disable Chat Bubbles")
+2 -2
View File
@@ -24,7 +24,7 @@ public class DataDisplay {
public String url = "";
public GameProfile playerProfile;
public String texture = "customnpcs:textures/entity/humanmale/Steve.png";;
public String texture = "customnpcs:textures/entity/humanmale/Steve.png";
public String cloakTexture = "";
public String glowTexture = "";
@@ -120,7 +120,7 @@ public class DataDisplay {
cloakTexture = nbttagcompound.getString("CloakTexture");
glowTexture = nbttagcompound.getString("GlowTexture");
modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, 40);
modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, 30);
modelType = nbttagcompound.getInteger("modelType");
showName = nbttagcompound.getInteger("ShowName");
@@ -134,7 +134,7 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
}
if(button.id == 2){
display.skinType = (byte) button.getValue();
System.out.println("Skin Type set to:" + display.skinType);
// System.out.println("Skin Type set to:" + display.skinType);
// SKIN CHANGE
if (display.skinType != 3){
display.url = "";
@@ -33,6 +33,7 @@ import noppes.npcs.controllers.PixelmonHelper;
import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityFakeLiving;
import noppes.npcs.entity.EntityNPCInterface;
import org.lwjgl.Sys;
public class GuiCreationScreen extends GuiModelInterface implements ICustomScrollListener{
@@ -268,6 +269,7 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
}
// New Button for Changing Models
// URL Swapper
if(button.id == 250){
if(npc.display.modelType == 0){
if (npc.display.skinType == 2){
@@ -15,6 +15,11 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
private GuiScreen parent;
private int type = 0;
private GuiNpcSlider scaleWidth;
private GuiNpcSlider scaleHeight;
private GuiNpcSlider scaleDepth;
public GuiModelScale(GuiScreen parent, ModelData data, EntityCustomNpc npc){
super(npc);
this.parent = parent;
@@ -71,24 +76,65 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
private void drawSlider(int y, ModelPartConfig config){
y += 15;
addLabel(new GuiNpcLabel(10, "Width", guiLeft, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 10, guiLeft + 50, y, config.scaleX - 0.5f));
addLabel(new GuiNpcLabel(10, "Width", guiLeft - 25, y + 5, 0xFFFFFF));
scaleWidth = new GuiNpcSlider(this, 10, guiLeft + 50, y, config.scaleX - 0.5f);
addSlider(scaleWidth);
addButton(new GuiNpcButton(170, guiLeft + 8, y, 40, 20, "Reset"));
y += 22;
addLabel(new GuiNpcLabel(11, "Height", guiLeft, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 11, guiLeft + 50, y, config.scaleY - 0.5f));
addLabel(new GuiNpcLabel(11, "Height", guiLeft - 25, y + 5, 0xFFFFFF));
scaleHeight = new GuiNpcSlider(this, 11, guiLeft + 50, y, config.scaleY - 0.5f);
addSlider(scaleHeight);
addButton(new GuiNpcButton(171, guiLeft + 8, y, 40, 20, "Reset"));
y += 22;
addLabel(new GuiNpcLabel(12, "Depth", guiLeft, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 12, guiLeft + 50, y, config.scaleZ - 0.5f));
addLabel(new GuiNpcLabel(12, "Depth", guiLeft - 25, y + 5, 0xFFFFFF));
scaleDepth = new GuiNpcSlider(this, 12, guiLeft + 50, y, config.scaleZ - 0.5f);
addSlider(scaleDepth);
addButton(new GuiNpcButton(172, guiLeft + 8, y, 40, 20, "Reset"));
}
@Override
protected void actionPerformed(GuiButton btn) {
super.actionPerformed(btn);
if(btn.id < 4){
type = btn.id;
initGui();
}
else{
// Resetting Type
ModelPartConfig config = playerdata.head;
if(type == 1)
config = playerdata.body;
else if(type == 2)
config = playerdata.arms;
else if(type == 3)
config = playerdata.legs;
if(btn.id == 170){
config.scaleX = 1.0f;
scaleWidth.sliderValue = 0.5f;
int percent = (int) (50 + scaleWidth.sliderValue * 100);
scaleWidth.setString(percent + "%");
npc.updateHitbox();
}
else if(btn.id == 171){
config.scaleY = 1.0f;
scaleHeight.sliderValue = 0.5f;
int percent = (int) (50 + scaleHeight.sliderValue * 100);
scaleHeight.setString(percent + "%");
npc.updateHitbox();
}
else if(btn.id == 172){
config.scaleZ = 1.0f;
scaleDepth.sliderValue = 0.5f;
int percent = (int) (50 + scaleDepth.sliderValue * 100);
scaleDepth.setString(percent + "%");
npc.updateHitbox();
}
}
}
@Override
@@ -22,6 +22,10 @@ public class GuiNpcPuppet extends GuiModelInterface implements ISliderListener{
private int type = 6;
private JobPuppet job;
private PartConfig part;
private GuiNpcSlider rotateX;
private GuiNpcSlider rotateY;
private GuiNpcSlider rotateZ;
public GuiNpcPuppet(GuiScreen parent, EntityCustomNpc npc){
super(npc);
@@ -118,14 +122,20 @@ public class GuiNpcPuppet extends GuiModelInterface implements ISliderListener{
addButton(new GuiNpcButton(29, guiLeft + 100, y , 80, 20, new String[]{"gui.enabled","gui.disabled"}, config.disabled?1:0));
y += 22;
addLabel(new GuiNpcLabel(10, "X", guiLeft, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 10, guiLeft + 50, y, config.rotationX + 0.5f));
rotateX = new GuiNpcSlider(this, 10, guiLeft + 50, y, config.rotationX + 0.5f);
addSlider(rotateX);
addButton(new GuiNpcButton(170, guiLeft + 8, y, 40, 20, "Reset"));
y += 22;
addLabel(new GuiNpcLabel(11, "Y", guiLeft, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 11, guiLeft + 50, y, config.rotationY + 0.5f));
rotateY = new GuiNpcSlider(this, 11, guiLeft + 50, y, config.rotationY + 0.5f);
addSlider(rotateY);
addButton(new GuiNpcButton(171, guiLeft + 8, y, 40, 20, "Reset"));
y += 22;
addLabel(new GuiNpcLabel(12, "Z", guiLeft, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 12, guiLeft + 50, y, config.rotationZ + 0.5f));
}
rotateZ = new GuiNpcSlider(this, 12, guiLeft + 50, y, config.rotationZ + 0.5f);
addSlider(rotateZ);
addButton(new GuiNpcButton(172, guiLeft + 8, y, 40, 20, "Reset"));
}
@Override
@@ -151,6 +161,29 @@ public class GuiNpcPuppet extends GuiModelInterface implements ISliderListener{
if(btn.id == 32){
job.whileAttacking = button.getValue() == 0;
}
if(btn.id == 170 || btn.id == 171 || btn.id == 172){
if(btn.id == 170){
System.out.println(part.rotationX);
System.out.println(rotateX.sliderValue);
part.rotationX = 0.0f;
rotateX.sliderValue = 0.5f;
int percent = (int) ((rotateX.sliderValue) * 360);
rotateX.setString(percent + "%");
}
else if(btn.id == 171){
part.rotationY = 0.0f;
rotateY.sliderValue = 0.5f;
int percent = (int) ((rotateY.sliderValue) * 360);
rotateY.setString(percent + "%");
}
else{
part.rotationZ = 0.0f;
rotateZ.sliderValue = 0.5f;
int percent = (int) ((rotateZ.sliderValue) * 360);
rotateZ.setString(percent + "%");
}
npc.updateHitbox();
}
}
@Override
@@ -25,7 +25,7 @@ public class ImageBufferDownloadAlt extends ImageBufferDownload {
imageWidth = bufferedimage.getWidth(null);
imageHeight = bufferedimage.getHeight(null);
BufferedImage bufferedimage1 = new BufferedImage(imageWidth, imageWidth, 2);
BufferedImage bufferedimage1 = new BufferedImage(imageWidth, imageHeight, 2);
Graphics g = bufferedimage1.getGraphics();
g.drawImage(bufferedimage, 0, 0, null);
g.dispose();
@@ -267,8 +267,11 @@ public class RenderNPCInterface extends RenderLiving{
EntityNPCInterface npc = (EntityNPCInterface) entity;
if(npc.textureLocation == null){
if(npc.display.skinType == 0)
npc.textureLocation = new ResourceLocation(npc.display.texture);
if(npc.display.skinType == 0) {
if (!(npc.display.texture).equals("")) {
npc.textureLocation = new ResourceLocation(npc.display.texture);
}
}
else if(LastTextureTick < 5){ //fixes request flood somewhat
return AbstractClientPlayer.locationStevePng;
}