diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-21 21:31:16 +0000 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-21 21:31:16 +0000 |
| commit | 420faddca46e70e3a70def168fb4e452ef193b0d (patch) | |
| tree | 247e334012e4bf9e4fa6d42718bf601ce6bd42d9 /java/darkknight/jewelrycraft/model/ModelShadowEye.java | |
| parent | 3f4c717de5ebc9b942d65ae45ac87c43bdf8a31b (diff) | |
Added just a butt ton of stuff, also thanks to pau101 for helping me with the Hand Pedestal animation :)
Diffstat (limited to 'java/darkknight/jewelrycraft/model/ModelShadowEye.java')
| -rw-r--r-- | java/darkknight/jewelrycraft/model/ModelShadowEye.java | 112 |
1 files changed, 49 insertions, 63 deletions
diff --git a/java/darkknight/jewelrycraft/model/ModelShadowEye.java b/java/darkknight/jewelrycraft/model/ModelShadowEye.java index 3f48b79..e396f72 100644 --- a/java/darkknight/jewelrycraft/model/ModelShadowEye.java +++ b/java/darkknight/jewelrycraft/model/ModelShadowEye.java @@ -3,15 +3,11 @@ // Java generated by Techne // Keep in mind that you still need to fill in some blanks // - ZeuX - package darkknight.jewelrycraft.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.boss.EntityWither; -import net.minecraft.util.MathHelper; public class ModelShadowEye extends ModelBase { @@ -27,11 +23,13 @@ public class ModelShadowEye extends ModelBase ModelRenderer Cable4; float field_82221_e, field_82220_d; + /** + * + */ public ModelShadowEye() { textureWidth = 64; textureHeight = 32; - Eye = new ModelRenderer(this, 0, 0); Eye.addBox(-3.5F, -3.5F, -3.5F, 7, 7, 7); Eye.setRotationPoint(0F, 17.5F, 0F); @@ -88,6 +86,16 @@ public class ModelShadowEye extends ModelBase setRotation(Cable4, 2.792527F, 0F, 0F); } + /** + * @param entity + * @param f + * @param f1 + * @param f2 + * @param f3 + * @param f4 + * @param f5 + */ + @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { Eye.render(f5); @@ -99,74 +107,52 @@ public class ModelShadowEye extends ModelBase Cable2.render(f5); Cable3.render(f5); Cable4.render(f5); - if (entity != null) - { - float x = (float) (f - entity.posX); - float y = (float) (f1 - entity.posY); - float z = (float) (f2 - entity.posZ); - if (f4 == 4) - { - if (f3 == 0) - { - if (z < 0) - { - Eye.rotateAngleY = (float) Math.asin(x / (Math.sqrt(x * x + z * z))) + 135f; - Eye.rotateAngleZ = (float) -Math.asin((y + 1) / (Math.sqrt(y * y + 4 * 4))); - } - else - { - Eye.rotateAngleY = (float) -Math.asin(x / (Math.sqrt(x * x + z * z))); - Eye.rotateAngleZ = (float) Math.asin((y + 1) / (Math.sqrt(y * y + 4 * 4))); - } + if (entity != null){ + float x = (float)(f - entity.posX); + float y = (float)(f1 - entity.posY); + float z = (float)(f2 - entity.posZ); + if (f4 == 4){ + if (f3 == 0) if (z < 0){ + Eye.rotateAngleY = (float)Math.asin(x / Math.sqrt(x * x + z * z)) + 135f; + Eye.rotateAngleZ = (float)-Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4)); + }else{ + Eye.rotateAngleY = (float)-Math.asin(x / Math.sqrt(x * x + z * z)); + Eye.rotateAngleZ = (float)Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4)); } - if (f3 == 1) - { - if (x < 0) - { - Eye.rotateAngleY = (float) -Math.asin(z / (Math.sqrt(x * x + z * z))); - Eye.rotateAngleZ = (float) Math.asin((y + 1) / (Math.sqrt(y * y + 4 * 4))); - } - else - { - Eye.rotateAngleY = (float) Math.asin(z / (Math.sqrt(x * x + z * z))) + 135f; - Eye.rotateAngleZ = (float) -Math.asin((y + 1) / (Math.sqrt(y * y + 4 * 4))); - } + if (f3 == 1) if (x < 0){ + Eye.rotateAngleY = (float)-Math.asin(z / Math.sqrt(x * x + z * z)); + Eye.rotateAngleZ = (float)Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4)); + }else{ + Eye.rotateAngleY = (float)Math.asin(z / Math.sqrt(x * x + z * z)) + 135f; + Eye.rotateAngleZ = (float)-Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4)); } - if (f3 == 2) - { - if (z < 0) - { - Eye.rotateAngleY = (float) Math.asin(x / (Math.sqrt(x * x + z * z))); - Eye.rotateAngleZ = (float) Math.asin((y + 1) / (Math.sqrt(y * y + 4 * 4))); - } - else - { - Eye.rotateAngleY = (float) -Math.asin(x / (Math.sqrt(x * x + z * z))) + 135f; - Eye.rotateAngleZ = (float) -Math.asin((y + 1) / (Math.sqrt(y * y + 4 * 4))); - } + if (f3 == 2) if (z < 0){ + Eye.rotateAngleY = (float)Math.asin(x / Math.sqrt(x * x + z * z)); + Eye.rotateAngleZ = (float)Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4)); + }else{ + Eye.rotateAngleY = (float)-Math.asin(x / Math.sqrt(x * x + z * z)) + 135f; + Eye.rotateAngleZ = (float)-Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4)); } - if (f3 == 3) - { - if (x < 0) - { - Eye.rotateAngleY = (float) -Math.asin(z / (Math.sqrt(x * x + z * z))) + 135f; - Eye.rotateAngleZ = (float) -Math.asin((y + 1) / (Math.sqrt(y * y + 4 * 4))); - } - else - { - Eye.rotateAngleY = (float) Math.asin(z / (Math.sqrt(x * x + z * z))); - Eye.rotateAngleZ = (float) Math.asin((y + 1) / (Math.sqrt(y * y + 4 * 4))); - } + if (f3 == 3) if (x < 0){ + Eye.rotateAngleY = (float)-Math.asin(z / Math.sqrt(x * x + z * z)) + 135f; + Eye.rotateAngleZ = (float)-Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4)); + }else{ + Eye.rotateAngleY = (float)Math.asin(z / Math.sqrt(x * x + z * z)); + Eye.rotateAngleZ = (float)Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4)); } - } - else - { + }else{ Eye.rotateAngleY = 0f; Eye.rotateAngleZ = 0f; } } } + /** + * @param model + * @param x + * @param y + * @param z + */ private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; |
