diff options
-rw-r--r-- | settings.gradle | 2 | ||||
-rw-r--r-- | spark-sponge/build.gradle | 19 | ||||
-rw-r--r-- | spark-sponge7/build.gradle | 43 | ||||
-rw-r--r-- | spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7CommandSender.java (renamed from spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java) | 4 | ||||
-rw-r--r-- | spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlatformInfo.java (renamed from spark-sponge/src/main/java/me/lucko/spark/sponge/SpongePlatformInfo.java) | 4 | ||||
-rw-r--r-- | spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java (renamed from spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java) | 31 | ||||
-rw-r--r-- | spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7TickHook.java (renamed from spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickHook.java) | 6 | ||||
-rw-r--r-- | spark-universal/build.gradle | 1 |
8 files changed, 64 insertions, 46 deletions
diff --git a/settings.gradle b/settings.gradle index 843c836..09d0a60 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ include ( 'spark-bungeecord', 'spark-velocity', 'spark-velocity4', - 'spark-sponge', + 'spark-sponge7', 'spark-sponge8', 'spark-forge', 'spark-fabric', diff --git a/spark-sponge/build.gradle b/spark-sponge/build.gradle deleted file mode 100644 index b81008c..0000000 --- a/spark-sponge/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - id 'net.kyori.blossom' version '1.3.0' -} - -dependencies { - implementation project(':spark-common') - compileOnly 'org.spongepowered:spongeapi:7.3.0' - annotationProcessor 'org.spongepowered:spongeapi:7.3.0' -} - -repositories { - maven { url "https://repo.spongepowered.org/maven" } -} - -blossom { - replaceTokenIn('src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java') - replaceToken '@version@', project.pluginVersion - replaceToken '@desc@', project.pluginDescription -} diff --git a/spark-sponge7/build.gradle b/spark-sponge7/build.gradle new file mode 100644 index 0000000..fe555b0 --- /dev/null +++ b/spark-sponge7/build.gradle @@ -0,0 +1,43 @@ +plugins { + id 'net.kyori.blossom' version '1.3.0' + id 'com.github.johnrengelman.shadow' version '7.0.0' +} + +dependencies { + implementation project(':spark-common') + compileOnly 'org.spongepowered:spongeapi:7.3.0' + annotationProcessor 'org.spongepowered:spongeapi:7.3.0' +} + +repositories { + maven { url "https://repo.spongepowered.org/maven" } +} + +blossom { + replaceTokenIn('src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java') + replaceToken '@version@', project.pluginVersion + replaceToken '@desc@', project.pluginDescription +} + +shadowJar { + archiveFileName = 'spark-sponge7.jar' + + relocate 'okio', 'me.lucko.spark.lib.okio' + relocate 'okhttp3', 'me.lucko.spark.lib.okhttp3' + relocate 'net.kyori.adventure', 'me.lucko.spark.lib.adventure' + relocate 'net.kyori.examination', 'me.lucko.spark.lib.adventure.examination' + relocate 'net.bytebuddy', 'me.lucko.spark.lib.bytebuddy' + relocate 'org.tukaani.xz', 'me.lucko.spark.lib.xz' + relocate 'com.google.protobuf', 'me.lucko.spark.lib.protobuf' + relocate 'org.objectweb.asm', 'me.lucko.spark.lib.asm' + relocate 'one.profiler', 'me.lucko.spark.lib.asyncprofiler' + + exclude 'module-info.class' + exclude 'META-INF/maven/**' + exclude 'META-INF/proguard/**' +} + +artifacts { + archives shadowJar + shadow shadowJar +} diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7CommandSender.java index b2c4b8c..b0cfd3c 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeCommandSender.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7CommandSender.java @@ -31,8 +31,8 @@ import org.spongepowered.api.text.serializer.TextSerializers; import java.util.UUID; -public class SpongeCommandSender extends AbstractCommandSender<CommandSource> { - public SpongeCommandSender(CommandSource source) { +public class Sponge7CommandSender extends AbstractCommandSender<CommandSource> { + public Sponge7CommandSender(CommandSource source) { super(source); } diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongePlatformInfo.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlatformInfo.java index 28f7513..91d7ea2 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongePlatformInfo.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7PlatformInfo.java @@ -25,10 +25,10 @@ import me.lucko.spark.common.platform.PlatformInfo; import org.spongepowered.api.Game; import org.spongepowered.api.Platform; -public class SpongePlatformInfo implements PlatformInfo { +public class Sponge7PlatformInfo implements PlatformInfo { private final Game game; - public SpongePlatformInfo(Game game) { + public Sponge7PlatformInfo(Game game) { this.game = game; } diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java index 45d8d80..7ac317b 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7SparkPlugin.java @@ -38,7 +38,6 @@ import org.spongepowered.api.config.ConfigDir; import org.spongepowered.api.event.Listener; import org.spongepowered.api.event.game.state.GameStartedServerEvent; import org.spongepowered.api.event.game.state.GameStoppingServerEvent; -import org.spongepowered.api.plugin.Dependency; import org.spongepowered.api.plugin.Plugin; import org.spongepowered.api.plugin.PluginContainer; import org.spongepowered.api.scheduler.AsynchronousExecutor; @@ -60,13 +59,9 @@ import javax.annotation.Nullable; name = "spark", version = "@version@", description = "@desc@", - authors = {"Luck"}, - dependencies = { - // explicit dependency on spongeapi with no defined API version - @Dependency(id = "spongeapi") - } + authors = {"Luck"} ) -public class SpongeSparkPlugin implements SparkPlugin { +public class Sponge7SparkPlugin implements SparkPlugin { private final PluginContainer pluginContainer; private final Logger logger; @@ -78,7 +73,7 @@ public class SpongeSparkPlugin implements SparkPlugin { private final ThreadDumper.GameThread threadDumper = new ThreadDumper.GameThread(); @Inject - public SpongeSparkPlugin(PluginContainer pluginContainer, Logger logger, Game game, @ConfigDir(sharedRoot = false) Path configDirectory, @AsynchronousExecutor SpongeExecutorService asyncExecutor) { + public Sponge7SparkPlugin(PluginContainer pluginContainer, Logger logger, Game game, @ConfigDir(sharedRoot = false) Path configDirectory, @AsynchronousExecutor SpongeExecutorService asyncExecutor) { this.pluginContainer = pluginContainer; this.logger = logger; this.game = game; @@ -100,7 +95,7 @@ public class SpongeSparkPlugin implements SparkPlugin { @Override public String getVersion() { - return SpongeSparkPlugin.class.getAnnotation(Plugin.class).version(); + return Sponge7SparkPlugin.class.getAnnotation(Plugin.class).version(); } @Override @@ -114,11 +109,11 @@ public class SpongeSparkPlugin implements SparkPlugin { } @Override - public Stream<SpongeCommandSender> getCommandSenders() { + public Stream<Sponge7CommandSender> getCommandSenders() { return Stream.concat( this.game.getServer().getOnlinePlayers().stream(), Stream.of(this.game.getServer().getConsole()) - ).map(SpongeCommandSender::new); + ).map(Sponge7CommandSender::new); } @Override @@ -146,12 +141,12 @@ public class SpongeSparkPlugin implements SparkPlugin { @Override public TickHook createTickHook() { - return new SpongeTickHook(this); + return new Sponge7TickHook(this); } @Override public PlatformInfo getPlatformInfo() { - return new SpongePlatformInfo(this.game); + return new Sponge7PlatformInfo(this.game); } @Override @@ -160,27 +155,27 @@ public class SpongeSparkPlugin implements SparkPlugin { } private static final class SparkCommand implements CommandCallable { - private final SpongeSparkPlugin plugin; + private final Sponge7SparkPlugin plugin; - private SparkCommand(SpongeSparkPlugin plugin) { + private SparkCommand(Sponge7SparkPlugin plugin) { this.plugin = plugin; } @Override public CommandResult process(CommandSource source, String arguments) { this.plugin.threadDumper.ensureSetup(); - this.plugin.platform.executeCommand(new SpongeCommandSender(source), arguments.split(" ")); + this.plugin.platform.executeCommand(new Sponge7CommandSender(source), arguments.split(" ")); return CommandResult.empty(); } @Override public List<String> getSuggestions(CommandSource source, String arguments, @Nullable Location<World> targetPosition) { - return this.plugin.platform.tabCompleteCommand(new SpongeCommandSender(source), arguments.split(" ")); + return this.plugin.platform.tabCompleteCommand(new Sponge7CommandSender(source), arguments.split(" ")); } @Override public boolean testPermission(CommandSource source) { - return this.plugin.platform.hasPermissionForAnyCommand(new SpongeCommandSender(source)); + return this.plugin.platform.hasPermissionForAnyCommand(new Sponge7CommandSender(source)); } @Override diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickHook.java b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7TickHook.java index b6903de..2618522 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickHook.java +++ b/spark-sponge7/src/main/java/me/lucko/spark/sponge/Sponge7TickHook.java @@ -25,11 +25,11 @@ import me.lucko.spark.common.tick.TickHook; import org.spongepowered.api.scheduler.Task; -public class SpongeTickHook extends AbstractTickHook implements TickHook, Runnable { - private final SpongeSparkPlugin plugin; +public class Sponge7TickHook extends AbstractTickHook implements TickHook, Runnable { + private final Sponge7SparkPlugin plugin; private Task task; - public SpongeTickHook(SpongeSparkPlugin plugin) { + public Sponge7TickHook(Sponge7SparkPlugin plugin) { this.plugin = plugin; } diff --git a/spark-universal/build.gradle b/spark-universal/build.gradle index 26dbd30..f784a9e 100644 --- a/spark-universal/build.gradle +++ b/spark-universal/build.gradle @@ -6,7 +6,6 @@ dependencies { implementation project(':spark-common') implementation project(':spark-bukkit') implementation project(':spark-bungeecord') - implementation project(':spark-sponge') } shadowJar { |