Advertisement
Guest User

getlog

a guest
Jul 7th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. private Vec3 findLog()
  2. /*     */   {
  3. /* 192 */     Random rand = this.theGolem.getRNG();
  4. /*     */    
  5. /* 194 */     for (int var2 = 0; var2 < this.distance * 4.0F; var2++)
  6. /*     */     {
  7. /* 196 */       int x = (int)(this.theGolem.getHomePosition().posX + rand.nextInt((int)(1.0F + this.distance * 2.0F)) - this.distance);
  8. /* 197 */       int y = (int)(this.theGolem.getHomePosition().posY + rand.nextInt((int)(1.0F + this.distance)) - this.distance / 2.0F);
  9. /* 198 */       int z = (int)(this.theGolem.getHomePosition().posZ + rand.nextInt((int)(1.0F + this.distance * 2.0F)) - this.distance);
  10. /* 199 */       if (Utils.isWoodLog(this.theWorld, x, y, z)) {
  11. /* 200 */         Vec3 v = Vec3.createVectorHelper(x, y, z);
  12. /* 201 */         double dist = this.theGolem.getDistanceSq(x + 0.5D, y + 0.5D, z + 0.5D);
  13. /* 202 */         int yy = 1;
  14. /* 203 */         while ((Utils.isWoodLog(this.theWorld, x, y - yy, z)) && (this.theGolem.getDistanceSq(x + 0.5D, y - yy + 0.5D, z + 0.5D) < dist)) {
  15. /* 204 */           v = Vec3.createVectorHelper(x, y - yy, z);
  16. /* 205 */           dist = this.theGolem.getDistanceSq(x + 0.5D, y - yy + 0.5D, z + 0.5D);
  17. /* 206 */           yy++;
  18. /*     */         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement