diff --git a/README.md b/README.md index 9e252e0..ed23e73 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Allows the connection to/from different Minecraft versions on your Minecraft cli This mod supports 1.14.4/1.15.x (on `ver/1.14` branch) and 1.16 snapshots (on `master` branch) with Fabric Loader. Check the Minecraft version in file name when downloading from GitHub Releases. -Note: ViaVersion is not designed for modded Minecraft with registry syncing (fabric-registry-sync mod). +Note: ViaVersion is not designed for modded Minecraft with registry synchronization (fabric-registry-sync mod). **Dependencies:** @@ -20,7 +20,7 @@ Note: ViaVersion is not designed for modded Minecraft with registry syncing (fab | ViaVersion 3.0.0+ | https://viaversion.com/ | | Fabric Textures v0 | https://www.curseforge.com/minecraft/mc-mods/fabric-api | | Fabric Resource Loader v0 | https://www.curseforge.com/minecraft/mc-mods/fabric-api | -| Fabric Commands v0 | https://www.curseforge.com/minecraft/mc-mods/fabric-api | +| Fabric Command API v1 | https://www.curseforge.com/minecraft/mc-mods/fabric-api | | (Included) Cotton Client Commands | https://www.curseforge.com/minecraft/mc-mods/cotton-client-commands | @@ -37,9 +37,18 @@ Adding [ViaBackwards](https://viaversion.com/backwards) (and optionally [ViaRewi A chart with compatible versions is available at https://viaversion.com +**Commands**: +There're 3 server-side alias ``/viaversion``, ``/vvfabric`` and ``/viaver``, and a client-side command ``/viafabricclient`` (OP permission level 3 is required for these commands, in the client it's received by [Entity Status Packet](https://wiki.vg/Entity_statuses#Player)) + + +**Configuration**: +ViaVersion configuration is available at ``.minecraft/config/viafabric/viaversion.yml`` +ViaFabric configuration is at ``.minecraft/config/viafabric/viafabric.yml`` + + **Alternatives to this mod:** -- [MultiConnect](https://www.curseforge.com/minecraft/mc-mods/multiconnect): this client-side mod does also translate older protocols and fixes some differences between versions, which ViaFabric don't. Currently (2020-06-23) it goes down to 1.10. +- [MultiConnect](https://www.curseforge.com/minecraft/mc-mods/multiconnect): this client-side mod does also translate older protocols and fixes some differences between versions, which ViaFabric don't. Currently, it goes down to 1.10. (2020-06-23) - [ProtocolSupport](https://protocol.support/): This plugin for Bukkit allows clients to connect from older versions (down to 1.4.7). ## WARNING -**I can not guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti cheat plugins. USE AT OWN RISK** +**I cannot guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti cheat plugins. USE AT OWN RISK** diff --git a/build.gradle.kts b/build.gradle.kts index 7d934f4..da0804e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -57,8 +57,8 @@ dependencies { modImplementation("net.fabricmc.fabric-api:fabric-api:0.13.1+build.370-1.16") - modImplementation("io.github.cottonmc:cotton-client-commands:1.0.0+1.15.2") - include("io.github.cottonmc:cotton-client-commands:1.0.0+1.15.2") + modImplementation("io.github.cottonmc:cotton-client-commands:1.0.1+1.16-rc1") + include("io.github.cottonmc:cotton-client-commands:1.0.1+1.16-rc1") } minecraft { diff --git a/src/main/java/com/github/creeper123123321/viafabric/ViaFabric.java b/src/main/java/com/github/creeper123123321/viafabric/ViaFabric.java index b60348f..85f2778 100644 --- a/src/main/java/com/github/creeper123123321/viafabric/ViaFabric.java +++ b/src/main/java/com/github/creeper123123321/viafabric/ViaFabric.java @@ -37,7 +37,7 @@ import com.mojang.brigadier.builder.RequiredArgumentBuilder; import io.netty.channel.DefaultEventLoop; import io.netty.channel.EventLoop; import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.registry.CommandRegistry; +import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.server.command.CommandSource; import org.apache.logging.log4j.LogManager; @@ -92,9 +92,9 @@ public class ViaFabric implements ModInitializer { FabricLoader.getInstance().getEntrypoints("viafabric:via_api_initialized", Runnable.class).forEach(Runnable::run); - CommandRegistry.INSTANCE.register(false, c -> c.register(command("viaversion"))); - CommandRegistry.INSTANCE.register(false, c -> c.register(command("viaver"))); - CommandRegistry.INSTANCE.register(false, c -> c.register(command("vvfabric"))); + CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("viaversion"))); + CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("viaver"))); + CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("vvfabric"))); config = new VRConfig(FabricLoader.getInstance().getConfigDirectory().toPath().resolve("ViaFabric") .resolve("viafabric.yml").toFile()); diff --git a/src/main/java/com/github/creeper123123321/viafabric/platform/VRPlatform.java b/src/main/java/com/github/creeper123123321/viafabric/platform/VRPlatform.java index 548293f..a61b46e 100644 --- a/src/main/java/com/github/creeper123123321/viafabric/platform/VRPlatform.java +++ b/src/main/java/com/github/creeper123123321/viafabric/platform/VRPlatform.java @@ -28,6 +28,7 @@ import com.github.creeper123123321.viafabric.ViaFabric; import com.github.creeper123123321.viafabric.commands.NMSCommandSender; import com.github.creeper123123321.viafabric.commands.UserCommandSender; import com.github.creeper123123321.viafabric.util.FutureTaskId; +import com.github.creeper123123321.viafabric.util.JLoggerToLog4j; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; import net.fabricmc.api.EnvType; @@ -45,6 +46,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Text; import net.minecraft.util.Util; +import org.apache.logging.log4j.LogManager; import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.ViaAPI; import us.myles.ViaVersion.api.ViaVersionConfig; @@ -74,6 +76,7 @@ import java.util.logging.Logger; import java.util.stream.Collectors; public class VRPlatform implements ViaPlatform { + private final Logger logger = new JLoggerToLog4j(LogManager.getLogger("ViaVersion")); private final VRViaConfig config; private final File dataFolder; private final ViaConnectionManager connectionManager; @@ -101,7 +104,7 @@ public class VRPlatform implements ViaPlatform { @Override public Logger getLogger() { - return ViaFabric.JLOGGER; + return logger; } @Override diff --git a/src/main/resources/assets/viafabric/config.yml b/src/main/resources/assets/viafabric/config.yml index e553f3f..32f38e9 100644 --- a/src/main/resources/assets/viafabric/config.yml +++ b/src/main/resources/assets/viafabric/config.yml @@ -1,5 +1,5 @@ # WARNING -# I can not guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti cheat plugins. USE AT OWN RISK +# I cannot guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti cheat plugins. USE AT OWN RISK # This option enables client-side transforming (can also be enabled in-game) enable-client-side: false # This option sets the protocol version to be used when connection to the server (can also be changed in-game) diff --git a/src/main/resources/assets/viafabric/lang/en_us.json b/src/main/resources/assets/viafabric/lang/en_us.json index 1a5c126..819cdb6 100644 --- a/src/main/resources/assets/viafabric/lang/en_us.json +++ b/src/main/resources/assets/viafabric/lang/en_us.json @@ -2,6 +2,6 @@ "gui.protocol_version_field.name": "Protocol Version", "gui.enable_client_side_button": "Enable ViaVersion", "gui.enable_client_side.question": "Are you sure you want to enable client-side mode?", - "gui.enable_client_side.warning": "I can not guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti-cheat plugins. USE AT OWN RISK.", + "gui.enable_client_side.warning": "I cannot guarantee that this mod is allowed on every (or even any) server. This mod may cause problems with anti-cheat plugins. USE AT OWN RISK.", "gui.enable_client_side.enable": "Enable" } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 6a00b46..6bedf7c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -27,7 +27,7 @@ "fabricloader": ">=0.4.0", "fabric-textures-v0": "*", "fabric-resource-loader-v0": "*", - "fabric-commands-v0": "*", + "fabric-command-api-v1": "*", "minecraft": ">1.15.2", "viaversion": ">=3.0.0-SNAPSHOT" },