Files
Shiroha/shiroha-server/paper-patches/features/0007-Add-config-to-avoid-of-folia-supported-check.patch
T
NanaChiyo0721 c736416ca5
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s
Updated Upstream(Folia) & Drop Frustum filtering tracker patch
2026-08-08 11:46:48 +08:00

49 lines
3.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 18 Apr 2026 09:47:28 +0800
Subject: [PATCH] Add config to avoid of folia-supported check
This is in dangerous zone, we won't support it if you find any plugin bug if you enable it
Co-authored-by: Helvetica Volubi <88063803+suisuroru@users.noreply.github.com>
diff --git a/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java b/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java
index 6369b13e1fcdbdb25dd9d6e4d3bffdedbee4f739..6caec25d0cac61782303ad27a0d545903fd8af57 100644
--- a/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java
+++ b/src/main/java/io/papermc/paper/plugin/provider/type/paper/PaperPluginProviderFactory.java
@@ -25,7 +25,7 @@ class PaperPluginProviderFactory implements PluginTypeFactory<PaperPluginParent,
@Override
public PaperPluginParent build(JarFile file, PaperPluginMeta configuration, Path source) {
// Folia start - block plugins not marked as supported
- if (!configuration.isFoliaSupported()) {
+ if (!configuration.isFoliaSupported() && !io.nanachiyo0721.shiroha.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
throw new RuntimeException("Could not load plugin '" + configuration.getDisplayName() + "' as it is not marked as supporting Folia!");
}
// Folia end - block plugins not marked as supported
diff --git a/src/main/java/io/papermc/paper/plugin/provider/type/spigot/SpigotPluginProviderFactory.java b/src/main/java/io/papermc/paper/plugin/provider/type/spigot/SpigotPluginProviderFactory.java
index 6ef0042a355c65262bdb89dcf151bd644653216d..f009da59c9e54a6660d2f35104c56ac2c8e5df59 100644
--- a/src/main/java/io/papermc/paper/plugin/provider/type/spigot/SpigotPluginProviderFactory.java
+++ b/src/main/java/io/papermc/paper/plugin/provider/type/spigot/SpigotPluginProviderFactory.java
@@ -27,7 +27,7 @@ class SpigotPluginProviderFactory implements PluginTypeFactory<SpigotPluginProvi
@Override
public SpigotPluginProvider build(JarFile file, PluginDescriptionFile configuration, Path source) throws InvalidDescriptionException {
// Folia start - block plugins not marked as supported
- if (!configuration.isFoliaSupported()) {
+ if (!configuration.isFoliaSupported() && !io.nanachiyo0721.shiroha.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
throw new RuntimeException("Could not load plugin '" + configuration.getDisplayName() + "' as it is not marked as supporting Folia!");
}
// Folia end - block plugins not marked as supported
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 804ea060fc5dc0d0ab89574a75604cdf911b4e6c..2bccd05d7c131ba98419007bb8688eddecf85643 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -393,7 +393,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
// Folia start - block plugins not marked as supported
- if (!descriptionFile.isFoliaSupported()) {
+ if (!descriptionFile.isFoliaSupported() && !io.nanachiyo0721.shiroha.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Shiroha - disable check for folia supported
throw new InvalidPluginException("Plugin " + descriptionFile.getFullName() + " is not marked as supporting regionised multithreading");
}
// Folia end - block plugins not marked as supported