mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
Update Upstream
This commit is contained in:
parent
980d53d156
commit
9b1e9b43ff
7 changed files with 78 additions and 72 deletions
|
@ -1,4 +1,4 @@
|
||||||
From 80656c9b210ef9a23038323e4c282b5d8d97a457 Mon Sep 17 00:00:00 2001
|
From 2c913b7c57722b5fc2e43d952dddf30fc0d3b172 Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Thu, 3 Mar 2016 04:00:11 -0600
|
Date: Thu, 3 Mar 2016 04:00:11 -0600
|
||||||
Subject: [PATCH] Timings v2
|
Subject: [PATCH] Timings v2
|
||||||
|
@ -1674,7 +1674,7 @@ index 2d5dc2179..916781403 100644
|
||||||
|
|
||||||
public Player.Spigot spigot()
|
public Player.Spigot spigot()
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
index 71ee1fdd5..e149dbf62 100644
|
index f11bd7545..93b9134d6 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
@@ -14,6 +14,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
@@ -14,6 +14,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
@ -1685,7 +1685,7 @@ index 71ee1fdd5..e149dbf62 100644
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.plugin.IllegalPluginAccessException;
|
import org.bukkit.plugin.IllegalPluginAccessException;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@@ -189,7 +190,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -193,7 +194,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1694,7 +1694,7 @@ index 71ee1fdd5..e149dbf62 100644
|
||||||
handle(task, 0L);
|
handle(task, 0L);
|
||||||
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
||||||
if (taskPending == task) {
|
if (taskPending == task) {
|
||||||
@@ -222,7 +223,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -226,7 +227,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1703,7 +1703,7 @@ index 71ee1fdd5..e149dbf62 100644
|
||||||
handle(task, 0L);
|
handle(task, 0L);
|
||||||
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
||||||
if (taskPending == task) {
|
if (taskPending == task) {
|
||||||
@@ -254,7 +255,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -258,7 +259,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
CraftScheduler.this.pending.clear();
|
CraftScheduler.this.pending.clear();
|
||||||
CraftScheduler.this.temp.clear();
|
CraftScheduler.this.temp.clear();
|
||||||
}
|
}
|
||||||
|
@ -1712,9 +1712,9 @@ index 71ee1fdd5..e149dbf62 100644
|
||||||
handle(task, 0L);
|
handle(task, 0L);
|
||||||
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
||||||
if (taskPending == task) {
|
if (taskPending == task) {
|
||||||
@@ -349,9 +350,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -357,9 +358,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
}
|
|
||||||
if (task.isSync()) {
|
if (task.isSync()) {
|
||||||
|
currentTask = task;
|
||||||
try {
|
try {
|
||||||
- task.timings.startTiming(); // Spigot
|
- task.timings.startTiming(); // Spigot
|
||||||
task.run();
|
task.run();
|
||||||
|
@ -1722,7 +1722,7 @@ index 71ee1fdd5..e149dbf62 100644
|
||||||
} catch (final Throwable throwable) {
|
} catch (final Throwable throwable) {
|
||||||
task.getOwner().getLogger().log(
|
task.getOwner().getLogger().log(
|
||||||
Level.WARNING,
|
Level.WARNING,
|
||||||
@@ -376,8 +375,10 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -386,8 +385,10 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
runners.remove(task.getTaskId());
|
runners.remove(task.getTaskId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1733,7 +1733,7 @@ index 71ee1fdd5..e149dbf62 100644
|
||||||
debugHead = debugHead.getNextHead(currentTick);
|
debugHead = debugHead.getNextHead(currentTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,6 +410,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -419,6 +420,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parsePending() {
|
private void parsePending() {
|
||||||
|
@ -1741,7 +1741,7 @@ index 71ee1fdd5..e149dbf62 100644
|
||||||
CraftTask head = this.head;
|
CraftTask head = this.head;
|
||||||
CraftTask task = head.getNext();
|
CraftTask task = head.getNext();
|
||||||
CraftTask lastTask = head;
|
CraftTask lastTask = head;
|
||||||
@@ -427,6 +429,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -437,6 +439,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
task.setNext(null);
|
task.setNext(null);
|
||||||
}
|
}
|
||||||
this.head = lastTask;
|
this.head = lastTask;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From 0674a65232371da02c375661f83d214aa59e4581 Mon Sep 17 00:00:00 2001
|
From 82d307e6cab4ac0ca3171b430e5eecd61cd27787 Mon Sep 17 00:00:00 2001
|
||||||
From: Joseph Hirschfeld <joe@ibj.io>
|
From: Joseph Hirschfeld <joe@ibj.io>
|
||||||
Date: Thu, 3 Mar 2016 03:15:41 -0600
|
Date: Thu, 3 Mar 2016 03:15:41 -0600
|
||||||
Subject: [PATCH] Add exception reporting event
|
Subject: [PATCH] Add exception reporting event
|
||||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Add exception reporting event
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java
|
diff --git a/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..93397188
|
index 000000000..93397188b
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java
|
+++ b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java
|
||||||
@@ -0,0 +1,38 @@
|
@@ -0,0 +1,38 @@
|
||||||
|
@ -50,7 +50,7 @@ index 00000000..93397188
|
||||||
+}
|
+}
|
||||||
\ No newline at end of file
|
\ No newline at end of file
|
||||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
index 2a1c11a0..cc4a9dbe 100644
|
index 2a1c11a04..cc4a9dbe6 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
|
@ -89,7 +89,7 @@ index 2a1c11a0..cc4a9dbe 100644
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||||
index e9bc23a6..4e51585a 100644
|
index 2b320cbd1..4e7e8e5fd 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||||
@@ -12,6 +12,7 @@ import java.util.Iterator;
|
@@ -12,6 +12,7 @@ import java.util.Iterator;
|
||||||
|
@ -144,7 +144,7 @@ index e9bc23a6..4e51585a 100644
|
||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
||||||
index 83322b85..b943a9b2 100644
|
index 83322b85b..b943a9b20 100644
|
||||||
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
||||||
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
||||||
@@ -1,5 +1,7 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
@ -172,7 +172,7 @@ index 83322b85..b943a9b2 100644
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java
|
diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java
|
||||||
index 936d6c64..50056f49 100644
|
index 936d6c640..50056f49a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PersistentCollection.java
|
--- a/src/main/java/net/minecraft/server/PersistentCollection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PersistentCollection.java
|
+++ b/src/main/java/net/minecraft/server/PersistentCollection.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
|
@ -199,7 +199,7 @@ index 936d6c64..50056f49 100644
|
||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
|
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
|
||||||
index 1ba26de5..6a92b5af 100644
|
index 1ba26de5c..6a92b5af8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/RegionFile.java
|
--- a/src/main/java/net/minecraft/server/RegionFile.java
|
||||||
+++ b/src/main/java/net/minecraft/server/RegionFile.java
|
+++ b/src/main/java/net/minecraft/server/RegionFile.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
|
@ -226,7 +226,7 @@ index 1ba26de5..6a92b5af 100644
|
||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
|
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||||
index c15a0d1f..5f9e9dde 100644
|
index c15a0d1f8..5f9e9ddef 100644
|
||||||
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
|
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
|
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
|
@ -245,7 +245,7 @@ index c15a0d1f..5f9e9dde 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||||
index 1c7c187c..68a04532 100644
|
index 1c7c187c7..68a045323 100644
|
||||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||||
@@ -7,6 +7,7 @@ import java.util.Random;
|
@@ -7,6 +7,7 @@ import java.util.Random;
|
||||||
|
@ -273,7 +273,7 @@ index 1c7c187c..68a04532 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java
|
diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java
|
||||||
index 9ff4f23a..6fce3015 100644
|
index 9ff4f23ab..6fce3015f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/VillageSiege.java
|
--- a/src/main/java/net/minecraft/server/VillageSiege.java
|
||||||
+++ b/src/main/java/net/minecraft/server/VillageSiege.java
|
+++ b/src/main/java/net/minecraft/server/VillageSiege.java
|
||||||
@@ -1,5 +1,7 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
@ -293,7 +293,7 @@ index 9ff4f23a..6fce3015 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||||
index 89197281..6be9c181 100644
|
index 89197281e..6be9c1815 100644
|
||||||
--- a/src/main/java/net/minecraft/server/World.java
|
--- a/src/main/java/net/minecraft/server/World.java
|
||||||
+++ b/src/main/java/net/minecraft/server/World.java
|
+++ b/src/main/java/net/minecraft/server/World.java
|
||||||
@@ -1,5 +1,7 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
@ -329,7 +329,7 @@ index 89197281..6be9c181 100644
|
||||||
this.tileEntityListTick.remove(tileTickPosition--);
|
this.tileEntityListTick.remove(tileTickPosition--);
|
||||||
continue;
|
continue;
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
index d50bbd2a..bce41128 100644
|
index 93b9134d6..26753fac5 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
@@ -15,6 +15,9 @@ import java.util.concurrent.atomic.AtomicReference;
|
@@ -15,6 +15,9 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
@ -342,7 +342,7 @@ index d50bbd2a..bce41128 100644
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.plugin.IllegalPluginAccessException;
|
import org.bukkit.plugin.IllegalPluginAccessException;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@@ -352,18 +355,24 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -360,20 +363,26 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
try {
|
try {
|
||||||
task.run();
|
task.run();
|
||||||
} catch (final Throwable throwable) {
|
} catch (final Throwable throwable) {
|
||||||
|
@ -363,6 +363,8 @@ index d50bbd2a..bce41128 100644
|
||||||
+ new ServerExceptionEvent(new ServerSchedulerException(msg, throwable, task))
|
+ new ServerExceptionEvent(new ServerSchedulerException(msg, throwable, task))
|
||||||
+ );
|
+ );
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
} finally {
|
||||||
|
currentTask = null;
|
||||||
}
|
}
|
||||||
parsePending();
|
parsePending();
|
||||||
} else {
|
} else {
|
||||||
|
@ -373,5 +375,5 @@ index d50bbd2a..bce41128 100644
|
||||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
2.14.3
|
2.17.1
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From 52882fe0e3db0ad65c6f46e7902d9b570db2ccac Mon Sep 17 00:00:00 2001
|
From 7ab0b381e76b124c13aaaefe3bd1fa04ab3a81f7 Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Sun, 5 Feb 2017 00:04:04 -0500
|
Date: Sun, 5 Feb 2017 00:04:04 -0500
|
||||||
Subject: [PATCH] Remove CraftScheduler Async Task Debugger
|
Subject: [PATCH] Remove CraftScheduler Async Task Debugger
|
||||||
|
@ -9,11 +9,11 @@ One report of a suspected memory leak with the system.
|
||||||
This adds additional overhead to asynchronous task dispatching
|
This adds additional overhead to asynchronous task dispatching
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
index 200d1ee7..cc4a256c 100644
|
index 26753fac5..a2fadaf82 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
@@ -80,8 +80,8 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -84,8 +84,8 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
private final ConcurrentHashMap<Integer, CraftTask> runners = new ConcurrentHashMap<Integer, CraftTask>();
|
private volatile CraftTask currentTask = null;
|
||||||
private volatile int currentTick = -1;
|
private volatile int currentTick = -1;
|
||||||
private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot
|
private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot
|
||||||
- private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}};
|
- private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}};
|
||||||
|
@ -23,7 +23,7 @@ index 200d1ee7..cc4a256c 100644
|
||||||
private static final int RECENT_TICKS;
|
private static final int RECENT_TICKS;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@@ -371,7 +371,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -381,7 +381,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
}
|
}
|
||||||
parsePending();
|
parsePending();
|
||||||
} else {
|
} else {
|
||||||
|
@ -32,7 +32,7 @@ index 200d1ee7..cc4a256c 100644
|
||||||
executor.execute(new ServerSchedulerReportingWrapper(task)); // Paper
|
executor.execute(new ServerSchedulerReportingWrapper(task)); // Paper
|
||||||
// We don't need to parse pending
|
// We don't need to parse pending
|
||||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||||
@@ -388,7 +388,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -398,7 +398,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
pending.addAll(temp);
|
pending.addAll(temp);
|
||||||
temp.clear();
|
temp.clear();
|
||||||
MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming();
|
MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming();
|
||||||
|
@ -41,7 +41,7 @@ index 200d1ee7..cc4a256c 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addTask(final CraftTask task) {
|
private void addTask(final CraftTask task) {
|
||||||
@@ -447,10 +447,15 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -457,10 +457,15 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -58,5 +58,5 @@ index 200d1ee7..cc4a256c 100644
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
--
|
--
|
||||||
2.14.3
|
2.17.1
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From 07c93a8dc027e8dbe591f476f6bcb2a134bab7a7 Mon Sep 17 00:00:00 2001
|
From 207ec851ed7f7af8980c0ee0152d4208843810ec Mon Sep 17 00:00:00 2001
|
||||||
From: Minecrell <minecrell@minecrell.net>
|
From: Minecrell <minecrell@minecrell.net>
|
||||||
Date: Fri, 9 Jun 2017 19:03:43 +0200
|
Date: Fri, 9 Jun 2017 19:03:43 +0200
|
||||||
Subject: [PATCH] Use TerminalConsoleAppender for console improvements
|
Subject: [PATCH] Use TerminalConsoleAppender for console improvements
|
||||||
|
@ -20,7 +20,7 @@ Other changes:
|
||||||
configuration
|
configuration
|
||||||
|
|
||||||
diff --git a/pom.xml b/pom.xml
|
diff --git a/pom.xml b/pom.xml
|
||||||
index 5d9f71b1..da69bb93 100644
|
index 9d273c6d9..26775156b 100644
|
||||||
--- a/pom.xml
|
--- a/pom.xml
|
||||||
+++ b/pom.xml
|
+++ b/pom.xml
|
||||||
@@ -53,12 +53,6 @@
|
@@ -53,12 +53,6 @@
|
||||||
|
@ -90,7 +90,7 @@ index 5d9f71b1..da69bb93 100644
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..685deaa0
|
index 000000000..685deaa0e
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
||||||
@@ -0,0 +1,17 @@
|
@@ -0,0 +1,17 @@
|
||||||
|
@ -113,7 +113,7 @@ index 00000000..685deaa0
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
|
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..d5bc6149
|
index 000000000..d5bc61490
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
|
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
|
||||||
@@ -0,0 +1,60 @@
|
@@ -0,0 +1,60 @@
|
||||||
|
@ -178,7 +178,7 @@ index 00000000..d5bc6149
|
||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||||
index 8f2afcc3..b3f1aa99 100644
|
index 8f2afcc32..b3f1aa999 100644
|
||||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||||
@@ -73,7 +73,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
@@ -73,7 +73,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||||
|
@ -231,7 +231,7 @@ index 8f2afcc3..b3f1aa99 100644
|
||||||
System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true));
|
System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true));
|
||||||
System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
|
System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 908a5d27..e8bddc17 100644
|
index 908a5d273..e8bddc171 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -42,7 +42,6 @@ import org.apache.commons.lang3.Validate;
|
@@ -42,7 +42,6 @@ import org.apache.commons.lang3.Validate;
|
||||||
|
@ -290,7 +290,7 @@ index 908a5d27..e8bddc17 100644
|
||||||
|
|
||||||
public boolean a(int i, String s) {
|
public boolean a(int i, String s) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||||
index fbbb4e73..15af94b3 100644
|
index 85357a003..3e5122486 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||||
@@ -78,8 +78,7 @@ public abstract class PlayerList {
|
@@ -78,8 +78,7 @@ public abstract class PlayerList {
|
||||||
|
@ -304,7 +304,7 @@ index fbbb4e73..15af94b3 100644
|
||||||
|
|
||||||
this.k = new GameProfileBanList(PlayerList.a);
|
this.k = new GameProfileBanList(PlayerList.a);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 27c6cadd..539f492e 100644
|
index 27c6caddc..539f492e0 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -128,7 +128,6 @@ import io.netty.buffer.ByteBuf;
|
@@ -128,7 +128,6 @@ import io.netty.buffer.ByteBuf;
|
||||||
|
@ -330,7 +330,7 @@ index 27c6cadd..539f492e 100644
|
||||||
@Override
|
@Override
|
||||||
public PluginCommand getPluginCommand(String name) {
|
public PluginCommand getPluginCommand(String name) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
index ec9508e9..d3d848f8 100644
|
index d565a720f..c9e8a8737 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||||
@@ -14,7 +14,7 @@ import java.util.logging.Logger;
|
@@ -14,7 +14,7 @@ import java.util.logging.Logger;
|
||||||
|
@ -369,10 +369,10 @@ index ec9508e9..d3d848f8 100644
|
||||||
+ System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
|
+ System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java
|
||||||
deleted file mode 100644
|
deleted file mode 100644
|
||||||
index 26a2fb89..00000000
|
index 26a2fb894..000000000
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java
|
--- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java
|
||||||
+++ /dev/null
|
+++ /dev/null
|
||||||
@@ -1,74 +0,0 @@
|
@@ -1,74 +0,0 @@
|
||||||
|
@ -451,7 +451,7 @@ index 26a2fb89..00000000
|
||||||
- }
|
- }
|
||||||
-}
|
-}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
||||||
index 33e8ea02..1e3aae3b 100644
|
index 33e8ea02c..1e3aae3b8 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
|
||||||
@@ -8,17 +8,27 @@ import java.util.logging.Level;
|
@@ -8,17 +8,27 @@ import java.util.logging.Level;
|
||||||
|
@ -530,7 +530,7 @@ index 33e8ea02..1e3aae3b 100644
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
|
||||||
index 984df408..bbb5a84f 100644
|
index 984df4083..bbb5a84f3 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
|
||||||
@@ -20,7 +20,7 @@ public class ServerShutdownThread extends Thread {
|
@@ -20,7 +20,7 @@ public class ServerShutdownThread extends Thread {
|
||||||
|
@ -544,7 +544,7 @@ index 984df408..bbb5a84f 100644
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
|
||||||
deleted file mode 100644
|
deleted file mode 100644
|
||||||
index b6409711..00000000
|
index b64097113..000000000
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
|
||||||
+++ /dev/null
|
+++ /dev/null
|
||||||
@@ -1,54 +0,0 @@
|
@@ -1,54 +0,0 @@
|
||||||
|
@ -603,7 +603,7 @@ index b6409711..00000000
|
||||||
- }
|
- }
|
||||||
-}
|
-}
|
||||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||||
index 5cee8f00..08b6bb7f 100644
|
index 5cee8f00e..08b6bb7f9 100644
|
||||||
--- a/src/main/resources/log4j2.xml
|
--- a/src/main/resources/log4j2.xml
|
||||||
+++ b/src/main/resources/log4j2.xml
|
+++ b/src/main/resources/log4j2.xml
|
||||||
@@ -1,12 +1,11 @@
|
@@ -1,12 +1,11 @@
|
||||||
|
@ -633,5 +633,5 @@ index 5cee8f00..08b6bb7f 100644
|
||||||
<AppenderRef ref="TerminalConsole" level="info"/>
|
<AppenderRef ref="TerminalConsole" level="info"/>
|
||||||
</Root>
|
</Root>
|
||||||
--
|
--
|
||||||
2.14.3
|
2.17.1
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From ce10f29e40b9ccb5989ca1c901e6f7644c806553 Mon Sep 17 00:00:00 2001
|
From 7391e13c1343b12093e395a98164b7b0859465fb Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Fri, 16 Mar 2018 22:59:43 -0400
|
Date: Fri, 16 Mar 2018 22:59:43 -0400
|
||||||
Subject: [PATCH] Improved Async Task Scheduler
|
Subject: [PATCH] Improved Async Task Scheduler
|
||||||
|
@ -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
|
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
|
new file mode 100644
|
||||||
index 00000000..eaf86928
|
index 000000000..eaf869287
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java
|
||||||
@@ -0,0 +1,127 @@
|
@@ -0,0 +1,127 @@
|
||||||
|
@ -164,7 +164,7 @@ index 00000000..eaf86928
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
index cc4a256c..5d0d26e1 100644
|
index a2fadaf82..223afc7ed 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||||
@@ -15,7 +15,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
@@ -15,7 +15,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
@ -184,20 +184,24 @@ index cc4a256c..5d0d26e1 100644
|
||||||
new Comparator<CraftTask>() {
|
new Comparator<CraftTask>() {
|
||||||
public int compare(final CraftTask o1, final CraftTask o2) {
|
public int compare(final CraftTask o1, final CraftTask o2) {
|
||||||
int value = Long.compare(o1.getNextRun(), o2.getNextRun());
|
int value = Long.compare(o1.getNextRun(), o2.getNextRun());
|
||||||
@@ -77,9 +76,9 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -77,13 +76,13 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
/**
|
/**
|
||||||
* These are tasks that are currently active. It's provided for 'viewing' the current state.
|
* These are tasks that are currently active. It's provided for 'viewing' the current state.
|
||||||
*/
|
*/
|
||||||
- private final ConcurrentHashMap<Integer, CraftTask> runners = new ConcurrentHashMap<Integer, CraftTask>();
|
- private final ConcurrentHashMap<Integer, CraftTask> runners = new ConcurrentHashMap<Integer, CraftTask>();
|
||||||
|
+ final ConcurrentHashMap<Integer, CraftTask> runners = new ConcurrentHashMap<Integer, CraftTask>(); // Paper
|
||||||
|
/**
|
||||||
|
* The sync task that is currently running on the main thread.
|
||||||
|
*/
|
||||||
|
private volatile CraftTask currentTask = null;
|
||||||
- private volatile int currentTick = -1;
|
- private volatile int currentTick = -1;
|
||||||
- private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot
|
- private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot
|
||||||
+ final ConcurrentHashMap<Integer, CraftTask> runners = new ConcurrentHashMap<Integer, CraftTask>(); // Paper
|
|
||||||
+ volatile int currentTick = -1; // Paper
|
+ volatile int currentTick = -1; // Paper
|
||||||
+ //private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot // Paper - moved to AsyncScheduler
|
+ //private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot // Paper - moved to AsyncScheduler
|
||||||
//private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}}; // Paper
|
//private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}}; // Paper
|
||||||
//private CraftAsyncDebugger debugTail = debugHead; // Paper
|
//private CraftAsyncDebugger debugTail = debugHead; // Paper
|
||||||
private static final int RECENT_TICKS;
|
private static final int RECENT_TICKS;
|
||||||
@@ -88,6 +87,23 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -92,6 +91,23 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
RECENT_TICKS = 30;
|
RECENT_TICKS = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +225,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
public int scheduleSyncDelayedTask(final Plugin plugin, final Runnable task) {
|
public int scheduleSyncDelayedTask(final Plugin plugin, final Runnable task) {
|
||||||
return this.scheduleSyncDelayedTask(plugin, task, 0L);
|
return this.scheduleSyncDelayedTask(plugin, task, 0L);
|
||||||
}
|
}
|
||||||
@@ -154,7 +170,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -158,7 +174,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
} else if (period < CraftTask.NO_REPEATING) {
|
} else if (period < CraftTask.NO_REPEATING) {
|
||||||
period = CraftTask.NO_REPEATING;
|
period = CraftTask.NO_REPEATING;
|
||||||
}
|
}
|
||||||
|
@ -230,7 +234,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> Future<T> callSyncMethod(final Plugin plugin, final Callable<T> task) {
|
public <T> Future<T> callSyncMethod(final Plugin plugin, final Callable<T> task) {
|
||||||
@@ -168,6 +184,11 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -172,6 +188,11 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
if (taskId <= 0) {
|
if (taskId <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -242,7 +246,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
CraftTask task = runners.get(taskId);
|
CraftTask task = runners.get(taskId);
|
||||||
if (task != null) {
|
if (task != null) {
|
||||||
task.cancel0();
|
task.cancel0();
|
||||||
@@ -207,6 +228,11 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -211,6 +232,11 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
|
|
||||||
public void cancelTasks(final Plugin plugin) {
|
public void cancelTasks(final Plugin plugin) {
|
||||||
Validate.notNull(plugin, "Cannot cancel tasks of null plugin");
|
Validate.notNull(plugin, "Cannot cancel tasks of null plugin");
|
||||||
|
@ -254,7 +258,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
final CraftTask task = new CraftTask(
|
final CraftTask task = new CraftTask(
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -244,6 +270,11 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -248,6 +274,11 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelAllTasks() {
|
public void cancelAllTasks() {
|
||||||
|
@ -266,7 +270,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
final CraftTask task = new CraftTask(
|
final CraftTask task = new CraftTask(
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -272,6 +303,13 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -276,6 +307,13 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCurrentlyRunning(final int taskId) {
|
public boolean isCurrentlyRunning(final int taskId) {
|
||||||
|
@ -278,9 +282,9 @@ index cc4a256c..5d0d26e1 100644
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
final CraftTask task = runners.get(taskId);
|
final CraftTask task = runners.get(taskId);
|
||||||
if (task == null || task.isSync()) {
|
if (task == null) {
|
||||||
return false;
|
return false;
|
||||||
@@ -286,6 +324,11 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -293,6 +331,11 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
if (taskId <= 0) {
|
if (taskId <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +296,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
for (CraftTask task = head.getNext(); task != null; task = task.getNext()) {
|
for (CraftTask task = head.getNext(); task != null; task = task.getNext()) {
|
||||||
if (task.getTaskId() == taskId) {
|
if (task.getTaskId() == taskId) {
|
||||||
return task.getPeriod() >= CraftTask.NO_REPEATING; // The task will run
|
return task.getPeriod() >= CraftTask.NO_REPEATING; // The task will run
|
||||||
@@ -296,6 +339,12 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -303,6 +346,12 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BukkitWorker> getActiveWorkers() {
|
public List<BukkitWorker> getActiveWorkers() {
|
||||||
|
@ -305,7 +309,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
final ArrayList<BukkitWorker> workers = new ArrayList<BukkitWorker>();
|
final ArrayList<BukkitWorker> workers = new ArrayList<BukkitWorker>();
|
||||||
for (final CraftTask taskObj : runners.values()) {
|
for (final CraftTask taskObj : runners.values()) {
|
||||||
// Iterator will be a best-effort (may fail to grab very new values) if called from an async thread
|
// Iterator will be a best-effort (may fail to grab very new values) if called from an async thread
|
||||||
@@ -332,6 +381,11 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -339,6 +388,11 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
pending.add(task);
|
pending.add(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -317,7 +321,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
return pending;
|
return pending;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,6 +393,11 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -346,6 +400,11 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
* This method is designed to never block or wait for locks; an immediate execution of all current tasks.
|
* This method is designed to never block or wait for locks; an immediate execution of all current tasks.
|
||||||
*/
|
*/
|
||||||
public void mainThreadHeartbeat(final int currentTick) {
|
public void mainThreadHeartbeat(final int currentTick) {
|
||||||
|
@ -329,7 +333,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
this.currentTick = currentTick;
|
this.currentTick = currentTick;
|
||||||
final List<CraftTask> temp = this.temp;
|
final List<CraftTask> temp = this.temp;
|
||||||
parsePending();
|
parsePending();
|
||||||
@@ -372,7 +431,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -382,7 +441,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
parsePending();
|
parsePending();
|
||||||
} else {
|
} else {
|
||||||
//debugTail = debugTail.setNext(new CraftAsyncDebugger(currentTick + RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
|
//debugTail = debugTail.setNext(new CraftAsyncDebugger(currentTick + RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
|
||||||
|
@ -338,7 +342,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
// We don't need to parse pending
|
// We don't need to parse pending
|
||||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||||
}
|
}
|
||||||
@@ -391,7 +450,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -401,7 +460,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
//debugHead = debugHead.getNextHead(currentTick); // Paper
|
//debugHead = debugHead.getNextHead(currentTick); // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +351,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
final AtomicReference<CraftTask> tail = this.tail;
|
final AtomicReference<CraftTask> tail = this.tail;
|
||||||
CraftTask tailTask = tail.get();
|
CraftTask tailTask = tail.get();
|
||||||
while (!tail.compareAndSet(tailTask, task)) {
|
while (!tail.compareAndSet(tailTask, task)) {
|
||||||
@@ -400,7 +459,13 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -410,7 +469,13 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
tailTask.setNext(task);
|
tailTask.setNext(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,7 +366,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
task.setNextRun(currentTick + delay);
|
task.setNextRun(currentTick + delay);
|
||||||
addTask(task);
|
addTask(task);
|
||||||
return task;
|
return task;
|
||||||
@@ -418,8 +483,8 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -428,8 +493,8 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
return ids.incrementAndGet();
|
return ids.incrementAndGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,7 +377,7 @@ index cc4a256c..5d0d26e1 100644
|
||||||
CraftTask head = this.head;
|
CraftTask head = this.head;
|
||||||
CraftTask task = head.getNext();
|
CraftTask task = head.getNext();
|
||||||
CraftTask lastTask = head;
|
CraftTask lastTask = head;
|
||||||
@@ -438,7 +503,7 @@ public class CraftScheduler implements BukkitScheduler {
|
@@ -448,7 +513,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||||
task.setNext(null);
|
task.setNext(null);
|
||||||
}
|
}
|
||||||
this.head = lastTask;
|
this.head = lastTask;
|
||||||
|
@ -383,5 +387,5 @@ index cc4a256c..5d0d26e1 100644
|
||||||
|
|
||||||
private boolean isReady(final int currentTick) {
|
private boolean isReady(final int currentTick) {
|
||||||
--
|
--
|
||||||
2.14.3
|
2.17.1
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8cc5a7ecb6204e23bf883bb9282dd2b70e0f7858
|
Subproject commit fbe3046435815a1423bf4a287ad9ec914c91bb55
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2086bb074d6795823451bdb9f857d83c0f566990
|
Subproject commit 642f6d2288b830f41347e8c0a162fbc0584e1579
|
Loading…
Reference in a new issue