diff --git a/src/main/java/noppes/npcs/ModelPartData.java b/src/main/java/noppes/npcs/ModelPartData.java index a75b6f376..963bd3d30 100644 --- a/src/main/java/noppes/npcs/ModelPartData.java +++ b/src/main/java/noppes/npcs/ModelPartData.java @@ -1,6 +1,5 @@ package noppes.npcs; -import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; @@ -10,10 +9,6 @@ public class ModelPartData { public byte type = 0; public boolean playerTexture; - public int amount, maxAge, scaleRateStart, alphaRateStart; - public float scale1, scale2, scaleRate, gravity, alpha1, alpha2, alphaRate; - public double x, y, z, motionX, motionY, motionZ; - private ResourceLocation location; public ModelPartData(){ @@ -29,28 +24,6 @@ public class ModelPartData { NBTTagCompound compound = new NBTTagCompound(); compound.setByte("Type", type); compound.setInteger("Color", color); - - compound.setInteger("Amount", amount); - compound.setInteger("MaxAge", maxAge); - - compound.setFloat("Scale1", scale1); - compound.setFloat("Scale2", scale2); - compound.setFloat("ScaleRate", scaleRate); - compound.setInteger("ScaleRateStart",scaleRateStart); - - compound.setFloat("Alpha1", alpha1); - compound.setFloat("Alpha2", alpha2); - compound.setFloat("AlphaRate", alphaRate); - compound.setInteger("AlphaRateStart",alphaRateStart); - - compound.setDouble("X",x); - compound.setDouble("Y",y); - compound.setDouble("Z",z); - compound.setDouble("MotionX",motionX); - compound.setDouble("MotionY",motionY); - compound.setDouble("MotionZ",motionZ); - compound.setFloat("Gravity",gravity); - if(texture != null && !texture.isEmpty()) compound.setString("Texture", texture); compound.setBoolean("PlayerTexture", playerTexture); @@ -61,70 +34,10 @@ public class ModelPartData { type = compound.getByte("Type"); color = compound.getInteger("Color"); texture = compound.getString("Texture"); - - amount = compound.getInteger("Amount"); - maxAge = compound.getInteger("MaxAge"); - - scale1 = compound.getFloat("Scale1"); - scale2 = compound.getFloat("Scale2"); - scaleRate = compound.getFloat("ScaleRate"); - scaleRateStart = compound.getInteger("ScaleRateStart"); - - alpha1 = compound.getFloat("Alpha1"); - alpha2 = compound.getFloat("Alpha2"); - alphaRate = compound.getFloat("AlphaRate"); - alphaRateStart = compound.getInteger("AlphaRateStart"); - - x = compound.getDouble("X"); - y = compound.getDouble("Y"); - z = compound.getDouble("Z"); - motionX = compound.getDouble("MotionX"); - motionY = compound.getDouble("MotionY"); - motionZ = compound.getDouble("MotionZ"); - gravity = compound.getFloat("Gravity"); - playerTexture = compound.getBoolean("PlayerTexture"); location = null; } - public void setAttributes(String texture, int HEXcolor, int amount, int maxAge, - double x, double y, double z, - double motionX, double motionY, double motionZ, float gravity, - float scale1, float scale2, float scaleRate, int scaleRateStart, - float alpha1, float alpha2, float alphaRate, int alphaRateStart) { - this.location = null; - if(texture.isEmpty()){ - playerTexture = true; - this.texture = texture; - } - else{ - this.texture = texture; - this.color = HEXcolor; - this.amount = amount; - - this.scale1 = scale1; - this.scale2 = scale2; - this.scaleRate = scaleRate; - this.scaleRateStart = scaleRateStart; - - this.alpha1 = alpha1; - this.alpha2 = alpha2; - this.alphaRate = alphaRate; - this.alphaRateStart = alphaRateStart; - - this.maxAge = maxAge; - this.x = x; - this.y = y; - this.z = z; - this.motionX = motionX; - this.motionY = motionY; - this.motionZ = motionZ; - this.gravity = gravity; - - playerTexture = false; - } - } - public ResourceLocation getResource(){ if(texture.isEmpty()) return null; @@ -159,55 +72,4 @@ public class ModelPartData { return str; } - - public int getAmount() { - return amount; - } - - public double getX() { - return x; - } - public double getY() { - return y; - } - public double getZ() { - return z; - } - public double getMotionX() { - return motionX; - } - public double getMotionY() { - return motionY; - } - public double getMotionZ() { - return motionZ; - } - - public float getScale1() { - return scale1; - } - public float getScale2() {return scale2;} - public float getScaleRate() { - return scaleRate; - } - public int getScaleRateStart() {return scaleRateStart;} - - public float getAlpha1() {return alpha1;} - public float getAlpha2() {return alpha2;} - public float getAlphaRate() { - return alphaRate; - } - public int getAlphaRateStart() {return alphaRateStart;} - - public int getMaxAge() { - return maxAge; - } - - public float getGravity() { - return gravity; - } - - public void setAmount(int amount) { - this.amount = amount; - } -} +} \ No newline at end of file diff --git a/src/main/java/noppes/npcs/client/NoppesUtil.java b/src/main/java/noppes/npcs/client/NoppesUtil.java index a40f8f586..7c1ae2c9b 100644 --- a/src/main/java/noppes/npcs/client/NoppesUtil.java +++ b/src/main/java/noppes/npcs/client/NoppesUtil.java @@ -101,29 +101,20 @@ public class NoppesUtil { int entityID = buffer.readInt(); - ModelPartData particle = new ModelPartData(); - particle.setAttributes( - directory, HEXcolor, amount, maxAge, - x, y, z, - motionX, motionY, motionZ, gravity, - scale1, scale2, scaleRate, scaleRateStart, - alpha1, alpha2, alphaRate, alphaRateStart - ); - World worldObj = Minecraft.getMinecraft().theWorld; Entity entity = worldObj.getEntityByID(entityID); EntityCustomFX fx = new EntityCustomFX( entity, + directory, HEXcolor, x, y, z, motionX, motionY, motionZ, gravity, scale1, scale2, scaleRate, scaleRateStart, alpha1, alpha2, alphaRate, alphaRateStart, - particle.getMaxAge(), - particle + maxAge ); - for(int i = 0; i < particle.getAmount(); i++){ + for(int i = 0; i < amount; i++){ minecraft.effectRenderer.addEffect(fx); } } diff --git a/src/main/java/noppes/npcs/client/fx/EntityCustomFX.java b/src/main/java/noppes/npcs/client/fx/EntityCustomFX.java index bd6ee8456..9bfe60963 100644 --- a/src/main/java/noppes/npcs/client/fx/EntityCustomFX.java +++ b/src/main/java/noppes/npcs/client/fx/EntityCustomFX.java @@ -24,12 +24,11 @@ public class EntityCustomFX extends EntityFX { public float alphaRate = 0.0F; public int alphaRateStart = 0; - public EntityCustomFX(Entity entity, double x, double y, double z, + public EntityCustomFX(Entity entity, String directory, int HEXColor, double x, double y, double z, double motionX, double motionY, double motionZ, float gravity, float scale1, float scale2, float scaleRate, int scaleRateStart, float alpha1, float alpha2, float alphaRate, int alphaRateStart, - int age, - ModelPartData data) { + int age) { super(entity.worldObj, x, y, z, motionX, motionY, motionZ); this.scale1 = scale1; @@ -58,9 +57,9 @@ public class EntityCustomFX extends EntityFX { this.entity = entity; noClip = true; - particleRed = (data.color >> 16 & 255) / 255f; - particleGreen = (data.color >> 8 & 255) / 255f; - particleBlue = (data.color & 255) / 255f; + particleRed = (HEXColor >> 16 & 255) / 255f; + particleGreen = (HEXColor >> 8 & 255) / 255f; + particleBlue = (HEXColor & 255) / 255f; if(Math.floor(Math.random()*3) == 1){ move = false; @@ -69,7 +68,7 @@ public class EntityCustomFX extends EntityFX { this.startZ = (float) entity.posZ; } - location = new ResourceLocation(data.texture); + location = new ResourceLocation(directory); } @Override