mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-19 14:59:20 +00:00
Fixed a circular dependency issue when a locale couldn't be found
This commit is contained in:
@@ -31,6 +31,11 @@ tasks {
|
||||
// for example Velocity, the relocation will be gone for Velocity)
|
||||
addRelocations(project, sJar)
|
||||
}
|
||||
|
||||
val destinationDir = System.getenv("DESTINATION_DIRECTORY");
|
||||
if (destinationDir != null) {
|
||||
destinationDirectory.set(file(destinationDir))
|
||||
}
|
||||
}
|
||||
named("build") {
|
||||
dependsOn(shadowJar)
|
||||
|
||||
@@ -32,6 +32,8 @@ import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.Singleton;
|
||||
import com.google.inject.name.Named;
|
||||
import com.google.inject.name.Names;
|
||||
import java.util.logging.Logger;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
@@ -66,6 +68,7 @@ public final class BungeePlatformModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(PlatformUtils.class).to(BungeePlatformUtils.class);
|
||||
bind(Logger.class).annotatedWith(Names.named("logger")).toInstance(plugin.getLogger());
|
||||
bind(FloodgateLogger.class).to(JavaUtilFloodgateLogger.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,18 +28,24 @@ package org.geysermc.floodgate.logger;
|
||||
import static org.geysermc.floodgate.util.MessageFormatter.format;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import com.google.inject.name.Named;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.geysermc.floodgate.api.logger.FloodgateLogger;
|
||||
import org.geysermc.floodgate.config.FloodgateConfig;
|
||||
import org.geysermc.floodgate.util.LanguageManager;
|
||||
|
||||
@Singleton
|
||||
public final class JavaUtilFloodgateLogger implements FloodgateLogger {
|
||||
@Inject private Logger logger;
|
||||
@Inject private LanguageManager languageManager;
|
||||
@Inject
|
||||
@Named("logger")
|
||||
private Logger logger;
|
||||
private LanguageManager languageManager;
|
||||
|
||||
@Inject
|
||||
private void init(FloodgateConfig config) {
|
||||
private void init(LanguageManager languageManager, FloodgateConfig config) {
|
||||
this.languageManager = languageManager;
|
||||
if (config.isDebug()) {
|
||||
logger.setLevel(Level.ALL);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.Singleton;
|
||||
import com.google.inject.name.Named;
|
||||
import com.google.inject.name.Names;
|
||||
import java.util.logging.Logger;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@@ -60,6 +62,7 @@ public final class SpigotPlatformModule extends AbstractModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(PlatformUtils.class).to(SpigotPlatformUtils.class);
|
||||
bind(Logger.class).annotatedWith(Names.named("logger")).toInstance(plugin.getLogger());
|
||||
bind(FloodgateLogger.class).to(JavaUtilFloodgateLogger.class);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user