Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

YertinMC/LibSlf4jCompat

Repository files navigation

LibSlf4jCompat

GitHub commit activityGitHub contributorsGitHub release (latest by date)GitHub forksGitHub Repo starsGitHubGitHub issuesGitHub pull requestsGitHub closed pull requestsGitHub language countGitHub Workflow Status

This plugin adds slf4j to Bukkit servers.

Reason

Before 13w39a(not included, this is a snapshot of 1.7.2, note that 1.7 is only a pre-release of 1.7.2 after this snapshot), Minecraft uses java.util.logging(aka as JUL or JDK14 Logging) as the logger of the game.

After 13w39a(included), Minecraft uses Log4j directly as the logger of the game.

After 1.17-pre1(included), Minecraft added slf4j and its Log4j binding to instead direct using of Log4j.

slf4j is easy to use but not included in old versions, so you can use this plugin.

This plugin provided three jars:

  • Only slf4j api
  • API and JUL binding(for 13w38c and below, or 1.6.4 and below)
  • API and Log4j binding(for 13w39a to 21w20a, or 1.7 to 1.16.5)

Using

For user

You can download the correct version(see Reason) of release jar here and put it into plugins directory of the server.

For developer

Step1. Bukkit

Add this to you plugin.yml:

softdepend:
    - LibSlf4jCompat

Step2. SLF4J

Add slf4j dependency or use high version bukkit api.

DO NOT add this plugin using maven, there are some error on maven publishing

Gradle
dependencies {
    implementation 'org.slf4j:slf4j-api:2.0.0-alpha5'
}
Maven
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.0-alpha5</version>
    <scope>compile</scope>
</dependency>

LICENSE

This project licensed under MIT license(same as slf4j).

For more information, see LICENSE file.