Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Fix Folia PR :
Browse files Browse the repository at this point in the history
PaperMC/Folia@480ce47 Fix command sender check
  • Loading branch information
Euphillya committed Oct 21, 2023
1 parent d047d4c commit e2f2e6d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions patches/server/0031-Fix-Folia-PR.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bierque Jason <bierquejason@gmail.com>
Date: Sat, 21 Oct 2023 19:50:16 +0200
Subject: [PATCH] Fix Folia PR :
https://github.com/PaperMC/Folia/pull/164/commits/480ce47ff596e6d95889ee45f8ff5ab27e2ef3b1
Fix command sender check


diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index cf922f625f92839480ef842722dc9024ce8d21de..73c015acc0c1801316192f1186375b9f90a506c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1024,7 +1024,7 @@ public final class CraftServer implements Server {
null,
1L
);
- } else if (sender instanceof ConsoleCommandSender console) {
+ } else if (sender instanceof ConsoleCommandSender || sender instanceof io.papermc.paper.commands.FeedbackForwardingSender) { // TenseiMC
io.papermc.paper.threadedregions.RegionizedServer.getInstance().addTask(() -> {
CraftServer.this.dispatchCommand(sender, commandLine);
});
@@ -1044,7 +1044,7 @@ public final class CraftServer implements Server {
// Folia start - region threading
if ((sender instanceof Entity entity)) {
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) { // TenseiMC
io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("Dispatching command async");
} else {
// huh?

0 comments on commit e2f2e6d

Please sign in to comment.