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:
Ursprung
0d5661f8a6
Commit
54eaccca0d
@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation(projects.viabackwardsCommon)
|
implementation(projects.viabackwardsCommon)
|
||||||
compileOnly(libs.sponge)
|
compileOnly(libs.sponge)
|
||||||
annotationProcessor(libs.sponge)
|
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
50
sponge/src/main/resources/META-INF/sponge_plugins.json
Normale Datei
50
sponge/src/main/resources/META-INF/sponge_plugins.json
Normale Datei
@ -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}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -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;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren