Skip to content

Commit

Permalink
fix: final getLogger method in JavaPlugin in some spigot versions & b…
Browse files Browse the repository at this point in the history
…ump to 1.3.16
  • Loading branch information
EinfachBeez committed Aug 21, 2024
1 parent 53c961c commit b9e250e
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bukkit-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.anweisen.utilities</groupId>
<artifactId>root</artifactId>
<version>1.3.15</version>
<version>1.3.16</version>
</parent>

<artifactId>bukkit-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ public final void onLoad() {
setFirstInstance(this);
}

ILogger.setConstantFactory(this.getLogger());
ILogger.setConstantFactory(this.getILogger());
trySaveDefaultConfig();
if (wasShutdown) isReloaded = true;
if (firstInstall = !getDataFolder().exists()) {
getLogger().info("Detected first install!");
getILogger().info("Detected first install!");
}
if (devMode = getConfigDocument().getBoolean("dev-mode") || getConfigDocument().getBoolean("dev-mode.enabled")) {
getLogger().setLevel(Level.ALL);
getLogger().debug("Devmode is enabled: Showing debug messages. This can be disabled in the plugin.yml ('dev-mode')");
getILogger().setLevel(Level.ALL);
getILogger().debug("Devmode is enabled: Showing debug messages. This can be disabled in the plugin.yml ('dev-mode')");
} else {
getLogger().setLevel(Level.INFO);
getILogger().setLevel(Level.INFO);
}

injectInstance();
Expand Down Expand Up @@ -167,8 +167,7 @@ public final boolean isFirstInstance() {
}

@Nonnull
@Override
public JavaILogger getLogger() {
public JavaILogger getILogger() {
return logger != null ? logger : (logger = new BukkitLoggerWrapper(super.getLogger()));
}

Expand Down Expand Up @@ -255,7 +254,7 @@ public final void registerCommand(@Nonnull CommandExecutor executor, @Nonnull St
private void registerCommand0(@Nonnull CommandExecutor executor, @Nonnull String name) {
PluginCommand command = getCommand(name);
if (command == null) {
getLogger().warn("Tried to register invalid command '{}'", name);
getILogger().warn("Tried to register invalid command '{}'", name);
} else {
command.setExecutor(executor);
}
Expand Down Expand Up @@ -329,11 +328,11 @@ public final void checkEnabled() {
}

private void registerAsFirstInstance() {
getLogger().info(getName() + " was loaded as the first BukkitModule");
getILogger().info(getName() + " was loaded as the first BukkitModule");
registerListener(
new MenuPositionListener()
);
getLogger().info("Detected server version {} -> {}", getServerVersionExact(), getServerVersion());
getILogger().info("Detected server version {} -> {}", getServerVersionExact(), getServerVersion());
}

private void trySaveDefaultConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void requireVersion(@Nonnull Version required) {
}

private void log(@Nonnull String line, @Nonnull Object... args) {
module.getLogger().error(line, args);
module.getILogger().error(line, args);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private Logger() {}

@Nonnull
public static ILogger getInstance() {
return BukkitModule.getProvidingModule(ReflectionUtils.getCaller()).getLogger();
return BukkitModule.getProvidingModule(ReflectionUtils.getCaller()).getILogger();
}

public static void error(@Nullable Object message, @Nonnull Object... args) {
Expand Down
2 changes: 1 addition & 1 deletion common-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.anweisen.utilities</groupId>
<artifactId>root</artifactId>
<version>1.3.15</version>
<version>1.3.16</version>
</parent>

<artifactId>common-utils</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion database-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.anweisen.utilities</groupId>
<artifactId>root</artifactId>
<version>1.3.15</version>
<version>1.3.16</version>
</parent>

<artifactId>database-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion database-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.anweisen.utilities</groupId>
<artifactId>root</artifactId>
<version>1.3.15</version>
<version>1.3.16</version>
</parent>

<artifactId>database-mongodb</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion database-sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.anweisen.utilities</groupId>
<artifactId>root</artifactId>
<version>1.3.15</version>
<version>1.3.16</version>
</parent>

<artifactId>database-sql</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jda-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.anweisen.utilities</groupId>
<artifactId>root</artifactId>
<version>1.3.15</version>
<version>1.3.16</version>
</parent>

<artifactId>jda-manager</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.anweisen.utilities</groupId>
<artifactId>root</artifactId>
<version>1.3.15</version>
<version>1.3.16</version>
<packaging>pom</packaging>

<modules>
Expand Down

0 comments on commit b9e250e

Please sign in to comment.