Remove unneeded synchronized()
This commit is contained in:
parent
090e8b9aad
commit
6609c62d90
1 changed files with 12 additions and 17 deletions
|
|
@ -219,9 +219,6 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||||
* Server access abstraction class
|
* Server access abstraction class
|
||||||
*/
|
*/
|
||||||
public class BukkitServer extends DynmapServerInterface {
|
public class BukkitServer extends DynmapServerInterface {
|
||||||
/* Chunk load handling */
|
|
||||||
private Object loadlock = new Object();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBlockIDAt(String wname, int x, int y, int z) {
|
public int getBlockIDAt(String wname, int x, int y, int z) {
|
||||||
World w = getServer().getWorld(wname);
|
World w = getServer().getWorld(wname);
|
||||||
|
|
@ -463,20 +460,18 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||||
public Boolean call() throws Exception {
|
public Boolean call() throws Exception {
|
||||||
boolean exhausted = true;
|
boolean exhausted = true;
|
||||||
|
|
||||||
synchronized(loadlock) {
|
if (prev_tick != cur_tick) {
|
||||||
if (prev_tick != cur_tick) {
|
prev_tick = cur_tick;
|
||||||
prev_tick = cur_tick;
|
cur_tick_starttime = System.nanoTime();
|
||||||
cur_tick_starttime = System.nanoTime();
|
}
|
||||||
}
|
if(chunks_in_cur_tick > 0) {
|
||||||
if(chunks_in_cur_tick > 0) {
|
boolean done = false;
|
||||||
boolean done = false;
|
while (!done) {
|
||||||
while (!done) {
|
int cnt = chunks_in_cur_tick;
|
||||||
int cnt = chunks_in_cur_tick;
|
if (cnt > 5) cnt = 5;
|
||||||
if (cnt > 5) cnt = 5;
|
chunks_in_cur_tick -= cc.loadChunks(cnt);
|
||||||
chunks_in_cur_tick -= cc.loadChunks(cnt);
|
exhausted = (chunks_in_cur_tick == 0) || ((System.nanoTime() - cur_tick_starttime) > perTickLimit);
|
||||||
exhausted = (chunks_in_cur_tick == 0) || ((System.nanoTime() - cur_tick_starttime) > perTickLimit);
|
done = exhausted || cc.isDoneLoading();
|
||||||
done = exhausted || cc.isDoneLoading();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return exhausted;
|
return exhausted;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue