diff --git a/src/main/kotlin/io/dico/parcels2/blockvisitor/WorktimeLimiter.kt b/src/main/kotlin/io/dico/parcels2/blockvisitor/WorktimeLimiter.kt index f735903..4cfd2a3 100644 --- a/src/main/kotlin/io/dico/parcels2/blockvisitor/WorktimeLimiter.kt +++ b/src/main/kotlin/io/dico/parcels2/blockvisitor/WorktimeLimiter.kt @@ -103,7 +103,7 @@ interface WorkerScope : Timed { fun setProgress(progress: Double) } -private interface WorkerContinuation : Worker, WorkerScope { +interface WorkerInternal : Worker, WorkerScope { /** * Start or resumes the execution of this worker * and returns true if the worker completed @@ -126,18 +126,17 @@ class TickWorktimeLimiter(private val plugin: ParcelsPlugin, var options: TickWo // The currently registered bukkit scheduler task private var bukkitTask: BukkitTask? = null // The workers. - private val _workers = LinkedList() + private val _workers = LinkedList() override val workers: List = _workers override fun submit(task: TimeLimitedTask): Worker { - val worker: WorkerContinuation = WorkerImpl(plugin, task) + val worker: WorkerInternal = WorkerImpl(plugin, task) if (bukkitTask == null) { val completed = worker.resume(options.workTime.toLong()) if (completed) return worker bukkitTask = plugin.scheduleRepeating(0, options.tickInterval) { tickJobs() } } - _workers.addFirst(worker) return worker } @@ -183,7 +182,7 @@ class TickWorktimeLimiter(private val plugin: ParcelsPlugin, var options: TickWo private class WorkerImpl( val scope: CoroutineScope, val task: TimeLimitedTask -) : WorkerContinuation, CoroutineScope by scope { +) : WorkerInternal, CoroutineScope by scope { override var job: Job? = null; private set override val elapsedTime diff --git a/src/main/kotlin/io/dico/parcels2/storage/exposed/IdTables.kt b/src/main/kotlin/io/dico/parcels2/storage/exposed/IdTables.kt index 745895e..696b84c 100644 --- a/src/main/kotlin/io/dico/parcels2/storage/exposed/IdTables.kt +++ b/src/main/kotlin/io/dico/parcels2/storage/exposed/IdTables.kt @@ -12,7 +12,7 @@ import org.jetbrains.exposed.sql.statements.UpdateBuilder import org.joda.time.DateTime import java.util.UUID -sealed class IdTransactionsTable, QueryObj>(tableName: String, columnName: String) +abstract class IdTransactionsTable, QueryObj>(tableName: String, columnName: String) : Table(tableName) { val id = integer(columnName).autoIncrement().primaryKey()