Use TimeUnit for time calculations
This commit is contained in:
@@ -39,6 +39,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
/**
|
||||
* @author Danny (Leifde)
|
||||
*/
|
||||
@@ -82,8 +84,8 @@ public class MobSkillFactory {
|
||||
int x = DataTool.getInt("x", skillData, 1);
|
||||
int y = DataTool.getInt("y", skillData, 1);
|
||||
int count = DataTool.getInt("count", skillData, 1);
|
||||
long duration = DataTool.getInt("time", skillData, 0) * 1000;
|
||||
long cooltime = DataTool.getInt("interval", skillData, 0) * 1000;
|
||||
long duration = SECONDS.toMillis(DataTool.getInt("time", skillData, 0));
|
||||
long cooltime = SECONDS.toMillis(DataTool.getInt("interval", skillData, 0));
|
||||
int iprop = DataTool.getInt("prop", skillData, 100);
|
||||
float prop = iprop / 100;
|
||||
int limit = DataTool.getInt("limit", skillData, 0);
|
||||
|
||||
@@ -27,6 +27,8 @@ import net.server.Server;
|
||||
import java.awt.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
public class SpawnPoint {
|
||||
private final int monster;
|
||||
private final int mobTime;
|
||||
@@ -87,7 +89,7 @@ public class SpawnPoint {
|
||||
public void monsterKilled(int aniTime) {
|
||||
nextPossibleSpawn = Server.getInstance().getCurrentTime();
|
||||
if (mobTime > 0) {
|
||||
nextPossibleSpawn += mobTime * 1000;
|
||||
nextPossibleSpawn += SECONDS.toMillis(mobTime);
|
||||
} else {
|
||||
nextPossibleSpawn += aniTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user