Stephan 8fbc8c9936 Prevent invalid status responses with empty/dummy player UUIDs (#3831)
Right now SpongeGameProfile.toMcProfile() converts all SpongeAPI GameProfiles
with empty UUIDs (= new UUID(0, 0)) to authlib GameProfiles with a null UUID.

This is fine in most cases but problematic for the sample/player list in
the status response. Empty UUIDs can be used there to create dummy entries,
to display custom messages in the server list instead of the online players.
(See e.g. https://github.com/Minecrell/ServerListPlus/wiki/Status-Configuration#player-hover-messages)

The Minecraft client completely rejects status responses that contain
GameProfiles with null UUIDs and/or null names. This is why it is
important that the empty UUID is not converted to a null UUID.

Prevent sending invalid responses to the client by making sure both
UUID and name are non-null in the player samples of the status response.

This fixes a regression in API 8 when using the ServerListPlus plugin
on Sponge. The problem was likely introduced in some GameProfile refactoring
(API 7 worked fine).
2023-04-12 16:34:12 +00:00
2022-10-16 16:42:11 -07:00
2023-04-02 00:50:06 +02:00
2022-12-12 19:33:52 -08:00
2022-12-12 19:33:52 -08:00

Sponge Java CI with Gradle

The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms. It is licensed under the MIT License.

Latest Builds

Sponge

Sponge Latest

Sponge 1.16.5

SpongeVanilla

SpongeVanilla Latest

SpongeVanilla 1.16.5

Prerequisites

Clone

The following steps will ensure your project is cloned properly.

  1. git clone --recursive https://github.com/SpongePowered/Sponge.git
  2. cd Sponge
  3. cp scripts/pre-commit .git/hooks

Setup

Note: Sponge uses Gradle as its build system. The repo includes the Gradle wrapper that will automatically download the correct Gradle version. Local installations of Gradle may work (as long as they are using Gradle 6.8+) but are untested. To execute the Gradle wrapper, run the ./gradlew script on Unix systems or only gradlew on Windows systems.

To have browsable sources for use in-IDE, run ./gradlew :decompile. This command will need to be re-ran after any change to Minecraft version or to .accesswidener files. If sources are not appearing properly, an IDE refresh should fix things.

IDE Setup

For Eclipse

  1. Make sure the Buildship plugin is installed (available on the Eclipse Marketplace)
  2. Import the project as an Existing Gradle Project (via File > Import > Gradle)

While we do our best to support any IDE, most of our developers use IntelliJ, so issues may pop up with Eclipse from time to time. We'll be happy to work to resolve those issues if reported via our issues page or fixed via PR.

For IntelliJ

  1. Make sure you have the Gradle plugin enabled (File > Settings > Plugins).
  2. Click File > New > Project from Existing Sources > Gradle and select the root folder for Sponge.
  3. Make sure Use default gradle wrapper is selected. Older/newer Gradle versions may work but we only test using the wrapper.

For both Eclipse and IntelliJ, a variety of run configurations will be generated which allow running the client and server in development. These run configurations will be re-generated on each project import, so any desired modifications should be done on copies of the configurations.

While these run configurations have Java versions attached to them, be aware that IntelliJ ignores that information entirely, and Eclipse will only be able to align those java versions with whatever JREs it is aware of.

Building

In order to build Sponge you simply need to run the gradlew build command. On Windows systems you should run gradlew build instead of ./gradlew build to invoke the Gradle wrapper. You can find the compiled JAR files in ./build/libs and ./vanilla/build/libs.

Updating your Clone

The following steps will update your clone with the official repo.

  1. git pull
  2. git submodule update --recursive
  3. ./gradlew build --refresh-dependencies

Contributing

Are you a talented programmer looking to contribute some code? We'd love the help!

  • Open a pull request with your changes, following our guidelines.
  • Please follow the above guidelines for your pull request(s) to be accepted.
S
Description
The engine behind cts.trueog.net
Readme MIT
59 MiB
0 Stars 2 Watchers 0 Forks
Languages
Java 100%