Okay, so I've written this based on these charts:
Mining - RuneScape Guide - RuneHQ
Woodcutting - RuneScape Guide - RuneHQ
Code:
private static double getRockRespawnTime(Rock rock) {
double baseTime = rock.getRespawnTimer();
if(rock == Rock.CLAY)
return 2;
int max = Constants.MAX_PLAYERS;
int playersOnline = World.getWorld().getPlayers().size();
if(playersOnline >= max-100)
return rock.getRespawnTimer();
int factor = 8 - (playersOnline/250 == 0 ? 1 : playersOnline/250);
double timeInS = (rock.getRespawnTimer()*600)/1000;
double secondFactor = Math.sqrt(baseTime);
double ticks;
for(int i = 0; i < factor; i++)
timeInS += secondFactor;
ticks = (timeInS * 1000)/600;
return ticks;
}
The same formula is used for both woodcutting and mining, and this will return the amount of ticks it takes for the rock or tree to respawn.
Also Here are the base respawn times..
Mining:
Code:
CLAY 2 always 2 ticks no matter the amount of players
COPPER 3.33
TIN 3.33
IRON 8.33
SILVER 100
GOLD 100
COAL 46.66, 3
MITHRIL 203.33
ADAMANTITE 416.66
RUNE 1000
Woodcutting:
Code:
NORMAL 50 will always be between 50-100 ticks no matter the amount of player.
WILLOW 13.6
OAK 13.6
MAGIC 120
MAPLE 58.3
MAHOGANY 100
TEAK 100
ACHEY 50
YEW 100