Advertisement
Guest User

Untitled

a guest
Apr 4th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Item {
  2.   static int last = 0;
  3.   public static boolean sell() {
  4.     int current = 0;
  5.     StackTraceElement[] lines = Thread.currentThread().getStackTrace();
  6.     StackTraceElement ste = lines[2];
  7.     current = ste.getLineNumber();
  8.     if (last == current) return false;
  9.     last = current;
  10.     return true;
  11.   }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement