3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-20 06:50:10 +01:00

Update Sponge module to API v8

Dieser Commit ist enthalten in:
Nassim Jahnke 2022-01-09 18:58:44 +01:00
Ursprung 0d5661f8a6
Commit 54eaccca0d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
9 geänderte Dateien mit 70 neuen und 29 gelöschten Zeilen

Datei anzeigen

@ -6,7 +6,7 @@ plugins {
tasks { tasks {
// Variable replacements // Variable replacements
processResources { processResources {
filesMatching(listOf("plugin.yml", "mcmod.info", "fabric.mod.json", "bungee.yml")) { filesMatching(listOf("plugin.yml", "META-INF/sponge_plugins.json", "fabric.mod.json", "bungee.yml")) {
expand("version" to project.version, "description" to project.description, "url" to "https://github.com/ViaVersion/ViaBackwards") expand("version" to project.version, "description" to project.description, "url" to "https://github.com/ViaVersion/ViaBackwards")
} }
} }

Datei anzeigen

@ -5,7 +5,7 @@ plugins {
allprojects { allprojects {
group = "com.viaversion" group = "com.viaversion"
version = "4.1.2-SNAPSHOT" version = "4.2.0-SNAPSHOT"
description = "Allow older clients to join newer server versions." description = "Allow older clients to join newer server versions."
} }

Datei anzeigen

@ -56,7 +56,7 @@ import java.util.logging.Logger;
public interface ViaBackwardsPlatform { public interface ViaBackwardsPlatform {
String MINIMUM_VV_VERSION = "4.1.1"; String MINIMUM_VV_VERSION = "4.2.0";
String IMPL_VERSION = "$IMPL_VERSION"; String IMPL_VERSION = "$IMPL_VERSION";
/** /**

Datei anzeigen

@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions] [versions]
# ViaVersion # ViaVersion
viaver = "4.1.0" viaver = "4.2.0-SNAPSHOT"
# Common provided # Common provided
netty = "4.0.20.Final" netty = "4.0.20.Final"
@ -15,8 +15,8 @@ checkerQual = "3.18.0"
# Platforms # Platforms
paper = "1.16.5-R0.1-SNAPSHOT" paper = "1.16.5-R0.1-SNAPSHOT"
bungee = "1.16-R0.5-SNAPSHOT" bungee = "1.16-R0.5-SNAPSHOT"
sponge = "5.0.0" sponge = "8.0.0"
velocity = "3.0.0-SNAPSHOT" velocity = "3.1.0-SNAPSHOT"
fabricLoader = "0.11.6" fabricLoader = "0.11.6"

Datei anzeigen

@ -8,7 +8,6 @@ dependencyResolutionManagement {
maven("https://repo.viaversion.com") maven("https://repo.viaversion.com")
maven("https://papermc.io/repo/repository/maven-public/") maven("https://papermc.io/repo/repository/maven-public/")
maven("https://oss.sonatype.org/content/repositories/snapshots/") maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/")
maven("https://repo.spongepowered.org/maven") maven("https://repo.spongepowered.org/maven")
mavenCentral() mavenCentral()
} }

Datei anzeigen

@ -1,5 +1,4 @@
dependencies { dependencies {
implementation(projects.viabackwardsCommon) implementation(projects.viabackwardsCommon)
compileOnly(libs.sponge) compileOnly(libs.sponge)
annotationProcessor(libs.sponge)
} }

Datei anzeigen

@ -20,46 +20,39 @@ package com.viaversion.viabackwards;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.viaversion.viabackwards.api.ViaBackwardsPlatform; import com.viaversion.viabackwards.api.ViaBackwardsPlatform;
import com.viaversion.viabackwards.utils.VersionInfo;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.sponge.util.LoggerWrapper; import com.viaversion.viaversion.sponge.util.LoggerWrapper;
import org.spongepowered.api.config.ConfigDir; import org.spongepowered.api.config.ConfigDir;
import org.spongepowered.api.event.Listener; import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.Order; import org.spongepowered.api.event.lifecycle.ConstructPluginEvent;
import org.spongepowered.api.event.game.state.GameInitializationEvent; import org.spongepowered.plugin.builtin.jvm.Plugin;
import org.spongepowered.api.plugin.Dependency;
import org.spongepowered.api.plugin.Plugin;
import java.io.File; import java.io.File;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.logging.Logger; import java.util.logging.Logger;
@Plugin(id = "viabackwards", @Plugin("viabackwards")
name = "ViaBackwards",
version = VersionInfo.VERSION,
authors = {"Matsv", "kennytv", "Gerrygames", "creeper123123321", "ForceUpdate1"},
description = "Allow older Minecraft versions to connect to a newer server version.",
dependencies = {@Dependency(id = "viaversion")}
)
public class SpongePlugin implements ViaBackwardsPlatform { public class SpongePlugin implements ViaBackwardsPlatform {
private Logger logger; @SuppressWarnings("SpongeLogging")
@Inject private final Logger logger;
private org.slf4j.Logger loggerSlf4j;
@Inject @Inject
@ConfigDir(sharedRoot = false) @ConfigDir(sharedRoot = false)
private Path configPath; private Path configPath;
@Listener(order = Order.LATE) @SuppressWarnings("SpongeInjection")
public void onGameStart(GameInitializationEvent e) { @Inject
// Setup Logger SpongePlugin(final org.apache.logging.log4j.Logger logger) {
this.logger = new LoggerWrapper(loggerSlf4j); this.logger = new LoggerWrapper(logger);
}
@Listener
public void constructPlugin(ConstructPluginEvent event) {
// Init! // Init!
Via.getManager().addEnableListener(() -> this.init(configPath.resolve("config.yml").toFile())); Via.getManager().addEnableListener(() -> this.init(configPath.resolve("config.yml").toFile()));
} }
@Override @Override
public void disable() { public void disable() {
// Not possible
} }
@Override @Override

Datei anzeigen

@ -0,0 +1,50 @@
{
"loader": {
"name": "java_plain",
"version": "1.0"
},
"license": "GNU GPLv3",
"global": {
"version": "${version}",
"links": {
"source": "https://github.com/ViaVersion/ViaBackwards",
"issues": "https://github.com/ViaVersion/ViaBackwards/issues"
},
"contributors": [
{
"name": "Matsv",
"description": "Maintainer"
},
{
"name": "kennytv",
"description": "Maintainer"
},
{
"name": "Gerrygames",
"description": "Contributor"
},
{
"name": "creeper123123321",
"description": "Contributor"
}
],
"dependencies": [
{
"id": "spongeapi",
"version": "8.0.0"
},
{
"id": "viaversion",
"version": "[4.2.0,)"
}
]
},
"plugins": [
{
"id": "viabackwards",
"name": "ViaBackwards",
"entrypoint": "com.viaversion.viabackwards.SpongePlugin",
"description": "${description}"
}
]
}

Datei anzeigen

@ -28,7 +28,7 @@ import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.viaversion.viabackwards.api.ViaBackwardsPlatform; import com.viaversion.viabackwards.api.ViaBackwardsPlatform;
import com.viaversion.viabackwards.utils.VersionInfo; import com.viaversion.viabackwards.utils.VersionInfo;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.sponge.util.LoggerWrapper; import com.viaversion.viaversion.velocity.util.LoggerWrapper;
import java.io.File; import java.io.File;
import java.nio.file.Path; import java.nio.file.Path;