mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
* start 1.21.6 update * change workflow * apply some patches * set experimental to true * some compile fixes * Updated Upstream (Purpur) Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@5d3463aa Updated Upstream (Paper) * Updated Upstream (Purpur) Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@5d3463aa Updated Upstream (Paper) * remove data converter for 1.21.6; move clumps to unapplied * Updated Upstream (Purpur) Upstream has released updates that appear to apply and compile correctly * Updated Upstream (Purpur) Upstream has released updates that appear to apply and compile correctly * Update upstream * Update upstream * update to 1.21.6-pre4 * update patches * fix compile * set readme version to 1.21.6 * Updated Upstream (Purpur) Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@439f15db Updated Upstream (Paper) PurpurMC/Purpur@46a28b93 [ci/skip] update version in README
51 lines
3.1 KiB
Diff
51 lines
3.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: dan28000 <pirkldan28@gmail.com>
|
|
Date: Thu, 12 Jun 2025 10:08:25 +0200
|
|
Subject: [PATCH] Implement loading plugins from external folder
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java b/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
|
|
index 70413fddd23ca1165cb5090cce4fddcb1bbca93f..ae70b84e6473fa2ed94416bf4bef88492de3e5f8 100644
|
|
--- a/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
|
|
+++ b/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
|
|
@@ -112,6 +112,20 @@ public class PluginInitializerManager {
|
|
// Register the default plugin directory
|
|
io.papermc.paper.plugin.util.EntrypointUtil.registerProvidersFromSource(io.papermc.paper.plugin.provider.source.DirectoryProviderSource.INSTANCE, pluginSystem.pluginDirectoryPath());
|
|
|
|
+ // DivineMC start - Register the plugin directory from flags
|
|
+ @SuppressWarnings("unchecked")
|
|
+ java.util.List<Path> pluginList = ((java.util.List<File>) optionSet.valuesOf("add-plugin-dir")).stream()
|
|
+ .filter(java.util.Objects::nonNull)
|
|
+ .map(f -> f.listFiles(file -> file.getName().endsWith(".jar")))
|
|
+ .filter(java.util.Objects::nonNull)
|
|
+ .flatMap(java.util.Arrays::stream)
|
|
+ .filter(File::isFile)
|
|
+ .map(File::toPath)
|
|
+ .toList();
|
|
+
|
|
+ io.papermc.paper.plugin.util.EntrypointUtil.registerProvidersFromSource(io.papermc.paper.plugin.provider.source.PluginFlagProviderSource.INSTANCE, pluginList);
|
|
+ // DivineMC end - Register the plugin directory from flags
|
|
+
|
|
// Register plugins from the flag
|
|
@SuppressWarnings("unchecked")
|
|
java.util.List<Path> files = ((java.util.List<File>) optionSet.valuesOf("add-plugin")).stream().map(File::toPath).toList();
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
index 03fe7d98252b93f4625359f50552e3cf60e82b9c..ff350b5744b586cad7c2f5e0a04770e76f039d39 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
@@ -180,6 +180,14 @@ public class Main {
|
|
.describedAs("Yml file");
|
|
// DivineMC end - Configuration
|
|
|
|
+ // DivineMC start - Implement loading plugins from external folder
|
|
+ acceptsAll(asList("add-plugin-dir", "add-extra-plugin-dir"), "Specify paths to directories containing extra plugin jars to be loaded in addition to those in the plugins folder. This argument can be specified multiple times, once for each extra plugin directory path.")
|
|
+ .withRequiredArg()
|
|
+ .ofType(File.class)
|
|
+ .defaultsTo(new File("extra"))
|
|
+ .describedAs("Directory");
|
|
+ // DivineMC end - Implement loading plugins from external folder
|
|
+
|
|
this.accepts("server-name", "Name of the server")
|
|
.withRequiredArg()
|
|
.ofType(String.class)
|