Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.16 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. public class Write {
  4.  
  5.     public Write() {
  6.         try {
  7.             DataOutputStream out = new DataOutputStream(new FileOutputStream("spotanim.dat"));
  8.             out.writeShort(SpotAnim.cache.length);
  9.             for (SpotAnim anim : SpotAnim.cache) {
  10.                 if (anim.originalModelColors == null) {
  11.                     out.writeByte(0);
  12.                     continue;
  13.                 }
  14.                 if (anim.modelID != -1) {
  15.                     out.writeByte(1);
  16.                     out.writeShort(anim.modelID);
  17.                 }
  18.                 if (anim.animationID != -1) {
  19.                     out.writeByte(2);
  20.                     out.writeShort(anim.animationID);
  21.                 }
  22.                 if (anim.resizeXY != -1) {
  23.                     out.writeByte(4);
  24.                     out.writeShort(anim.resizeXY);
  25.                 }
  26.                 if (anim.resizeZ != -1) {
  27.                     out.writeByte(5);
  28.                     out.writeShort(anim.resizeZ);
  29.                 }
  30.                 if (anim.rotation != 1) {
  31.                     out.writeByte(6);
  32.                     out.writeShort(anim.rotation);
  33.                 }
  34.                 if (anim.modelBrightness != -1) {
  35.                     out.writeByte(7);
  36.                     out.writeByte(anim.modelBrightness);
  37.                 }
  38.                 if (anim.modelShadow != -1) {
  39.                     out.writeByte(8);
  40.                     out.writeByte(anim.modelShadow);
  41.                 }
  42.                 if (anim.originalModelColors != null) {
  43.                     for (int i = 40; i < 50; i++) {
  44.                         out.writeByte((byte) i);
  45.                         out.writeShort(anim.originalModelColors[i - 40]);
  46.                     }
  47.                 }
  48.                 if (anim.modifiedModelColors != null) {
  49.                     for (int i = 50; i < 60; i++) {
  50.                         out.writeByte((byte) i);
  51.                         out.writeShort(anim.modifiedModelColors[i - 50]);
  52.                     }
  53.                 }
  54.                 out.writeByte(0);
  55.             }
  56.             out.flush();
  57.             out.close();
  58.         } catch (IOException e) {
  59.             e.printStackTrace();
  60.         }
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement