Fix shading mess and make the plugin start

This commit is contained in:
Alexander Söderberg 2020-08-16 12:43:57 +02:00
parent 12def37194
commit 28d6d4db92
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678
4 changed files with 21 additions and 4 deletions

View File

@ -98,13 +98,24 @@ task copyFiles {
}
}
def adventureVersion = '4.0.0-SNAPSHOT'
shadowJar {
dependencies {
include(dependency(":PlotSquared-Core"))
include(dependency("io.papermc:paperlib:1.0.4"))
include(dependency("net.kyori:adventure-platform-bukkit:4.0.0-SNAPSHOT"))
include(dependency("net.kyori:adventure-platform-bukkit:${adventureVersion}"))
include(dependency("net.kyori:adventure-text-minimessage:3.0.0-SNAPSHOT"))
include(dependency("net.kyori:adventure-text-serializer-bungeecord:${adventureVersion}"))
include(dependency("net.kyori:adventure-text-serializer-legacy:${adventureVersion}"))
include(dependency("net.kyori:adventure-text-serializer-gson:${adventureVersion}"))
include(dependency("net.kyori:adventure-api:${adventureVersion}"))
include(dependency("net.kyori:adventure-platform-api:${adventureVersion}"))
include(dependency("net.kyori:adventure-platform-common:${adventureVersion}"))
include(dependency("net.kyori:adventure-platform-viaversion:${adventureVersion}"))
include(dependency("net.kyori:adventure-nbt:${adventureVersion}"))
include(dependency("net.kyori:examination-api:1.0.0-SNAPSHOT"))
include(dependency("net.kyori:examination-string:1.0.0-SNAPSHOT"))
include(dependency("org.bstats:bstats-bukkit:1.7"))
include(dependency("org.khelekore:prtree:1.7.0-SNAPSHOT"))
include(dependency("com.sk89q:squirrelid:1.0.0-SNAPSHOT"))
@ -117,7 +128,7 @@ shadowJar {
include(dependency('aopalliance:aopalliance:1.0'))
}
relocate('net.kyori.text', 'com.plotsquared.formatting.text')
relocate('net.kyori.adventure', 'com.plotsquared.core.configuration.adventure')
relocate("io.papermc.lib", "com.plotsquared.bukkit.paperlib")
relocate("org.bstats", "com.plotsquared.metrics")
relocate('com.sk89q.squirrelid', 'com.plotsquared.squirrelid')
@ -125,6 +136,7 @@ shadowJar {
relocate('org.apache.logging.slf4j', 'com.plotsquared.logging.apache')
relocate('org.slf4j', 'com.plotsquared.logging.slf4j')
relocate('com.google.inject', 'com.plotsquared.google')
relocate('javax.inject', 'com.plotsquared.core.inject.javax')
archiveFileName = "${project.name}-${parent.version}.jar"
destinationDirectory = file "../target"

View File

@ -29,6 +29,7 @@ import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Singleton;
import com.google.inject.Stage;
import com.google.inject.TypeLiteral;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
@ -161,7 +162,7 @@ import static com.plotsquared.core.util.PremiumVerification.getResourceID;
import static com.plotsquared.core.util.PremiumVerification.getUserID;
import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
@SuppressWarnings("unused")
@SuppressWarnings("unused") @Singleton
public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPlatform<Player> {
private static final Logger logger = LoggerFactory.getLogger("P2/" + BukkitPlatform.class.getSimpleName());

View File

@ -84,6 +84,7 @@ public class BukkitModule extends AbstractModule {
bind(PlayerManager.class).to(BukkitPlayerManager.class);
bind(JavaPlugin.class).toInstance(bukkitPlatform);
bind(PlotPlatform.class).toInstance(bukkitPlatform);
bind(BukkitPlatform.class).toInstance(bukkitPlatform);
bind(IndependentPlotGenerator.class).annotatedWith(DefaultGenerator.class).to(HybridGen.class);
// Console actor
@Nonnull ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();

View File

@ -25,6 +25,7 @@
*/
package com.plotsquared.bukkit.listener;
import com.google.inject.Inject;
import com.plotsquared.bukkit.BukkitPlatform;
import com.plotsquared.bukkit.placeholder.MVdWPlaceholders;
import com.plotsquared.core.PlotSquared;
@ -35,11 +36,13 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerLoadEvent;
import javax.annotation.Nonnull;
public class ServerListener implements Listener {
private final BukkitPlatform plugin;
public ServerListener(BukkitPlatform plugin) {
@Inject public ServerListener(@Nonnull final BukkitPlatform plugin) {
this.plugin = plugin;
}