cleanup: replace anonymous inner class with lambda
This commit is contained in:
@@ -21,9 +21,10 @@
|
||||
*/
|
||||
package server.maps;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import server.TimerManager;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
public class MapMonitor {
|
||||
private ScheduledFuture<?> monitorSchedule;
|
||||
private MapleMap map;
|
||||
@@ -32,12 +33,9 @@ public class MapMonitor {
|
||||
public MapMonitor(final MapleMap map, String portal) {
|
||||
this.map = map;
|
||||
this.portal = map.getPortal(portal);
|
||||
this.monitorSchedule = TimerManager.getInstance().register(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (map.getCharacters().size() < 1) {
|
||||
cancelAction();
|
||||
}
|
||||
this.monitorSchedule = TimerManager.getInstance().register(() -> {
|
||||
if (map.getCharacters().size() < 1) {
|
||||
cancelAction();
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user