diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 02466da..25412e4 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -1,8 +1,9 @@
-name: Build
+name: Build and Release
on:
push:
branches:
- - "master"
+ - "main"
+
jobs:
build:
name: Build
@@ -11,21 +12,30 @@ jobs:
image: gradle:8-jdk17
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v3
+
- name: Set up JDK
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'
+
- name: Gradle Build
- run: gradle shadowJar
- - name: Auto Release
- uses: "marvinpinto/action-automatic-releases@latest"
+ run: gradle build
+
+ - name: Release
+ uses: GeyserMC/actions/release@master
with:
- repo_token: "${{ secrets.GITHUB_TOKEN }}"
- automatic_release_tag: "latest"
- prerelease: false
- title: "Download here"
files: |
- build/libs/TransferTool.jar
\ No newline at end of file
+ build/libs/TransferTool-*.jar
+ appID: ${{ secrets.RELEASE_APP_ID }}
+ appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
+ saveMetadata: true
+ releaseEnabled: true
+ discordWebhook: ${{ secrets.DISCORD_WEBHOOK }}
+ ghReleaseNotes: true
+ releaseName: Build ${tagBase}
+ tagPrefix: release
+ tagIncrement: true
+ preRelease: false
\ No newline at end of file
diff --git a/README.md b/README.md
index 043831d..f404991 100644
--- a/README.md
+++ b/README.md
@@ -13,33 +13,56 @@ to transfer players to upon Geyser receives a Java transfer packet.
*unless Geyser is also running on the same Java port, but that's not always the case.
# Configuration
-There are currently two configuration options:
-- `forwardOriginalTarget` (boolean; possible values true/false):
+There are two main configuration options:
+- `forward-original-target` (boolean; possible values true/false):
Forwards the IP/port combination received from the Java server directly to the Bedrock client.
This would only be useful in the case where the Java server already accounts for the receiver to be a Geyser player,
and is already sending a Geyser server IP/port to connect to.
-- `transferMappings` (Map, String -> String)
+- `transfer-mappings` (Map, String -> String)
Maps a Java IP/port combination to a Bedrock IP/port combination. To represent a IP/address combination,
use the following format: `example.com:12892`, or `198.51.100.0:13132`. Alternatively, you can leave out the port,
this would fall back to the default Java/Bedrock ports (25565 for Java, and 19132 for Bedrock).
+Further, there is an option to add a Bedrock-only `/transfer` command. If enabled, Bedrock players can:
+- Transfer to pre-defined servers (set in `transfer-shortcuts`) by running '/transfer '
+- Transfer to any server - if they have the `transfertool.command.transfer.any` permission. Usage:
+`/transfer test.geysermc.org` or `/transfer test.geysermc.org:19132` or `/transfer test.geysermc.org 19132`
+
Example config:
-```
-# TranferTool Configuration
-
-# Whether to pass the IP/port sent by the Java server to the Bedrock client.
-# This option will only work properly if the Java server already accounts for Geyser clients
-# when sending transfer requests.
-forward-original-target=false
-
-# A map of Java IP/port combinations to Geyser IP/port combinations.
-# If you do not specify a port with a ":" addition,
-# it will use the default ports for Bedrock/Java respectively.
-transfer-mappings {
- "127.0.0.1:25565"="127.0.0.1:19132"
- "javaip.com"="bedrockip.com"
-}
+```yaml
+# TransferTool Configuration
+#
+# Documentation: https://onechris.dev/docs/extensions/transfertool/
+# Source: https://github.com/onebeastchris/TransferTool/
+
+# Whether to pass the IP/Port sent by the Java server to the Bedrock client.
+# This option will only work properly if the Java server already accounts for Geyser clients
+# when sending transfer requests.
+forward-original-target: false
+
+# A map of Java IP/Port combinations to Geyser IP/Port combinations.
+# If you do not specify a port with a ":" addition,
+# it will use the default ports for Bedrock/Java respectively.
+transfer-mappings:
+ 127.0.0.1:25565: 127.0.0.1:19132
+ javaip.com: bedrockip.com
+
+# Whether to add a '/transfertool transfer ' command to the server that can only be used by Bedrock players.
+# This uses the "server-names" below. Command permission: "transfertool.command.transfer".
+
+# Alternatively, users can transfer to any IP and Port combination if they additionally have the
+# "transfertool.command.transfer.any" permission.
+add-transfer-command: false
+
+# Allows configuring shortcuts for servers to use in the optional '/transfer ' command.
+# Has no use while "add-transfer-command" is false.
+transfer-shortcuts:
+ lobby: bedrockip.com
+ vanilla: 127.0.0.1:19132
+
+# The config version. DO NOT CHANGE!
+version: 1
```
To add more transfer mappings, create a new line - just like in the example.
diff --git a/build.gradle.kts b/build.gradle.kts
index 0e0928d..b01184c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,9 +1,11 @@
plugins {
java
id("io.freefair.lombok") version "8.4"
- id("io.github.goooler.shadow") version "8.1.7"
+ id("com.gradleup.shadow") version "8.3.3"
}
+version = "1.1.0"
+
repositories {
mavenCentral()
maven("https://repo.opencollab.dev/main/")
@@ -14,7 +16,9 @@ dependencies {
compileOnly("org.geysermc.geyser:api:2.4.1-SNAPSHOT")
// Include other dependencies here - e.g. for configuration.
+ // TODO remove
implementation("org.spongepowered:configurate-hocon:4.1.2")
+ implementation("org.spongepowered:configurate-yaml:4.2.0-GeyserMC-SNAPSHOT")
}
java {
@@ -34,9 +38,10 @@ tasks {
shadowJar {
archiveClassifier.set("")
- relocate("org.spongepowered.configurate", "net.onebeastchris.relocate.configurate")
- relocate("io.leangen.geantyref", "net.onebeastchris.relocate.geantyref")
- relocate("com.typesafe.config", "net.onebeastchris.relocate.typesafe")
+ archiveVersion.set(version.toString())
+ relocate("org.spongepowered.configurate", "dev.onechris.extension.transfertool.relocate.configurate")
+ relocate("io.leangen.geantyref", "dev.onechris.extension.transfertool.relocate.geantyref")
+ relocate("com.typesafe.config", "dev.onechris.extension.transfertool.relocate.typesafe")
}
}
diff --git a/src/main/java/dev/onechris/extension/transfertool/Config.java b/src/main/java/dev/onechris/extension/transfertool/Config.java
new file mode 100644
index 0000000..5a33306
--- /dev/null
+++ b/src/main/java/dev/onechris/extension/transfertool/Config.java
@@ -0,0 +1,51 @@
+package dev.onechris.extension.transfertool;
+
+import lombok.Getter;
+import org.spongepowered.configurate.objectmapping.ConfigSerializable;
+import org.spongepowered.configurate.objectmapping.meta.Comment;
+
+import java.util.Map;
+
+@Getter
+@ConfigSerializable
+public class Config {
+
+ @Comment("""
+ Whether to pass the IP/Port sent by the Java server to the Bedrock client.
+ This option will only work properly if the Java server already accounts for Geyser clients
+ when sending transfer requests.
+ """)
+ private boolean forwardOriginalTarget = false;
+
+ @Comment("""
+ A map of Java IP/Port combinations to Geyser IP/Port combinations.
+ If you do not specify a port with a ":" addition,
+ it will use the default ports for Bedrock/Java respectively.
+ """)
+ private Map transferMappings = Map.of(
+ "127.0.0.1:25565", "127.0.0.1:19132",
+ "javaip.com", "bedrockip.com");
+
+ @Comment("""
+ Whether to add a '/transfertool transfer ' command to the server that can only be used by Bedrock players.
+ This uses the "server-names" below. Command permission: "transfertool.command.transfer".
+
+ Alternatively, users can transfer to any IP and Port combination if they additionally have the
+ "transfertool.command.transfer.any" permission.
+ """)
+ private boolean addTransferCommand = false;
+
+ @Comment("""
+ Allows configuring shortcuts for servers to use in the optional '/transfertool transfer ' command.
+ Has no use while "add-transfer-command" is false.
+ """)
+ private Map transferShortcuts = Map.of(
+ "vanilla", "127.0.0.1:19132",
+ "lobby", "bedrockip.com"
+ );
+
+ @Comment("""
+ The config version. DO NOT CHANGE!
+ """)
+ private int version = 1;
+}
diff --git a/src/main/java/dev/onechris/extension/transfertool/ConfigLoader.java b/src/main/java/dev/onechris/extension/transfertool/ConfigLoader.java
new file mode 100644
index 0000000..ab03fe2
--- /dev/null
+++ b/src/main/java/dev/onechris/extension/transfertool/ConfigLoader.java
@@ -0,0 +1,78 @@
+package dev.onechris.extension.transfertool;
+
+import org.geysermc.geyser.api.extension.*;
+import org.spongepowered.configurate.CommentedConfigurationNode;
+import org.spongepowered.configurate.ConfigurateException;
+import org.spongepowered.configurate.hocon.HoconConfigurationLoader;
+import org.spongepowered.configurate.yaml.NodeStyle;
+import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+public class ConfigLoader {
+
+ private static final String HEADER = """
+ TransferTool Configuration
+
+ Documentation: https://onechris.dev/docs/extensions/transfertool/
+ Source: https://github.com/onebeastchris/TransferTool/
+ """;
+
+ public static Config loadConfig(Extension extension) throws IOException {
+ Files.createDirectories(extension.dataFolder());
+
+ Path oldPath = extension.dataFolder().resolve("transfertool.conf");
+ ExtensionLogger logger = extension.logger();
+ Config oldConfig = null;
+
+ boolean mustMigrate = oldPath.toFile().exists();
+
+ if (mustMigrate) {
+ logger.info("Starting TransferTool config migration...");
+
+ final HoconConfigurationLoader loader = HoconConfigurationLoader.builder()
+ .path(oldPath)
+ .defaultOptions(configurationOptions -> configurationOptions.header(HEADER))
+ .prettyPrinting(true)
+ .build();
+
+ try {
+ final CommentedConfigurationNode node = loader.load();
+ oldConfig = node.get(Config.class);
+ } catch (ConfigurateException e) {
+ logger.warning("Unable to read old config!" + e.getMessage());
+ }
+
+ oldPath.toFile().deleteOnExit();
+ }
+
+ final YamlConfigurationLoader loader = YamlConfigurationLoader.builder()
+ .path(extension.dataFolder().resolve("config.yml"))
+ .nodeStyle(NodeStyle.BLOCK)
+ .defaultOptions(configurationOptions -> configurationOptions.header(HEADER))
+ .build();
+
+ final CommentedConfigurationNode node = loader.load();
+
+ // Load the config with old values if available
+ Config config;
+ if (mustMigrate && oldConfig != null) {
+ config = node.get(Config.class, oldConfig);
+ } else {
+ config = node.get(Config.class);
+ }
+
+ if (config == null) {
+ throw new IllegalStateException("config is null!");
+ }
+
+ CommentedConfigurationNode newNode = CommentedConfigurationNode.root(loader.defaultOptions());
+ newNode.set(Config.class, config);
+
+ loader.save(newNode);
+ return config;
+ }
+}
+
diff --git a/src/main/java/dev/onechris/extension/transfertool/TransferTool.java b/src/main/java/dev/onechris/extension/transfertool/TransferTool.java
new file mode 100644
index 0000000..df519f3
--- /dev/null
+++ b/src/main/java/dev/onechris/extension/transfertool/TransferTool.java
@@ -0,0 +1,238 @@
+package dev.onechris.extension.transfertool;
+
+import org.geysermc.event.subscribe.Subscribe;
+import org.geysermc.geyser.api.command.Command;
+import org.geysermc.geyser.api.command.CommandSource;
+import org.geysermc.geyser.api.connection.GeyserConnection;
+import org.geysermc.geyser.api.event.java.ServerTransferEvent;
+import org.geysermc.geyser.api.event.lifecycle.GeyserDefineCommandsEvent;
+import org.geysermc.geyser.api.event.lifecycle.GeyserPreInitializeEvent;
+import org.geysermc.geyser.api.event.lifecycle.GeyserPreReloadEvent;
+import org.geysermc.geyser.api.event.lifecycle.GeyserRegisterPermissionsEvent;
+import org.geysermc.geyser.api.extension.Extension;
+import org.geysermc.geyser.api.extension.ExtensionLogger;
+import org.geysermc.geyser.api.util.TriState;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Consumer;
+
+public class TransferTool implements Extension {
+ private static ExtensionLogger logger;
+ private Map transferMappings = new HashMap<>();
+ private Map serverShortcuts = new HashMap<>();
+ private boolean followJavaTransfer = false;
+ private boolean registerTransferCommand = false;
+
+ @Subscribe
+ public void onEnable(GeyserPreInitializeEvent ignored) {
+ logger = this.logger();
+ loadConfig();
+ }
+
+ @Subscribe
+ public void onReload(GeyserPreReloadEvent ignored) {
+ logger.info("Reloading config!");
+ loadConfig();
+ }
+
+ @Subscribe
+ public void onTransferEvent(ServerTransferEvent event) {
+ logger().debug("TransferTool: Handling ServerTransferEvent: " + event.toString());
+
+ Destination target = new Destination(event.host(), event.port());
+ Destination bedrockTarget = transferMappings.get(target);
+ if (bedrockTarget != null) {
+ logger.debug(String.format("Transferring %s to %s based on transfer mapping", event.connection().name(), bedrockTarget));
+ event.bedrockPort(bedrockTarget.port);
+ event.bedrockHost(bedrockTarget.ip);
+ return;
+ } else if (followJavaTransfer) {
+ logger.debug(String.format("Transferring %s to %s due to java transfer forwarding", event.connection().name(), bedrockTarget));
+ event.bedrockHost(event.host());
+ event.bedrockPort(event.port());
+ return;
+ }
+
+ logger.debug(String.format("No target found for Java server %s:%s", event.host(), event.port()));
+ }
+
+ @Subscribe
+ public void registerPermissions(GeyserRegisterPermissionsEvent event) {
+ event.register("transfertool.command.reload", TriState.NOT_SET);
+
+ if (registerTransferCommand) {
+ event.register("transfertool.command.transfer", TriState.TRUE);
+ event.register("transfertool.command.transfer.any", TriState.NOT_SET);
+ }
+ }
+
+ @Subscribe
+ public void onCommandRegister(GeyserDefineCommandsEvent event) {
+ event.register(
+ Command.builder(this)
+ .name("reload")
+ .description("Reloads the TransferTool configuration")
+ .permission("transfertool.command.reload")
+ .source(CommandSource.class)
+ .executor(($, $$, $$$) -> onReload(null))
+ .build()
+ );
+
+ if (registerTransferCommand) {
+ event.register(
+ Command.builder(this)
+ .name("transfer")
+ .description("Transfers you to a another server.")
+ .bedrockOnly(true)
+ .playerOnly(true)
+ .permission("transfertool.command.transfer")
+ .source(GeyserConnection.class)
+ .executor(this::handleArgs)
+ .build()
+ );
+ }
+ }
+
+ private void handleArgs(GeyserConnection source, Command command, String[] args) {
+ // May occur if someone changes the config to no longer register the command.
+ // Commands cannot be unregistered :/
+ if (!registerTransferCommand) {
+ source.sendMessage("This command is not enabled!");
+ return;
+ }
+
+ switch (args.length) {
+ case 0 -> {
+ source.sendMessage("No server specified! Correct usage: '/transfertool transfer '");
+ if (mayTransferToAny(source)) {
+ source.sendMessage("Alternatively, transfer to any server with '/transfertool transfer '");
+ }
+ }
+ case 1 -> {
+ String arg = args[0];
+ Destination destination = serverShortcuts.get(arg);
+
+ if (destination == null) {
+ if (mayTransferToAny(source)) {
+ destination = Destination.fromCombined(arg, 19132, source::sendMessage);
+ } else {
+ source.sendMessage("Unknown server %s!".formatted(arg));
+ return;
+ }
+ }
+
+ transfer(source, destination);
+ }
+ case 2 -> {
+ if (!mayTransferToAny(source)) {
+ source.sendMessage("Too many arguments! Correct usage: '/transfertool transfer '");
+ return;
+ }
+
+ try {
+ int port = Integer.parseInt(args[1]);
+ Destination destination = new Destination(args[0], port);
+ transfer(source, destination);
+ } catch (NumberFormatException e) {
+ source.sendMessage("Invalid port! %s".formatted(args[1]));
+ }
+ }
+ default -> {
+ source.sendMessage("Received too many arguments (%s)!".formatted(args.length));
+ source.sendMessage("Provided args: %s".formatted(Arrays.toString(args)));
+ }
+ }
+ }
+
+ private void transfer(GeyserConnection source, Destination destination) {
+ if (destination != null) {
+ if (destination.ip == null || destination.ip.isBlank()) {
+ source.sendMessage("Empty IP provided!");
+ return;
+ }
+ source.transfer(destination.ip, destination.port);
+ } else {
+ source.sendMessage("Unknown destination!");
+ }
+ }
+
+ private boolean mayTransferToAny(GeyserConnection connection) {
+ return connection.hasPermission("transfertool.command.transfer.any");
+ }
+
+ private void loadConfig() {
+ Config config;
+ try {
+ config = ConfigLoader.loadConfig(this);
+ } catch (Exception e) {
+ logger.error("Unable to load TransferTool config! " + e.getMessage());
+ this.disable();
+ return;
+ }
+
+ this.followJavaTransfer = config.isForwardOriginalTarget();
+ Map map = new HashMap<>();
+
+ for (Map.Entry entry : config.getTransferMappings().entrySet()) {
+ map.put(Destination.fromCombined(entry.getKey(), 25565),
+ Destination.fromCombined(entry.getValue(), 19132));
+ }
+
+ logger.info("Registered %s transfer mappings.".formatted(map.size()));
+ this.transferMappings = map;
+ this.registerTransferCommand = config.isAddTransferCommand();
+
+ if (registerTransferCommand) {
+ Map shortcuts = new HashMap<>();
+ for (Map.Entry entry : config.getTransferShortcuts().entrySet()) {
+ shortcuts.put(entry.getKey(), Destination.fromCombined(entry.getValue(), 19132));
+ }
+
+ logger.info("Registered %s server name mappings.".formatted(shortcuts.size()));
+ this.serverShortcuts = shortcuts;
+ }
+ }
+
+ private record Destination(String ip, int port) {
+
+ public static Destination fromCombined(String input, int fallbackPort) {
+ return fromCombined(input, fallbackPort, logger::error);
+ }
+
+ public static Destination fromCombined(String input, int fallbackPort, Consumer caller) {
+ String ip = input;
+ int port = fallbackPort;
+
+ if (input.contains(":")) {
+ String parsePort;
+ if (input.startsWith("[")) {
+ // Handle IPv6 addresses... since Bedrock technically supports these?
+ int closingBracketIndex = input.indexOf("]");
+ ip = input.substring(1, closingBracketIndex);
+ parsePort = input.substring(closingBracketIndex + 2);
+ } else {
+ // Handle IPv4 addresses or domain names
+ int colonIndex = input.lastIndexOf(":");
+ ip = input.substring(0, colonIndex);
+ parsePort = input.substring(colonIndex + 1);
+ }
+
+ try {
+ port = Integer.parseInt(parsePort);
+ } catch (NumberFormatException e) {
+ caller.accept("Invalid port found: " + parsePort + " in input: " + input + "! " +
+ "Defaulting to default port (" + fallbackPort + ").");
+ }
+ }
+
+ return new Destination(ip, port);
+ }
+
+ @Override
+ public String toString() {
+ return ip + ":" + port;
+ }
+ }
+}
diff --git a/src/main/java/net/onebeastchris/extension/transfertool/TransferTool.java b/src/main/java/net/onebeastchris/extension/transfertool/TransferTool.java
deleted file mode 100644
index 74b4445..0000000
--- a/src/main/java/net/onebeastchris/extension/transfertool/TransferTool.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package net.onebeastchris.extension.transfertool;
-
-import org.geysermc.event.subscribe.Subscribe;
-import org.geysermc.geyser.api.event.java.ServerTransferEvent;
-import org.geysermc.geyser.api.event.lifecycle.GeyserPostInitializeEvent;
-import org.geysermc.geyser.api.event.lifecycle.GeyserPreReloadEvent;
-import org.geysermc.geyser.api.extension.Extension;
-import org.geysermc.geyser.api.extension.ExtensionLogger;
-import org.spongepowered.configurate.CommentedConfigurationNode;
-import org.spongepowered.configurate.ConfigurateException;
-import org.spongepowered.configurate.ConfigurationOptions;
-import org.spongepowered.configurate.hocon.HoconConfigurationLoader;
-
-import java.nio.file.Path;
-import java.util.HashMap;
-import java.util.Map;
-
-public class TransferTool implements Extension {
- private static ExtensionLogger logger;
- private Path configPath;
- private Map transferMappings = new HashMap<>();
- private boolean followJavaTransfer = false;
-
- @Subscribe
- public void onEnable(GeyserPostInitializeEvent ignored) {
- logger = this.logger();
- configPath = this.dataFolder().resolve("transfertool.conf");
- loadConfig();
- }
-
- @Subscribe
- public void onReload(GeyserPreReloadEvent ignored) {
- logger.info("Reloading config!");
- loadConfig();
- }
-
- @Subscribe
- public void onTransferEvent(ServerTransferEvent event) {
- logger().debug("TransferTool: Handling ServerTransferEvent: " + event.toString());
-
- Destination target = new Destination(event.host(), event.port());
-
- Destination bedrockTarget = transferMappings.get(target);
- if (bedrockTarget != null) {
- logger.debug(String.format("Transferring %s to %s based on transfer mapping", event.connection().name(), bedrockTarget));
- event.bedrockPort(bedrockTarget.port);
- event.bedrockHost(bedrockTarget.ip);
- return;
- } else if (followJavaTransfer) {
- logger.debug(String.format("Transferring %s to %s due to java transfer forwarding", event.connection().name(), bedrockTarget));
- event.bedrockHost(event.host());
- event.bedrockPort(event.port());
- return;
- }
-
- logger.debug(String.format("No target found for Java server %s:%s", event.host(), event.port()));
- }
-
- private void loadConfig() {
- TransferToolConfig config;
- final HoconConfigurationLoader loader = HoconConfigurationLoader.builder()
- .path(configPath)
- .defaultOptions(configurationOptions -> configurationOptions.header("TranferTool Configuration"))
- .prettyPrinting(true)
- .build();
-
- try {
- final CommentedConfigurationNode node = loader.load();
- config = node.get(TransferToolConfig.class);
- loader.save(node);
- } catch (ConfigurateException e) {
- this.logger().error("Could not load config! " + e.getMessage());
- this.logger().error("Disabling TransferTool...");
- e.printStackTrace();
- this.disable();
- return;
- }
-
- if (config == null) {
- this.logger().error("Could not load config! Disabling...");
- this.disable();
- return;
- }
-
- this.followJavaTransfer = config.isForwardOriginalTarget();
- HashMap map = new HashMap<>();
-
- for (Map.Entry entry : config.getTransferMappings().entrySet()) {
- map.put(Destination.fromCombined(entry.getKey(), 25565),
- Destination.fromCombined(entry.getValue(), 19132));
- }
-
- this.transferMappings = map;
- }
-
- private record Destination(String ip, int port) {
- public static Destination fromCombined(String input, int fallbackPort) {
- String ip = input;
- int port = fallbackPort;
-
- if (input.contains(":")) {
- String parsePort;
- if (input.startsWith("[")) {
- // Handle IPv6 addresses... since Bedrock apparently technically supports these?
- int closingBracketIndex = input.indexOf("]");
- ip = input.substring(1, closingBracketIndex);
- parsePort = input.substring(closingBracketIndex + 2);
- } else {
- // Handle IPv4 addresses or domain names
- int colonIndex = input.lastIndexOf(":");
- ip = input.substring(0, colonIndex);
- parsePort = input.substring(colonIndex + 1);
- }
-
- try {
- port = Integer.parseInt(parsePort);
- } catch (NumberFormatException e) {
- TransferTool.logger.error("Invalid port found: " + parsePort + " in input: " + input + "! " +
- "Defaulting to default port (" + fallbackPort + ").");
- }
- }
-
- return new Destination(ip, port);
- }
-
- @Override
- public String toString() {
- return ip + ":" + port;
- }
- }
-}
diff --git a/src/main/java/net/onebeastchris/extension/transfertool/TransferToolConfig.java b/src/main/java/net/onebeastchris/extension/transfertool/TransferToolConfig.java
deleted file mode 100644
index b7040e9..0000000
--- a/src/main/java/net/onebeastchris/extension/transfertool/TransferToolConfig.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package net.onebeastchris.extension.transfertool;
-
-import org.spongepowered.configurate.objectmapping.ConfigSerializable;
-import org.spongepowered.configurate.objectmapping.meta.Comment;
-
-import java.util.Map;
-
-@ConfigSerializable
-public class TransferToolConfig {
-
- @Comment("""
- Whether to pass the IP/Port sent by the Java server to the Bedrock client.
- This option will only work properly if the Java server already accounts for Geyser clients
- when sending transfer requests.
- """)
- private boolean forwardOriginalTarget = false;
-
- @Comment("""
- A map of Java ip/port combinations to Geyser ip/port combinations.
- If you do not specify a port with a ":" addition,
- it will use the default ports for Bedrock/Java respectively.
- """)
- private Map transferMappings = Map.of(
- "127.0.0.1:25565", "127.0.0.1:19132",
- "javaip.com", "bedrockip.com");
-
- public boolean isForwardOriginalTarget() {
- return forwardOriginalTarget;
- }
-
- public Map getTransferMappings() {
- return transferMappings;
- }
-}
diff --git a/src/main/resources/extension.yml b/src/main/resources/extension.yml
index b5c79bd..8c813f7 100644
--- a/src/main/resources/extension.yml
+++ b/src/main/resources/extension.yml
@@ -1,6 +1,6 @@
id: transfertool
name: TransferTool
-main: net.onebeastchris.extension.transfertool.TransferTool
+main: dev.onechris.extension.transfertool.TransferTool
api: 2.4.1
-version: 1.0.0
+version: 1.1.0
authors: [onebeastchris]