@@ -594,7 +594,7 @@ index 0000000000000000000000000000000000000000..89bf48fd581ee6580b91e2eb31dd532c
594594+ }
595595diff --git a/src/main/java/io/papermc/paper/plugin/bootstrap/PluginProviderContextImpl.java b/src/main/java/io/papermc/paper/plugin/bootstrap/PluginProviderContextImpl.java
596596new file mode 100644
597- index 0000000000000000000000000000000000000000..2e450a9fce66e63ec94ee3d2579265eda28a1c3f
597+ index 0000000000000000000000000000000000000000..deffde92350f7c74694c2aa69799de446a3c3e0a
598598--- /dev/null
599599+++ b/src/main/java/io/papermc/paper/plugin/bootstrap/PluginProviderContextImpl.java
600600@@ -0,0 +1,45 @@
@@ -612,13 +612,13 @@ index 0000000000000000000000000000000000000000..2e450a9fce66e63ec94ee3d2579265ed
612612+ ComponentLogger logger, Path pluginSource) implements PluginProviderContext {
613613+
614614+ public static PluginProviderContextImpl of(PluginMeta config, ComponentLogger logger, Path pluginSource) {
615- + Path dataFolder = PluginInitializerManager.instance().pluginDirectoryPath().resolve(config.getDisplayName ());
615+ + Path dataFolder = PluginInitializerManager.instance().pluginDirectoryPath().resolve(config.getName ());
616616+
617617+ return new PluginProviderContextImpl(config, dataFolder, logger, pluginSource);
618618+ }
619619+
620620+ public static PluginProviderContextImpl of(PluginProvider<?> provider, Path pluginFolder) {
621- + Path dataFolder = pluginFolder.resolve(provider.getMeta().getDisplayName ());
621+ + Path dataFolder = pluginFolder.resolve(provider.getMeta().getName ());
622622+
623623+ return new PluginProviderContextImpl(provider.getMeta(), dataFolder, provider.getLogger(), provider.getSource());
624624+ }
@@ -813,7 +813,7 @@ index 0000000000000000000000000000000000000000..f9a2c55a354c877749db3f92956de802
813813+ }
814814diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java
815815new file mode 100644
816- index 0000000000000000000000000000000000000000..79995ab1b624d7c7aaaa467a86255ad97385cf72
816+ index 0000000000000000000000000000000000000000..56fc3e0984861e8ddb597cad3c0a0e0aca9606e6
817817--- /dev/null
818818+++ b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java
819819@@ -0,0 +1,207 @@
@@ -966,7 +966,7 @@ index 0000000000000000000000000000000000000000..79995ab1b624d7c7aaaa467a86255ad9
966966+ PluginMeta config = this.configuration;
967967+ PluginDescriptionFile pluginDescriptionFile = new PluginDescriptionFile(
968968+ config.getName(),
969- + config.getName().replace('_', ' ') ,
969+ + config.getName(),
970970+ config.getProvidedPlugins(),
971971+ config.getMainClass(),
972972+ "", // Classloader load order api
@@ -4387,12 +4387,13 @@ index 0000000000000000000000000000000000000000..e3430f535e8e9c3b8b44bf2daece8c47
43874387+ }
43884388diff --git a/src/main/java/io/papermc/paper/plugin/provider/configuration/PaperPluginMeta.java b/src/main/java/io/papermc/paper/plugin/provider/configuration/PaperPluginMeta.java
43894389new file mode 100644
4390- index 0000000000000000000000000000000000000000..7605efe37ac4a63cb95c8c64c576e93c0e676cc0
4390+ index 0000000000000000000000000000000000000000..95cc4dbe336e37f01d9f478068fd21a387754a91
43914391--- /dev/null
43924392+++ b/src/main/java/io/papermc/paper/plugin/provider/configuration/PaperPluginMeta.java
4393- @@ -0,0 +1,227 @@
4393+ @@ -0,0 +1,232 @@
43944394+ package io.papermc.paper.plugin.provider.configuration;
43954395+
4396+ + import com.google.common.base.Preconditions;
43964397+ import com.google.common.collect.ImmutableList;
43974398+ import io.leangen.geantyref.TypeToken;
43984399+ import io.papermc.paper.configuration.constraint.Constraint;
@@ -4411,6 +4412,7 @@ index 0000000000000000000000000000000000000000..7605efe37ac4a63cb95c8c64c576e93c
44114412+ import org.bukkit.plugin.PluginLoadOrder;
44124413+ import org.jetbrains.annotations.NotNull;
44134414+ import org.jetbrains.annotations.Nullable;
4415+ + import org.jetbrains.annotations.TestOnly;
44144416+ import org.spongepowered.configurate.CommentedConfigurationNode;
44154417+ import org.spongepowered.configurate.ConfigurateException;
44164418+ import org.spongepowered.configurate.loader.HeaderMode;
@@ -4456,8 +4458,6 @@ index 0000000000000000000000000000000000000000..7605efe37ac4a63cb95c8c64c576e93c
44564458+ @PluginConfigConstraints.PluginVersion
44574459+ private String apiVersion;
44584460+
4459- + private transient String displayName;
4460- +
44614461+ public PaperPluginMeta() {
44624462+ }
44634463+
@@ -4500,8 +4500,6 @@ index 0000000000000000000000000000000000000000..7605efe37ac4a63cb95c8c64c576e93c
45004500+ .build();
45014501+ }
45024502+
4503- + pluginConfiguration.displayName = pluginConfiguration.name.replace('_', ' ') + " v" + pluginConfiguration.version;
4504- +
45054503+ return pluginConfiguration;
45064504+ }
45074505+
@@ -4510,6 +4508,12 @@ index 0000000000000000000000000000000000000000..7605efe37ac4a63cb95c8c64c576e93c
45104508+ return this.name;
45114509+ }
45124510+
4511+ + @TestOnly
4512+ + public void setName(@NotNull String name) {
4513+ + Preconditions.checkNotNull(name, "name");
4514+ + this.name = name;
4515+ + }
4516+ +
45134517+ @Override
45144518+ public @NotNull String getMainClass() {
45154519+ return this.main;
@@ -4520,9 +4524,10 @@ index 0000000000000000000000000000000000000000..7605efe37ac4a63cb95c8c64c576e93c
45204524+ return this.version;
45214525+ }
45224526+
4523- + @Override
4524- + public @NotNull String getDisplayName() {
4525- + return this.displayName;
4527+ + @TestOnly
4528+ + public void setVersion(@NotNull String version) {
4529+ + Preconditions.checkNotNull(version, "version");
4530+ + this.version = version;
45264531+ }
45274532+
45284533+ @Override
@@ -7052,6 +7057,40 @@ index 0000000000000000000000000000000000000000..726eba26470e62b0e94a91418512e242
70527057+ assertThat(pm.getPermissions(), is(empty()));
70537058+ }
70547059+ }
7060+ diff --git a/src/test/java/io/papermc/paper/plugin/PluginNamingTest.java b/src/test/java/io/papermc/paper/plugin/PluginNamingTest.java
7061+ new file mode 100644
7062+ index 0000000000000000000000000000000000000000..860a2bc8200cf41b216a2e37cfbd2f5464d6542c
7063+ --- /dev/null
7064+ +++ b/src/test/java/io/papermc/paper/plugin/PluginNamingTest.java
7065+ @@ -0,0 +1,28 @@
7066+ + package io.papermc.paper.plugin;
7067+ +
7068+ + import io.papermc.paper.plugin.provider.configuration.PaperPluginMeta;
7069+ + import org.junit.Assert;
7070+ + import org.junit.Test;
7071+ +
7072+ + public class PluginNamingTest {
7073+ + private static final String TEST_NAME = "Test_Plugin";
7074+ + private static final String TEST_VERSION = "1.0";
7075+ +
7076+ + private final PaperPluginMeta pluginMeta;
7077+ +
7078+ + public PluginNamingTest() {
7079+ + this.pluginMeta = new PaperPluginMeta();
7080+ + this.pluginMeta.setName(TEST_NAME);
7081+ + this.pluginMeta.setVersion(TEST_VERSION);
7082+ + }
7083+ +
7084+ + @Test
7085+ + public void testName() {
7086+ + Assert.assertEquals(TEST_NAME, this.pluginMeta.getName());
7087+ + }
7088+ +
7089+ + @Test
7090+ + public void testDisplayName() {
7091+ + Assert.assertEquals(TEST_NAME + " v" + TEST_VERSION, this.pluginMeta.getDisplayName());
7092+ + }
7093+ + }
70557094diff --git a/src/test/java/io/papermc/paper/plugin/SyntheticEventTest.java b/src/test/java/io/papermc/paper/plugin/SyntheticEventTest.java
70567095new file mode 100644
70577096index 0000000000000000000000000000000000000000..51c08740edffd152c8e2b6d3676ff7f1ce6090c6
0 commit comments