generated from GeyserMC/GeyserExampleExtension
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2290a6
commit 9fa4c8f
Showing
15 changed files
with
325 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
container: | ||
image: gradle:8-jdk17 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
- name: Gradle Build | ||
run: gradle shadowJar | ||
- name: Auto Release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
prerelease: false | ||
title: "Build" | ||
files: | | ||
build/libs/TransferTool-*.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,53 @@ | ||
# Geyser Extension Template | ||
A Geyser Extension template for creating Geyser Extensions. | ||
|
||
## What are Geyser extensions? | ||
Geyser Extensions are the equivalent of “plugins”, but specifically for the Geyser platform. This brings the advantage of them being platform-agnostic, meaning that you won’t have to worry about supporting all platforms individually. Additionally, they will be, by design, only applied for Bedrock players joining via Geyser. | ||
|
||
## What can extensions do? | ||
- Register [custom items](https://wiki.geysermc.org/geyser/custom-items/), [custom blocks](https://wiki.geysermc.org/geyser/custom-blocks/#geyser-extensions) and more in code! | ||
- Listen and toggle various Bedrock features (i.e. commands) | ||
- Send forms to Bedrock players using [Cumulus](https://github.com/GeyserMC/Cumulus) | ||
- Listen and interact with [Events](https://wiki.geysermc.org/geyser/events/) | ||
|
||
## GeyserAPI / Geyer Extension docs: | ||
- [Geyser extensions guide](https://wiki.geysermc.org/geyser/extensions/) | ||
- [Geyser API introduction](https://wiki.geysermc.org/geyser/api/) | ||
- [Introduction to Events](https://wiki.geysermc.org/geyser/events/) | ||
|
||
## Using this Template | ||
1. Create a new repository using this template | ||
2. Replace the data in `extension.yml` with data relevant to your extension | ||
3. Update the main extension class | ||
4. Run `./gradlew build` to build the extension | ||
5. Copy the built jar from `build/libs` to your Geyser's extensions folder | ||
|
||
## Documentation | ||
Our [wiki](https://wiki.geysermc.org/) has helpful articles | ||
|
||
## Coming Soon | ||
- Custom entities | ||
- Resource packs represented in code | ||
|
||
## Existing Extensions | ||
See our list [here](https://github.com/GeyserMC/GeyserExtensionList). | ||
|
||
## Suggestions? | ||
Reach out on our [Discord](https://discord.gg/geysermc)! | ||
|
||
## Important Notes | ||
- `extension.yml` is required for Geyser to load the extension. It must be in the resources folder. | ||
- Geyser Extensions: https://github.com/GeyserMC/Geyser/blob/master/api/src/main/java/org/geysermc/geyser/api/extension/Extension.java | ||
- Geyser API docs: https://github.com/GeyserMC/Geyser/blob/master/api/src/main/java/org/geysermc/geyser/api/ | ||
|
||
# TransferTool | ||
|
||
A Geyser extension that allows you to map Java -> Geyser servers to transfer players to. | ||
|
||
# Introduction | ||
Since 1.20.5/6, there is a native Java transfer packet. For once, this is a feature that Bedrock already did have! | ||
However, there is one notable difference: Geyser receives the Java client ip/port to transfer players to. If Geyser | ||
just passes that to the Bedrock client, the client likely would not find a Bedrock server there*. | ||
In most cases, this would not happen. Hence, this Geyser extension allows you to customize which Geyser - or Bedrock server - | ||
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 usually the case. | ||
|
||
# Configuration | ||
There are currently two configuration options: | ||
- "forwardOriginalTarget" (boolean; possible values true/false): <br> | ||
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) <br> | ||
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). | ||
|
||
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 ":<port>" 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" | ||
} | ||
``` | ||
|
||
To add more transfer mappings, create a new line - just like in the example. | ||
Note for ipv6 addresses, you'll need to wrap the ipv6 with square brackets (see [here](https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers)) | ||
|
||
# Installation | ||
To install this Geyser extension, download the TransferTool.jar from the Releases tab, and add it to Geyser's extension folder. | ||
One restart later, and this extension is ready to be used! To reload the config, you can use Geyser's reload command (`/geyser reload`). | ||
|
||
# Getting Help | ||
Help is provided via discord: https://discord.gg/WdmrRHRJhS. Alternatively, if you are getting errors or | ||
are running into complications, feel free to open an issue here! Feature requests can also be made that way. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
plugins { | ||
java | ||
id("io.github.goooler.shadow") version "8.1.7" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven("https://repo.opencollab.dev/main/") | ||
} | ||
|
||
dependencies { | ||
// Geyser API - needed for all extensions | ||
compileOnly("org.geysermc.geyser:api:2.3.1-SNAPSHOT") | ||
|
||
// Include other dependencies here - e.g. for configuration. | ||
implementation("org.spongepowered:configurate-hocon:4.1.2") | ||
} | ||
|
||
java { | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
|
||
tasks { | ||
build { | ||
dependsOn(shadowJar) | ||
} | ||
|
||
jar { | ||
archiveClassifier.set("unshaded") | ||
} | ||
|
||
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") | ||
} | ||
} | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = "TransferTool" |
Oops, something went wrong.