Fix command sender check

This commit is contained in:
Jason Penilla 2023-10-21 09:17:18 -07:00 committed by Spottedleaf
parent d58fab2cce
commit 3843340cba
2 changed files with 4 additions and 4 deletions

View File

@ -21666,7 +21666,7 @@ index 1d7c663fa0e550bd0cfb9a4b83ccd7e2968666f0..f3df9c9b6cff85565514f990597f3fe5
LevelChunkTicks<T> levelChunkTicks = this.allContainers.get(l); LevelChunkTicks<T> levelChunkTicks = this.allContainers.get(l);
if (levelChunkTicks == null) { if (levelChunkTicks == null) {
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 bbc51ebf0dc0801ace9d5e7875fb2fe100b286bc..7ced957b11deb6643bff6547257f449c56038d74 100644 index bbc51ebf0dc0801ace9d5e7875fb2fe100b286bc..541915675dd3ad832992360283e3ba1b3cc62e27 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
@@ -311,7 +311,7 @@ public final class CraftServer implements Server { @@ -311,7 +311,7 @@ public final class CraftServer implements Server {
@ -21715,7 +21715,7 @@ index bbc51ebf0dc0801ace9d5e7875fb2fe100b286bc..7ced957b11deb6643bff6547257f449c
+ null, + null,
+ 1L + 1L
+ ); + );
+ } else if (sender instanceof ConsoleCommandSender console) { + } else if (sender instanceof ConsoleCommandSender || sender instanceof io.papermc.paper.commands.FeedbackForwardingSender) {
+ io.papermc.paper.threadedregions.RegionizedServer.getInstance().addTask(() -> { + io.papermc.paper.threadedregions.RegionizedServer.getInstance().addTask(() -> {
+ CraftServer.this.dispatchCommand(sender, commandLine); + CraftServer.this.dispatchCommand(sender, commandLine);
+ }); + });
@ -21735,7 +21735,7 @@ index bbc51ebf0dc0801ace9d5e7875fb2fe100b286bc..7ced957b11deb6643bff6547257f449c
+ // Folia start - region threading + // Folia start - region threading
+ if ((sender instanceof Entity entity)) { + if ((sender instanceof Entity entity)) {
+ io.papermc.paper.util.TickThread.ensureTickThread(((org.bukkit.craftbukkit.entity.CraftEntity)entity).getHandle(), "Dispatching command async"); + io.papermc.paper.util.TickThread.ensureTickThread(((org.bukkit.craftbukkit.entity.CraftEntity)entity).getHandle(), "Dispatching command async");
+ } else if (sender instanceof ConsoleCommandSender console) { + } else if (sender instanceof ConsoleCommandSender || sender instanceof io.papermc.paper.commands.FeedbackForwardingSender) {
+ io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("Dispatching command async"); + io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("Dispatching command async");
+ } else { + } else {
+ // huh? + // huh?

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Throw UnsupportedOperationException() for broken APIs
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 7ced957b11deb6643bff6547257f449c56038d74..4b43134f38ba203a309a412055461b57934da8f9 100644 index 541915675dd3ad832992360283e3ba1b3cc62e27..bc778637c7d4371cafa9bcda67f8965f57cc66d6 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
@@ -1268,6 +1268,7 @@ public final class CraftServer implements Server { @@ -1268,6 +1268,7 @@ public final class CraftServer implements Server {