i believe there should be a PlayerEventListener and a universal Event object instead of using all this gay shit
|
Hey, i am wondering if someone could convert this to an event or w.e for graham's event manager
and im not to sure where to put it at this code was supposed to go into process in the WorldObject class
Code:if (minewait > 0) { minewait--; } if (minetime > 0) { minetime--; } if (ismining && canmine && minewait <= 0 && goodDistance(skillX, skillY, getX(), getY(), 1)) { startAnimation(mineanim); minewait = 5; } //3176 3368 if (minetime <= 0 && ismining && goodDistance(skillX, skillY, getX(), getY(), 1)) { if (goodDistance(skillX, skillY, getX(), getY(), 1)) { mn.doaction(this, mn.toadd, -1, -1, skillX, skillY, -1, mn.xp); } else { ismining = false; canmine = false; } }
i believe there should be a PlayerEventListener and a universal Event object instead of using all this gay shit
There's no reason to do that. Starting a thread to handle mining is a bad idea. What's the reason for it, honestly?
A server updates every 600 (or 500, depending on what you're using) milliseconds.
Just do a check in your process.
That's really all you need. Using a new thread would cause nothing but concurrency issues.Code:if(p.isMining()) { if(p.getMiningTimer() > 1) p.decrementMiningTimer(); else { p.isMining(false); p.addItem(id, 1); //Replace the object for all players. } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |