Advertisement
Corosus

Untitled

Dec 27th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.81 KB | None | 0 0
  1. @Override
  2.     public void populateStructureData() {
  3.         super.populateStructureData();
  4.         int pieceIndex = 0;
  5.         StructurePiece mainBody = new StructurePiece(pieceIndex++, (IStructureUser)job, 0, 0, 0);
  6.        
  7.         //body
  8.         for (int x = 2; x > -4; x--) {
  9.             for (int z = 1; z > -1; z--) {
  10.                 for (int y = 0; y < 2; y++) {              
  11.                     mainBody.nodes.add(new StructureNode(mainBody, x, y, z));
  12.                 }
  13.             }
  14.         }
  15.        
  16.         int armLength = 4;
  17.         int pincherLength = 3;
  18.        
  19.         StructurePiece armRight = new StructurePiece(pieceIndex++, mainBody, 0, 0, -2);
  20.         for (int i = 0; i < armLength; i++) armRight.nodes.add(new StructureNode(armRight, i, 0, 0));
  21.         mainBody.addChildPiece(armRight);
  22.         StructurePiece armRight2 = new StructurePiece(pieceIndex++, armRight, armLength, 0, 0);
  23.         for (int i = 0; i < armLength; i++) armRight2.nodes.add(new StructureNode(armRight2, i, 0, 0));
  24.         armRight.addChildPiece(armRight2);
  25.        
  26.         StructurePiece armRightClaw = new StructurePiece(pieceIndex++, armRight2, armLength, 0, 0);
  27.         for (int i = 0; i < pincherLength; i++) armRightClaw.nodes.add(new StructureNode(armRight, 0, 0, i-1)); //-1z to 1z
  28.         armRight2.addChildPiece(armRightClaw);
  29.         StructurePiece armRightClawPinchRight = new StructurePiece(pieceIndex++, armRightClaw, 0, 0, -1);
  30.         for (int i = 0; i < pincherLength; i++) armRightClawPinchRight.nodes.add(new StructureNode(armRight, i, 0, 0)); //-1z to 1z
  31.         armRightClaw.addChildPiece(armRightClawPinchRight);
  32.         StructurePiece armRightClawPinchLeft = new StructurePiece(pieceIndex++, armRightClaw, 0, 0, 1);
  33.         for (int i = 0; i < pincherLength; i++) armRightClawPinchLeft.nodes.add(new StructureNode(armRight, i, 0, 0)); //-1z to 1z
  34.         armRightClaw.addChildPiece(armRightClawPinchLeft);
  35.        
  36.         body = mainBody;
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement