Begin remigrate to Shiroha

uhm
This commit is contained in:
2026-07-14 11:32:51 +08:00
parent 5661499e95
commit 576a9a44c8
60 changed files with 379 additions and 379 deletions
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Wed, 8 Jul 2026 18:15:19 +0800
Subject: [PATCH] Rebrand to Camellia
Subject: [PATCH] Rebrand to Shiroha
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -13,7 +13,7 @@ index 08745a35b1ce8cc56d970472088de3cd17b9e43a..287cff1f4d994584457f00b1e42f283e
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Folia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page
+ Metrics metrics = new Metrics("Camellia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page // Camellia - Rebrand to Camellia
+ Metrics metrics = new Metrics("Camellia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page // Shiroha - Rebrand to Shiroha
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
@@ -22,12 +22,12 @@ index 08745a35b1ce8cc56d970472088de3cd17b9e43a..287cff1f4d994584457f00b1e42f283e
if (implVersion != null) {
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
- paperVersion = "git-Folia-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page
+ paperVersion = "git-Camellia-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page // Camellia - Rebrand to Camellia
+ paperVersion = "git-Camellia-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page // Shiroha - Rebrand to Shiroha
} else {
paperVersion = "unknown";
}
- metrics.addCustomChart(new Metrics.SimplePie("folia_version", () -> paperVersion)); // Folia - we have our own bstats page
+ metrics.addCustomChart(new Metrics.SimplePie("camellia_version", () -> paperVersion)); // Folia - we have our own bstats page // Camellia - Rebrand to Camellia
+ metrics.addCustomChart(new Metrics.SimplePie("camellia_version", () -> paperVersion)); // Folia - we have our own bstats page // Shiroha - Rebrand to Shiroha
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
@@ -41,8 +41,8 @@ index 30815c8970b1f1c88a3c7bb5fd36efd915f1687d..05f159bb5a8499f8957367ed11a9f110
private static final int DISTANCE_UNKNOWN = -2;
- private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/folia"; // Folia
- private static final String REPOSITORY = "PaperMC/Folia"; // Folia
+ private static final String DOWNLOAD_PAGE = "https://github.com/MonnaiRealms/Camellia"; // Folia // Camellia - Rebrand to Camellia
+ private static final String REPOSITORY = "MonnaiRealms/Camellia"; // Folia // Camellia - Rebrand to Camellia
+ private static final String DOWNLOAD_PAGE = "https://github.com/MonnaiRealms/Camellia"; // Folia // Shiroha - Rebrand to Shiroha
+ private static final String REPOSITORY = "MonnaiRealms/Camellia"; // Folia // Shiroha - Rebrand to Shiroha
private static final ServerBuildInfo BUILD_INFO = ServerBuildInfo.buildInfo();
private static final String USER_AGENT = BUILD_INFO.brandName() + "/" + BUILD_INFO.asString(VERSION_SIMPLE) + " (https://papermc.io)";
private static final Gson GSON = new Gson();
@@ -51,7 +51,7 @@ index 30815c8970b1f1c88a3c7bb5fd36efd915f1687d..05f159bb5a8499f8957367ed11a9f110
} else {
final Optional<MinecraftVersionFetcher> apiResult = fetchMinecraftVersionList();
- if (buildNumber.isPresent()) {
+ if (buildNumber.isPresent() && false) { // Camellia - Rebrand to Camellia - we do not have a version manager api currently, disable it
+ if (buildNumber.isPresent() && false) { // Shiroha - Rebrand to Shiroha - we do not have a version manager api currently, disable it
distance = fetchDistanceFromSiteApi(buildNumber.getAsInt());
} else {
final Optional<String> gitBranch = BUILD_INFO.gitBranch();
@@ -60,7 +60,7 @@ index 30815c8970b1f1c88a3c7bb5fd36efd915f1687d..05f159bb5a8499f8957367ed11a9f110
final OptionalInt buildNumber = PaperVersionFetcher.BUILD_INFO.buildNumber();
- if (buildNumber.isPresent()) {
+ if (buildNumber.isPresent() && false) { // Camellia - Rebrand to Camellia - we do not have a version manager api currently, disable it
+ if (buildNumber.isPresent() && false) { // Shiroha - Rebrand to Shiroha - we do not have a version manager api currently, disable it
distance = fetchDistanceFromSiteApi(buildNumber.getAsInt());
} else {
final Optional<String> gitBranch = PaperVersionFetcher.BUILD_INFO.gitBranch();
@@ -72,7 +72,7 @@ index 10a0be7a4db1a51579d113d279af7a9effe7f438..45cf7c5c9a4de2c7422e4d9c27fa0064
private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit";
private static final String BRAND_PAPER_NAME = "Paper";
+ private static final String BRAND_CAMELLIA_NAME = "Camellia"; // Camellia - Rebrand to Camellia
+ private static final String BRAND_CAMELLIA_NAME = "Camellia"; // Shiroha - Rebrand to Shiroha
private static final String BUILD_DEV = "DEV";
@@ -81,10 +81,10 @@ index 10a0be7a4db1a51579d113d279af7a9effe7f438..45cf7c5c9a4de2c7422e4d9c27fa0064
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
.map(Key::key)
- .orElse(Key.key("papermc", "folia")), // Folia
+ .orElse(BRAND_CAMELLIA_ID), // Folia // Camellia - Rebrand to Camellia
+ .orElse(BRAND_CAMELLIA_ID), // Folia // Shiroha - Rebrand to Shiroha
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
- .orElse("Folia"), // Folia
+ .orElse(BRAND_CAMELLIA_NAME), // Folia // Camellia - Rebrand to Camellia
+ .orElse(BRAND_CAMELLIA_NAME), // Folia // Shiroha - Rebrand to Shiroha
SharedConstants.getCurrentVersion().id(),
SharedConstants.getCurrentVersion().name(),
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
@@ -93,7 +93,7 @@ index 10a0be7a4db1a51579d113d279af7a9effe7f438..45cf7c5c9a4de2c7422e4d9c27fa0064
@Override
public boolean isBrandCompatible(final @NotNull Key brandId) {
- return brandId.equals(this.brandId);
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_FOLIA_ID); // Camellia - Rebrand to Camellia
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_FOLIA_ID); // Shiroha - Rebrand to Shiroha
}
@Override
@@ -106,10 +106,10 @@ index 5607f4cc8ca2f620461eb5e97d01d9db0d6b2303..5a86fa68007bc00fcf3ceda2d2492322
logger.log(Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once");
logger.log(Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes");
- logger.log(Level.SEVERE, "If you are unsure or still think this is a Paper bug, please report this to https://github.com/PaperMC/Paper/issues");
+ logger.log(Level.SEVERE, "If you are unsure or still think this is a Camellia bug, please report this to https://github.com/MonnaiRealms/Camellia/issues"); // Camellia - Rebrand to Camellia
+ logger.log(Level.SEVERE, "If you are unsure or still think this is a Camellia bug, please report this to https://github.com/MonnaiRealms/Camellia/issues"); // Shiroha - Rebrand to Shiroha
logger.log(Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports");
- logger.log(Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion());
+ logger.log(Level.SEVERE, "Camellia version: " + Bukkit.getServer().getVersion()); // Camellia - Rebrand to Camellia
+ logger.log(Level.SEVERE, "Camellia version: " + Bukkit.getServer().getVersion()); // Shiroha - Rebrand to Shiroha
if (net.minecraft.world.level.Level.lastPhysicsProblem != null) {
logger.log(Level.SEVERE, "------------------------------");
@@ -13,7 +13,7 @@ index 70e21e1fc337c6ea40e64020fa1832d1630cae97..f4af14dfd277fa0261a6e0623f8d11f2
static final Color DEFAULT_LEATHER_COLOR = Color.fromRGB(0xA06540);
private static final CraftItemFactory instance;
- private static final RandomSource randomSource = RandomSource.create();
+ private static final RandomSource randomSource = io.papermc.paper.threadedregions.util.ThreadLocalRandomSource.INSTANCE; // Camellia - Correct thread unsafe random sources
+ private static final RandomSource randomSource = io.papermc.paper.threadedregions.util.ThreadLocalRandomSource.INSTANCE; // Shiroha - Correct thread unsafe random sources
static {
instance = new CraftItemFactory();
@@ -12,7 +12,7 @@ index 9d0dc8815842a0583b212891680bd0c6461c30b9..9968f5064571b0917c8897c23fe06a14
@Override
public void reload() {
+ if (true) throw new UnsupportedOperationException(); // Camellia - Force disable reload command and api
+ if (true) throw new UnsupportedOperationException(); // Shiroha - Force disable reload command and api
// Paper start - lifecycle events
if (io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.blocksPluginReloading()) {
throw new IllegalStateException(org.bukkit.command.defaults.ReloadCommand.RELOADING_DISABLED_MESSAGE);
@@ -13,7 +13,7 @@ index 9661f033bbb2c00073f1c891e1411c2a9943a37a..70fccec55edb67c24c7ecbf3687682de
final PluginMeta config = type.getConfig(file);
- if ((config.getName().equals("spark") && config.getMainClass().equals("me.lucko.spark.bukkit.BukkitSparkPlugin")) && !SparksFly.isPluginPreferred()) {
+ if ((config.getName().equals("spark") && config.getMainClass().equals("me.lucko.spark.bukkit.BukkitSparkPlugin")) && !SparksFly.isPluginPreferred() && false) { // Camellia - Force disable builtin spark
+ if ((config.getName().equals("spark") && config.getMainClass().equals("me.lucko.spark.bukkit.BukkitSparkPlugin")) && !SparksFly.isPluginPreferred() && false) { // Shiroha - Force disable builtin spark
LOGGER.info("The spark plugin will not be loaded as this server bundles the spark profiler.");
return;
}
@@ -26,7 +26,7 @@ index 9968f5064571b0917c8897c23fe06a148c63a305..3c46e2cc23ac57df52996e3d2c5ae416
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher();
private final io.papermc.paper.potion.PaperPotionBrewer potionBrewer;
- public final io.papermc.paper.SparksFly spark;
+ public io.papermc.paper.SparksFly spark; // Paper - spark // Camellia - Force disable builtin spark
+ public io.papermc.paper.SparksFly spark; // Paper - spark // Shiroha - Force disable builtin spark
private final ServerConfiguration serverConfig = new PaperServerConfiguration();
// Paper start - Folia region threading API
@@ -35,7 +35,7 @@ index 9968f5064571b0917c8897c23fe06a148c63a305..3c46e2cc23ac57df52996e3d2c5ae416
this.potionBrewer = new io.papermc.paper.potion.PaperPotionBrewer(console); // Paper - custom potion mixes
datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper
- this.spark = new io.papermc.paper.SparksFly(this); // Paper - spark
+ if (false) this.spark = new io.papermc.paper.SparksFly(this); // Paper - spark // Camellia - Force disable builtin spark
+ if (false) this.spark = new io.papermc.paper.SparksFly(this); // Paper - spark // Shiroha - Force disable builtin spark
}
public boolean getCommandBlockOverride(String command) {
@@ -44,7 +44,7 @@ index 9968f5064571b0917c8897c23fe06a148c63a305..3c46e2cc23ac57df52996e3d2c5ae416
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
- this.spark.registerCommandBeforePlugins(this); // Paper - spark
+ if (false) this.spark.registerCommandBeforePlugins(this); // Paper - spark // Camellia - Force disable builtin spark
+ if (false) this.spark.registerCommandBeforePlugins(this); // Paper - spark // Shiroha - Force disable builtin spark
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -53,7 +53,7 @@ index 9968f5064571b0917c8897c23fe06a148c63a305..3c46e2cc23ac57df52996e3d2c5ae416
this.enablePlugins(PluginLoadOrder.STARTUP);
this.enablePlugins(PluginLoadOrder.POSTWORLD);
- this.spark.registerCommandAfterPlugins(this); // Paper - spark
+ if (false) this.spark.registerCommandAfterPlugins(this); // Paper - spark // Camellia - Force disable builtin spark
+ if (false) this.spark.registerCommandAfterPlugins(this); // Paper - spark // Shiroha - Force disable builtin spark
// Paper start - brigadier command API
io.papermc.paper.command.brigadier.PaperCommands.INSTANCE.setValid(); // to clear invalid state for event fire below
io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.callReloadableRegistrarEvent(io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents.COMMANDS, io.papermc.paper.command.brigadier.PaperCommands.INSTANCE, org.bukkit.plugin.Plugin.class, io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.RELOAD); // call commands event for regular plugins
@@ -13,7 +13,7 @@ index 13b03dab807c5d83e086993af705e1d9a2676b4d..83894904de29c01a4e105c1fae625f91
PaperServerListPingEventImpl(MinecraftServer server, StatusClient client, int protocolVersion, @Nullable CachedServerIcon icon) {
super(client, server.motd(), server.getPlayerCount(), server.getMaxPlayers(),
- server.getServerModName() + ' ' + server.getServerVersion(), protocolVersion, icon);
+ moe.monnairealms.camellia.config.modules.misc.ServerModNameConfig.fakeVanilla ? server.getServerVersion() : server.getServerModName() + ' ' + server.getServerVersion(), protocolVersion, icon); // Camellia - Add config for server mod name
+ moe.monnairealms.camellia.config.modules.misc.ServerModNameConfig.fakeVanilla ? server.getServerVersion() : server.getServerModName() + ' ' + server.getServerVersion(), protocolVersion, icon); // Shiroha - Add config for server mod name
this.server = server;
}
@@ -13,7 +13,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
@Deprecated
public static void ensureTickThread(final String reason) {
- if (!isTickThread()) {
+ if (!isTickThread() && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Camellia - Add config to disable async catchers
+ if (!isTickThread() && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
LOGGER.error("Thread failed main thread check: " + reason + ", context=" + getThreadContext(), new Throwable());
throw new IllegalStateException(reason);
}
@@ -21,7 +21,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final BlockPos pos, final String reason) {
- if (!isTickThreadFor(world, pos)) {
+ if (!isTickThreadFor(world, pos) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Camellia - Add config to disable async catchers
+ if (!isTickThreadFor(world, pos) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", block_pos=" + pos;
LOGGER.error(ex, new Throwable());
@@ -30,7 +30,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final BlockPos pos, final int blockRadius, final String reason) {
- if (!isTickThreadFor(world, pos, blockRadius)) {
+ if (!isTickThreadFor(world, pos, blockRadius) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Camellia - Add config to disable async catchers
+ if (!isTickThreadFor(world, pos, blockRadius) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", block_pos=" + pos + ", block_radius=" + blockRadius;
LOGGER.error(ex, new Throwable());
@@ -39,7 +39,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final ChunkPos pos, final String reason) {
- if (!isTickThreadFor(world, pos)) {
+ if (!isTickThreadFor(world, pos) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Camellia - Add config to disable async catchers
+ if (!isTickThreadFor(world, pos) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", chunk_pos=" + pos;
LOGGER.error(ex, new Throwable());
@@ -48,7 +48,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final int chunkX, final int chunkZ, final String reason) {
- if (!isTickThreadFor(world, chunkX, chunkZ)) {
+ if (!isTickThreadFor(world, chunkX, chunkZ) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Camellia - Add config to disable async catchers
+ if (!isTickThreadFor(world, chunkX, chunkZ) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", chunk_pos=" + new ChunkPos(chunkX, chunkZ);
LOGGER.error(ex, new Throwable());
@@ -57,7 +57,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Entity entity, final String reason) {
- if (!isTickThreadFor(entity)) {
+ if (!isTickThreadFor(entity) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Camellia - Add config to disable async catchers
+ if (!isTickThreadFor(entity) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", entity=" + EntityUtil.dumpEntity(entity);
LOGGER.error(ex, new Throwable());
@@ -66,7 +66,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final AABB aabb, final String reason) {
- if (!isTickThreadFor(world, aabb)) {
+ if (!isTickThreadFor(world, aabb) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Camellia - Add config to disable async catchers
+ if (!isTickThreadFor(world, aabb) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", aabb=" + aabb;
LOGGER.error(ex, new Throwable());
@@ -75,7 +75,7 @@ index 6c74787321748702022787b65ff5465f8bcec4ad..5d7a4f42ed274d78e79f0d4e5dd974ff
public static void ensureTickThread(final Level world, final double blockX, final double blockZ, final String reason) {
- if (!isTickThreadFor(world, blockX, blockZ)) {
+ if (!isTickThreadFor(world, blockX, blockZ) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Camellia - Add config to disable async catchers
+ if (!isTickThreadFor(world, blockX, blockZ) && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Shiroha - Add config to disable async catchers
final String ex = "Thread failed main thread check: " +
reason + ", context=" + getThreadContext() + ", world=" + WorldUtil.getWorldName(world) + ", block_pos=" + new Vec3(blockX, 0.0, blockZ);
LOGGER.error(ex, new Throwable());
@@ -88,7 +88,7 @@ index 7e7a0ed944961af5ab7a49bc659da2862d2e2c82..1dc664a97442744d0a9364805cc6d6c5
public static void catchOp(String reason) {
- if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()) { // Paper - chunk system
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThread() && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Paper - chunk system // Camellia - Add config to disable async catchers
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThread() && !moe.monnairealms.camellia.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Paper - chunk system // Shiroha - Add config to disable async catchers
MinecraftServer.LOGGER.error("Thread {} failed main thread check: {}", Thread.currentThread().getName(), reason, new Throwable()); // Paper
throw new IllegalStateException("Asynchronous " + reason + "!");
}
@@ -16,7 +16,7 @@ index 6369b13e1fcdbdb25dd9d6e4d3bffdedbee4f739..ea27ce9d08b3b8bbb0cd4918dbf51fd8
public PaperPluginParent build(JarFile file, PaperPluginMeta configuration, Path source) {
// Folia start - block plugins not marked as supported
- if (!configuration.isFoliaSupported()) {
+ if (!configuration.isFoliaSupported() && !moe.monnairealms.camellia.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Camellia - disable check for folia supported
+ if (!configuration.isFoliaSupported() && !moe.monnairealms.camellia.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
@@ -29,7 +29,7 @@ index 6ef0042a355c65262bdb89dcf151bd644653216d..7da13c7a2c5303d8f3bee2db4b5b76a1
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() && !moe.monnairealms.camellia.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Camellia - disable check for folia supported
+ if (!configuration.isFoliaSupported() && !moe.monnairealms.camellia.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
@@ -42,7 +42,7 @@ index 55a095e00bfe15321d8a1d69beb232e9956b0df7..844d6211ae34b3136806b8513e30d48c
// Folia start - block plugins not marked as supported
- if (!descriptionFile.isFoliaSupported()) {
+ if (!descriptionFile.isFoliaSupported() && !moe.monnairealms.camellia.config.modules.unsupported.DisableCheckForFoliaSupported.disableForPaper) { // Camellia - disable check for folia supported
+ if (!descriptionFile.isFoliaSupported() && !moe.monnairealms.camellia.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
@@ -13,7 +13,7 @@ index b9f788693b0c4be48e8a923a3dec50555d135e7e..1ce8304688ff3751d2de3ada14539842
@Override
public Thread newThread(final Runnable run) {
- final Thread thread = new Thread(run, PlatformHooks.get().getBrand() + " Common Worker #" + this.idGenerator.getAndIncrement());
+ final Thread thread = new Thread(moe.monnairealms.camellia.config.modules.optimizations.CpuAffinityConfig.wrapForChunkSystemWorker(run), PlatformHooks.get().getBrand() + " Common Worker #" + this.idGenerator.getAndIncrement()); // Camellia - Add config for cpu affinity
+ final Thread thread = new Thread(moe.monnairealms.camellia.config.modules.optimizations.CpuAffinityConfig.wrapForChunkSystemWorker(run), PlatformHooks.get().getBrand() + " Common Worker #" + this.idGenerator.getAndIncrement()); // Shiroha - Add config for cpu affinity
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@@ -22,7 +22,7 @@ index b9f788693b0c4be48e8a923a3dec50555d135e7e..1ce8304688ff3751d2de3ada14539842
@Override
public Thread newThread(final Runnable run) {
- final Thread thread = new Thread(run, PlatformHooks.get().getBrand() + " I/O Worker #" + this.idGenerator.getAndIncrement());
+ final Thread thread = new Thread(moe.monnairealms.camellia.config.modules.optimizations.CpuAffinityConfig.wrapForChunkSystemIo(run), PlatformHooks.get().getBrand() + " I/O Worker #" + this.idGenerator.getAndIncrement()); // Camellia - Add config for cpu affinity
+ final Thread thread = new Thread(moe.monnairealms.camellia.config.modules.optimizations.CpuAffinityConfig.wrapForChunkSystemIo(run), PlatformHooks.get().getBrand() + " I/O Worker #" + this.idGenerator.getAndIncrement()); // Shiroha - Add config for cpu affinity
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@@ -12,11 +12,11 @@ index 532076c7358aa355ce5144075fe6bd79de6ef9e6..fa940f0dfc19aa2853b7a0d19743321d
return CraftLocation.toBukkit(pos, world);
}
+ // Camellia start - add BlockPos support
+ // Shiroha start - add BlockPos support
+ public static Location toLocation(Level world, BlockPos pos) {
+ return CraftLocation.toBukkit(pos, world);
+ }
+ // Camellia end - add BlockPos support
+ // Shiroha end - add BlockPos support
+
/**
* Converts a NMS World/Vector to Bukkit Location