Update CB/S

This commit is contained in:
Shane Freeder
2018-03-31 10:34:25 +01:00
parent 99efa104db
commit 1872a94c83
12 changed files with 28 additions and 28 deletions

View File

@@ -32,7 +32,7 @@ operations are decoupled from the sync tasks queue.
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java
new file mode 100644
index 000000000..061c0ac52
index 000000000..eaf869287
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java
@@ -0,0 +0,0 @@
@@ -160,11 +160,11 @@ index 000000000..061c0ac52
+ * @return
+ */
+ static boolean isValid(CraftTask runningTask) {
+ return runningTask.getPeriod() >= -1L;
+ return runningTask.getPeriod() >= CraftTask.NO_REPEATING;
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index e47f4cca2..ab423392a 100644
index cc4a256c2..5d0d26e1a 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -0,0 +0,0 @@ import java.util.concurrent.atomic.AtomicReference;
@@ -219,11 +219,11 @@ index e47f4cca2..ab423392a 100644
+ // Paper end
+
public int scheduleSyncDelayedTask(final Plugin plugin, final Runnable task) {
return this.scheduleSyncDelayedTask(plugin, task, 0l);
return this.scheduleSyncDelayedTask(plugin, task, 0L);
}
@@ -0,0 +0,0 @@ public class CraftScheduler implements BukkitScheduler {
} else if (period < -1l) {
period = -1l;
} else if (period < CraftTask.NO_REPEATING) {
period = CraftTask.NO_REPEATING;
}
- return handle(new CraftAsyncTask(runners, plugin, runnable, nextId(), period), delay);
+ return handle(new CraftAsyncTask(this.asyncScheduler.runners, plugin, runnable, nextId(), period), delay); // Paper
@@ -291,7 +291,7 @@ index e47f4cca2..ab423392a 100644
+ // Paper end
for (CraftTask task = head.getNext(); task != null; task = task.getNext()) {
if (task.getTaskId() == taskId) {
return task.getPeriod() >= -1l; // The task will run
return task.getPeriod() >= CraftTask.NO_REPEATING; // The task will run
@@ -0,0 +0,0 @@ public class CraftScheduler implements BukkitScheduler {
}